X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..afab8b85c4bdeb11a248c57d13e9bcfa14149ef8:/src/unix/mimetype.cpp diff --git a/src/unix/mimetype.cpp b/src/unix/mimetype.cpp index 2f79104e23..265f86aae0 100644 --- a/src/unix/mimetype.cpp +++ b/src/unix/mimetype.cpp @@ -4,7 +4,6 @@ // Author: Vadim Zeitlin // Modified by: // Created: 23.09.98 -// RCS-ID: $Id$ // Copyright: (c) 1998 Vadim Zeitlin // Licence: wxWindows licence (part of wxExtra library) ///////////////////////////////////////////////////////////////////////////// @@ -267,7 +266,7 @@ void wxMimeTypesManagerImpl::LoadXDGGlobs(const wxString& filename) ext.Remove( 0, 2 ); wxArrayString exts; exts.Add( ext ); - + AddToMimeData(mime, wxEmptyString, NULL, exts, wxEmptyString, true ); } } @@ -507,14 +506,19 @@ void wxMimeTypesManagerImpl::InitIfNeeded() // set the flag first to prevent recursion m_initialized = true; - wxString wm = wxTheApp->GetTraits()->GetDesktopEnvironment(); + int mailcapStyles = wxMAILCAP_ALL; + if ( wxAppTraits * const traits = wxApp::GetTraitsIfExists() ) + { + wxString wm = traits->GetDesktopEnvironment(); - if (wm == wxT("KDE")) - Initialize( wxMAILCAP_KDE ); - else if (wm == wxT("GNOME")) - Initialize( wxMAILCAP_GNOME ); - else - Initialize(); + if ( wm == "KDE" ) + mailcapStyles = wxMAILCAP_KDE; + else if ( wm == "GNOME" ) + mailcapStyles = wxMAILCAP_GNOME; + //else: unknown, use the default + } + + Initialize(mailcapStyles); } } @@ -719,7 +723,7 @@ int wxMimeTypesManagerImpl::AddToMimeData(const wxString& strType, if ( nIndex == wxNOT_FOUND ) { // We put MIME types containing "application" at the end, so that - // if the MIME type for the extention "htm" is searched for, it will + // if the MIME type for the extension "htm" is searched for, it will // rather find "text/html" than "application/x-mozilla-bookmarks". if (mimeType.Find( "application" ) == 0) { @@ -844,7 +848,7 @@ wxFileType * wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ex // found wxFileType *fileType = new wxFileType; fileType->m_impl->Init(this, n); - + return fileType; } }