KTemporaryFile::createLocalFile()
Dominik Haumann
dhdev at gmx.de
Wed Jul 4 19:50:29 BST 2007
Hi,
QTemporaryFile has static functions
QTemporaryFile * createLocalFile ( QFile & file )
QTemporaryFile * createLocalFile ( const QString & fileName )
We have the following scenario in Kate:
1. somehow get a (temporary) file that is not deleted
2. run a diff programm and write the data to this file
3. call KRun::runUrl() to open kompare to show the diff
4. as kompare has the option X-KDE-HasTempFileOption it will remove
the file on application exit
The code to solve (1) right now looks like this:
KTemporaryFile tmpfile;
tmpfile.setAutoRemove(false);
tmpfile.open();
QString fileName = tmpfile.fileName();
tmpfile.close();
K/QTemporaryFile does not provide this functionality directly, the attached patch adds
QString KTemporaryFile::createLocalFile()
with the above implementation.
Do we want that / ok to commit?
If so, do I have to wait for a monday or what are the terms right now?
Dominik
--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ktemporaryfile.patch
Type: text/x-diff
Size: 1418 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070704/8087016a/attachment.patch>
More information about the kde-core-devel
mailing list