summaryrefslogtreecommitdiff
path: root/graphics/kdegraphics3/files/patch-kfax.cpp
blob: 4bdb092f1459fc22f7962ef772dcba707cdde962 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- kfax/kfax.cpp.orig	Fri Dec  1 13:48:29 2000
+++ kfax/kfax.cpp	Fri Dec  1 13:51:10 2000
@@ -46,6 +46,7 @@
 #include <kmessagebox.h>
 #include <kcmdlineargs.h>
 #include <kio/netaccess.h>
+#include <ktempfile.h>
 
 #include "kfax.h"
 #include "kfax.moc"
@@ -994,14 +995,12 @@
       if(defaultpage.expander ==  g31expand)
 	faxtype = 31;
 
+      KTempFile tmpFile;
+      tmpFile.setAutoDelete(true);
 
-      QString tempfile;
-      tempfile = tmpnam(NULL);
+      fax2tiffmain(pn->pathname,QFile::encodeName(tmpFile.name()),pn->lsbfirst,pn->vres?0:1,faxtype);
 
-      fax2tiffmain(pn->pathname,tempfile.ascii(),pn->lsbfirst,pn->vres?0:1,faxtype);
-      fax2psmain(tempfile.ascii(),psfile,width,height,pi.scale);
-
-      remove(tempfile.ascii());
+      fax2psmain(QFile::encodeName(tmpFile.name()),psfile,width,height,pi.scale);
 
     }