ext.Remove( 0, 2 );
wxArrayString exts;
exts.Add( ext );
-
+
AddToMimeData(mime, wxEmptyString, NULL, exts, wxEmptyString, true );
}
}
// 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);
}
}
// found
wxFileType *fileType = new wxFileType;
fileType->m_impl->Init(this, n);
-
+
return fileType;
}
}