From kde-core-devel Wed Nov 29 14:23:50 2000 From: Kevin Lo Date: Wed, 29 Nov 2000 14:23:50 +0000 To: kde-core-devel Subject: [Patch] kdegraphics/kfax/kfax.cpp X-MARC-Message: https://marc.info/?l=kde-core-devel&m=97550770913891 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------63171A46D39F3D1F4AC3938F" This is a multi-part message in MIME format. --------------63171A46D39F3D1F4AC3938F Content-Type: text/plain; charset=big5 Content-Transfer-Encoding: 7bit Hi KDE big brothers :-) This patch is to use KTempFile instead of tmpnam. Please apply it or I can commit it if no problem, thanks. Best regards, Kevin. --------------63171A46D39F3D1F4AC3938F Content-Type: text/plain; charset=big5; name="patch-kfax.cpp" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-kfax.cpp" --- kfax/kfax.cpp.orig Wed Nov 29 20:39:24 2000 +++ kfax/kfax.cpp Wed Nov 29 22:19:37 2000 @@ -46,6 +46,7 @@ #include #include #include +#include #include "kfax.h" #include "kfax.moc" @@ -994,9 +995,9 @@ if(defaultpage.expander == g31expand) faxtype = 31; - - QString tempfile; - tempfile = tmpnam(NULL); + KTempFile tmpFile; + tmpFile.setAutoDelete(true); // delete file when we are done. + QString tempfile = tmpFile.name(); fax2tiffmain(pn->pathname,tempfile.ascii(),pn->lsbfirst,pn->vres?0:1,faxtype); fax2psmain(tempfile.ascii(),psfile,width,height,pi.scale); @@ -1012,6 +1013,7 @@ else fclose(psfile); + unlink(tmpFile); QApplication::restoreOverrideCursor(); XDefineCursor(qtdisplay, Win, ReadyCursor); --------------63171A46D39F3D1F4AC3938F--