]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filename.cpp
removed wxGTK2 hack, not needed any more
[wxWidgets.git] / src / common / filename.cpp
index 7be190fe44bbfa1679c169a2898ee80619f454be..959224c908482fe8f464e90118022929e8fd7f52 100644 (file)
@@ -604,11 +604,25 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp)
     // use the directory specified by the prefix
     SplitPath(prefix, &dir, &name, NULL /* extension */);
 
+    if (dir.empty())
+    {
+        dir = wxGetenv(_T("TMPDIR"));
+        if (dir.empty())
+        {
+            dir = wxGetenv(_T("TMP"));
+            if (dir.empty())
+            {
+                dir = wxGetenv(_T("TEMP"));
+            }
+        }
+    }
+
 #if defined(__WXWINCE__)
     if (dir.empty())
     {
         // FIXME. Create \temp dir?
-        dir = wxT("\\");
+        if (DirExists(wxT("\\temp")))
+            dir = wxT("\\temp");
     }
     path = dir + wxT("\\") + name;
     int i = 1;
@@ -651,27 +665,14 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp)
 #else // !Windows
     if ( dir.empty() )
     {
-#if defined(__WXMAC__) && !defined(__DARWIN__)
-        dir = wxMacFindFolder(  (short) kOnSystemDisk, kTemporaryFolderType, kCreateFolder ) ;
-#else // !Mac
-        dir = wxGetenv(_T("TMP"));
-        if ( dir.empty() )
-        {
-            dir = wxGetenv(_T("TEMP"));
-        }
-
-        if ( dir.empty() )
-        {
-            // default
-            #if defined(__DOS__) || defined(__OS2__)
-                dir = _T(".");
-            #elif defined(__WXMAC__)
-                dir = wxMacFindFolder(  (short) kOnSystemDisk, kTemporaryFolderType, kCreateFolder ) ;
-            #else
-                dir = _T("/tmp");
-            #endif
-        }
-#endif // Mac/!Mac
+        // default
+#if defined(__DOS__) || defined(__OS2__)
+        dir = _T(".");
+#elif defined(__WXMAC__)
+        dir = wxMacFindFolder(short(kOnSystemDisk), kTemporaryFolderType, kCreateFolder);
+#else
+        dir = _T("/tmp");
+#endif
     }
 
     path = dir;
@@ -752,9 +753,6 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp)
     path = pathTry;
 #endif // HAVE_MKTEMP/!HAVE_MKTEMP
 
-    if ( !path.empty() )
-    {
-    }
 #endif // HAVE_MKSTEMP/!HAVE_MKSTEMP
 
 #endif // Windows/!Windows
@@ -1241,8 +1239,11 @@ wxString wxFileName::GetForbiddenChars(wxPathFormat format)
 }
 
 /* static */
-wxString wxFileName::GetVolumeSeparator(wxPathFormat format)
+wxString wxFileName::GetVolumeSeparator(wxPathFormat WXUNUSED_IN_WINCE(format))
 {
+#ifdef __WXWINCE__
+    return wxEmptyString;
+#else
     wxString sepVol;
 
     if ( (GetFormat(format) == wxPATH_DOS) ||
@@ -1253,6 +1254,7 @@ wxString wxFileName::GetVolumeSeparator(wxPathFormat format)
     //else: leave empty
 
     return sepVol;
+#endif
 }
 
 /* static */