KTempFile->QTemporaryFile
Scott Wheeler
wheeler at kde.org
Mon Sep 11 12:45:14 BST 2006
On Monday 11 September 2006 10:37, Thiago Macieira wrote:
> Scott Wheeler wrote:
> >Is there a reason that TT couldn't just add a static method to set the
> > default temp dir? i.e. QDir::setTempDir()? Then that could just be
> > set in KApplication and would be one less thing that would have to be
> > overridden.
>
> It probably can and should be done. But KDE has two temporary dirs
> ($KDETMPDIR and $KDEVARTMPDIR). I don't know how those two work
> internally, but a static method won't do if both use KTempFile.
It seems that internally KTempFile only has one default path, but also allows
the user to specify a directory (well, rather it interprets the "name" as a
path prefix rather than a template name a la QTemporaryFile).
I know you're no longer among the trolls, but since you asked, a constructor
that was the following would seem to get around this issue:
QTemporaryFile(const QDir &dir, const QString &templateName)
...potentially with the other constructors doubled as well.
There are a handful of other methods(file(), textStream(), dataStream()) that
are widely used, but still possible (if more cumbersome) with the Qt 4 API.
Whether a wrapper class would still be justified is debatable.
-Scott
--
The first principle is that you must not fool yourself and you are the easiest
person to fool.
--Richard Feynman
More information about the kde-core-devel
mailing list