[Interest] Deleting the QNetworkAccessManager post(req, iodev) QIODevice?
Jason H
jhihn at gmx.com
Thu Mar 3 15:10:10 CET 2016
> Sent: Wednesday, March 02, 2016 at 6:26 PM
> From: "Thiago Macieira" <thiago.macieira at intel.com>
> To: interest at qt-project.org
> Subject: Re: [Interest] Deleting the QNetworkAccessManager post(req, iodev) QIODevice?
>
> On quinta-feira, 3 de março de 2016 00:08:38 PST Jason H wrote:
> > > Another idea: why don't you use QTemporaryFile?
> >
> > Thought about it. It takes a template specification which does not allow me
> > to specify the exact filename. "If the templateName does not contain XXXXXX
> > it will automatically be appended and used as the dynamic portion of the
> > filename."
>
> Why do you need a specific name?
>
> What happens if another application needs that same name at the same time?
> Will you delete the other application's file?
The filename is returned by a function which encodes the primary key as the filename, which then is used to mark the item as done when the result is http status code is 200. Without it, I have to track the file item mapping to filename somehow.
As for why I am doing all of that, I am implementing a Qt replacement for iOS-like NSURLSession delegate which requires background uploads to be written to a file. I set the taskDescription to the filename, grab it back in didCompelteWithError, where I update the database and delete the file. The Qt version does not have a description field, so I *have* to use the file name or some other mapping.
More information about the Interest
mailing list