Test for KDE and GNOME using session manager vendor.

Use it in mime types initialization.
   Add wxUSE_DETECT_SM


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42098 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2006-10-18 21:55:54 +00:00
parent 0fb2e8796d
commit 88bbc3329b
7 changed files with 919 additions and 382 deletions

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