From ee1b4beff5b30e60a658601c3317736f072925c2 Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Fri, 1 Dec 2000 05:58:44 +0000 Subject: Fix tmpnam() warning. Using KTempFile --- graphics/kdegraphics2/files/patch-kfax.cpp | 29 +++++++++++++++++++++++++++++ graphics/kdegraphics3/files/patch-kfax.cpp | 29 +++++++++++++++++++++++++++++ graphics/kdegraphics4/files/patch-kfax.cpp | 29 +++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 graphics/kdegraphics2/files/patch-kfax.cpp create mode 100644 graphics/kdegraphics3/files/patch-kfax.cpp create mode 100644 graphics/kdegraphics4/files/patch-kfax.cpp diff --git a/graphics/kdegraphics2/files/patch-kfax.cpp b/graphics/kdegraphics2/files/patch-kfax.cpp new file mode 100644 index 000000000000..4bdb092f1459 --- /dev/null +++ b/graphics/kdegraphics2/files/patch-kfax.cpp @@ -0,0 +1,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 + #include + #include ++#include + + #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); + + } + diff --git a/graphics/kdegraphics3/files/patch-kfax.cpp b/graphics/kdegraphics3/files/patch-kfax.cpp new file mode 100644 index 000000000000..4bdb092f1459 --- /dev/null +++ b/graphics/kdegraphics3/files/patch-kfax.cpp @@ -0,0 +1,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 + #include + #include ++#include + + #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); + + } + diff --git a/graphics/kdegraphics4/files/patch-kfax.cpp b/graphics/kdegraphics4/files/patch-kfax.cpp new file mode 100644 index 000000000000..4bdb092f1459 --- /dev/null +++ b/graphics/kdegraphics4/files/patch-kfax.cpp @@ -0,0 +1,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 + #include + #include ++#include + + #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); + + } + -- cgit v1.2.3