]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/mimetype.cpp
limit TLW size to display size in wxSizer::Fit() instead of doing it in wxTLW::GetMax...
[wxWidgets.git] / src / unix / mimetype.cpp
index deedf1062ef21e7cbce11d29796c9d3428ac810e..0c3768dd46017aa7fae0465ae66a35b075b24206 100644 (file)
@@ -57,6 +57,8 @@
 #include "wx/tokenzr.h"
 #include "wx/iconloc.h"
 #include "wx/filename.h"
+#include "wx/app.h"
+#include "wx/apptrait.h"
 
 #if wxUSE_LIBGNOMEVFS
     // Not GUI dependent
@@ -1310,15 +1312,15 @@ void wxMimeTypesManagerImpl::InitIfNeeded()
     {
         // set the flag first to prevent recursion
         m_initialized = true;
-
-    const wxString &wm = wxGetenv( wxT("WINDOWMANAGER") );
-
-    if (wm.Find( wxT("kde") ) != wxNOT_FOUND)
-        Initialize( wxMAILCAP_KDE  );
-    else if (wm.Find( wxT("gnome") ) != wxNOT_FOUND)
-        Initialize( wxMAILCAP_GNOME );
-    else
-        Initialize();
+        
+        wxString wm = wxTheApp->GetTraits()->GetDesktopEnvironment();
+        
+        if (wm == wxT("KDE"))
+            Initialize( wxMAILCAP_KDE  );
+        else if (wm == wxT("GNOME"))
+            Initialize( wxMAILCAP_GNOME );
+        else
+            Initialize();
     }
 }