]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/stdpaths.cpp
disable wxGLCanvas for wxMGL and wxDFB which don't support it
[wxWidgets.git] / src / unix / stdpaths.cpp
index 06a2e3078105e3dfb82516775447c0e4bc13f75a..edbaef8fed99b4429730254420305a71a79f9aab 100644 (file)
@@ -106,11 +106,9 @@ wxStandardPaths::GetLocalizedResourcesDir(const wxChar *lang,
 // wxStandardPaths implementation for Unix
 // ============================================================================
 
-void wxStandardPaths::DetectPrefix()
+wxString wxStandardPaths::GetExecutablePath() const
 {
 #ifdef __LINUX__
-    // under Linux, we can try to infer the prefix from the location of the
-    // executable
     wxString exeStr;
 
     char buf[4096];
@@ -137,6 +135,17 @@ void wxStandardPaths::DetectPrefix()
         wxGetEnv(wxT("   "), &exeStr);
     }
 
+    if ( !exeStr.empty() )
+        return exeStr;
+#endif // __LINUX__
+
+    return wxStandardPathsBase::GetExecutablePath();
+}
+
+void wxStandardPaths::DetectPrefix()
+{
+    // we can try to infer the prefix from the location of the executable
+    wxString exeStr = GetExecutablePath();
     if ( !exeStr.empty() )
     {
         // consider that we're in the last "bin" subdirectory of our prefix
@@ -144,7 +153,6 @@ void wxStandardPaths::DetectPrefix()
         if ( pos != wxString::npos )
             m_prefix.assign(exeStr, 0, pos);
     }
-#endif // __LINUX__
 
     if ( m_prefix.empty() )
     {