Replacing KTempFile with QTemporarFile

Nicolas Goutte nicolasg at snafu.de
Sun Sep 4 12:32:30 BST 2005


On Sunday 04 September 2005 13:09, Albert Astals Cid wrote:
> The new QTemporaryFile in class seems a good replacement to KTempFile, but
> with the problem that it uses QDir::tempPath() as path to create the temp
> file so it can not be used to create files like KTempFile does in
> $KDEHOME/tmp-$HOST/appname/
>
> Is that really an issue? If it is could we bribe trolls to add another
> constructor that accepts a path so we can pass it locateLocal("tmp",
> prefix)?

Have you tried?

Because mkstemp(3) allows paths to be part of the file name, so probably the 
corresponding QTemporaryFile's constructor could do it too.


The more important problem that I see with QTemporaryFile, is that 
QTemporaryFile does not allow to use an extension, as the XXXXXX must be at 
the end. (And that cannot be changed as it is due to mkstemp(3).)

So it does not replace KTempFile.

>
> Albert

Have a nice day!





More information about the kde-core-devel mailing list