]> git.saurik.com Git - wxWidgets.git/commitdiff
s/wxGetTempFileName/wxFileName::CreateTempFileName
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Wed, 7 Jan 2009 01:01:35 +0000 (01:01 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Wed, 7 Jan 2009 01:01:35 +0000 (01:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57869 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/metafile.cpp
src/richtext/richtextbuffer.cpp
src/unix/dialup.cpp
src/unix/net.cpp

index 96c4771f805970ffde240db4317f3fd66bd7b580..36066ae594e0bcd1a141ccd0a4b024b023a1e408 100644 (file)
@@ -30,6 +30,7 @@
 #endif
 
 #include "wx/metafile.h"
+#include "wx/filename.h"
 
 #if wxUSE_METAFILE && !defined(wxMETAFILE_IS_ENH)
 
@@ -392,9 +393,11 @@ bool wxMakeMetafilePlaceable(const wxString& filename, int x1, int y1, int x2, i
     FILE *fd = wxFopen(filename.fn_str(), _T("rb"));
     if (!fd) return false;
 
-    wxChar tempFileBuf[256];
-    wxGetTempFileName(wxT("mf"), tempFileBuf);
-    FILE *fHandle = wxFopen(wxFNCONV(tempFileBuf), _T("wb"));
+    wxString tempFileBuf = wxFileName::CreateTempFileName(wxT("mf"));
+    if (tempFileBuf.empty())
+        return false;
+
+    FILE *fHandle = wxFopen(tempFileBuf.fn_str(), _T("wb"));
     if (!fHandle)
         return false;
     fwrite((void *)&header, sizeof(unsigned char), sizeof(mfPLACEABLEHEADER), fHandle);
index 33031e957a9dc762c63f6a48a494f5d4919e739b..f443e7647a18af7bed751a3fc33288c48b4625f6 100644 (file)
@@ -5905,7 +5905,7 @@ wxRichTextFileHandler *wxRichTextBuffer::FindHandlerFilenameOrType(const wxStrin
     else if (!filename.IsEmpty())
     {
         wxString path, file, ext;
-        wxSplitPath(filename, & path, & file, & ext);
+        wxFileName::SplitPath(filename, & path, & file, & ext);
         return FindHandler(ext, imageType);
     }
     else
@@ -7303,7 +7303,7 @@ bool wxRichTextFileHandler::SaveFile(wxRichTextBuffer *buffer, const wxString& f
 bool wxRichTextFileHandler::CanHandle(const wxString& filename) const
 {
     wxString path, file, ext;
-    wxSplitPath(filename, & path, & file, & ext);
+    wxFileName::SplitPath(filename, & path, & file, & ext);
 
     return (ext.Lower() == GetExtension());
 }
@@ -7424,12 +7424,10 @@ bool wxRichTextImageBlock::MakeImageBlock(const wxString& filename, wxBitmapType
 
     if ((imageType != wxBITMAP_TYPE_JPEG) && convertToJPEG)
     {
-        wxString tempFile;
-        bool success = wxGetTempFileName(_("image"), tempFile) ;
+        wxString tempFile =
+            wxFileName::CreateTempFileName(_("image"));
 
-        wxASSERT(success);
-
-        wxUnusedVar(success);
+        wxASSERT(!tempFile.IsEmpty());
 
         image.SaveFile(tempFile, wxBITMAP_TYPE_JPEG);
         filenameToRead = tempFile;
@@ -7464,11 +7462,8 @@ bool wxRichTextImageBlock::MakeImageBlock(wxImage& image, wxBitmapType imageType
     if (imageType == wxBITMAP_TYPE_INVALID)
         return false; // Could not determine image type
 
-    wxString tempFile;
-    bool success = wxGetTempFileName(_("image"), tempFile) ;
-
-    wxASSERT(success);
-    wxUnusedVar(success);
+    wxString tempFile = wxFileName::CreateTempFileName(_("image")) ;
+    wxASSERT(!tempFile.IsEmpty());
 
     if (!image.SaveFile(tempFile, m_imageType))
     {
@@ -7535,9 +7530,8 @@ bool wxRichTextImageBlock::Load(wxImage& image)
     wxMemoryInputStream mstream(m_data, m_dataSize);
     bool success = image.LoadFile(mstream, GetImageType());
 #else
-    wxString tempFile;
-    bool success = wxGetTempFileName(_("image"), tempFile) ;
-    wxASSERT(success);
+    wxString tempFile = wxFileName::CreateTempFileName(_("image"));
+    wxASSERT(!tempFile.IsEmpty());
 
     if (!WriteBlock(tempFile, m_data, m_dataSize))
     {
index 79b35d5370056078e090e7d18a09ebda929fd615..5de4670063c907fffada1d6722a1ba6c55aa70b2 100644 (file)
@@ -26,7 +26,7 @@
     #include "wx/timer.h"
 #endif // !PCH
 
-#include "wx/filefn.h"
+#include "wx/filename.h"
 #include "wx/ffile.h"
 #include "wx/process.h"
 #include "wx/crt.h"
@@ -673,7 +673,7 @@ wxDialUpManagerImpl::CheckIfconfig()
         wxASSERT_MSG( m_IfconfigPath.length(),
                       _T("can't use ifconfig if it wasn't found") );
 
-        wxString tmpfile = wxGetTempFileName( wxT("_wxdialuptest") );
+        wxString tmpfile = wxFileName::CreateTempFileName( wxT("_wxdialuptest") );
         wxString cmd = wxT("/bin/sh -c \'");
         cmd << m_IfconfigPath;
 #if defined(__AIX__) || \
index 8fff0bfdd1708b0cdce6dcae452e8e1fcf754ab5..a87a2e8442d7c860a019475f17349ca1688672ca 100644 (file)
@@ -21,7 +21,7 @@
 #include "wx/event.h"
 #include "wx/net.h"
 #include "wx/timer.h"
-#include "wx/filefn.h"
+#include "wx/filename.h"
 #include "wx/utils.h"
 #include "wx/log.h"
 #include "wx/file.h"
@@ -323,7 +323,7 @@ wxDialUpManagerImpl::CheckStatusInternal(void)
    {
       wxASSERT(m_IfconfigPath.length());
       
-      wxString tmpfile = wxGetTempFileName("_wxdialuptest");
+      wxString tmpfile = wxFileName::CreateTempFileName("_wxdialuptest");
       wxString cmd = "/bin/sh -c \'";
       cmd << m_IfconfigPath << " >" << tmpfile <<  '\'';
       /* I tried to add an option to wxExecute() to not close stdout,