-
- 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();