X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/05f616efaac1f5b9516afd85f44f9e8ee1bfd8f8..cc209a518f106f39fde26f8bc8dd3d9d53dc5cc5:/src/unix/mimetype.cpp diff --git a/src/unix/mimetype.cpp b/src/unix/mimetype.cpp index dd76cf2a6a..1bce2f3121 100644 --- a/src/unix/mimetype.cpp +++ b/src/unix/mimetype.cpp @@ -255,7 +255,18 @@ void wxMimeTypesManagerImpl::LoadXDGGlobs(const wxString& filename) if ( !file.Open() ) return; - // Parse it here + size_t i; + for (i = 0; i < file.GetLineCount(); i++) + { + wxStringTokenizer tok( file.GetLine(i), ":" ); + wxString mime = tok.GetNextToken(); + wxString ext = tok.GetNextToken(); + ext.Remove( 0, 2 ); + wxArrayString exts; + exts.Add( ext ); + + AddToMimeData(mime, wxEmptyString, NULL, exts, wxEmptyString, true ); + } } // ---------------------------------------------------------------------------- @@ -517,6 +528,7 @@ void wxMimeTypesManagerImpl::Initialize(int mailcapStyles, // Read MIME type - extension associations LoadXDGGlobs( "/usr/share/mime/globs" ); + LoadXDGGlobs( "/usr/local/share/mime/globs" ); // Load desktop files for XDG, and then override them with the defaults. // We will override them one desktop file at a time, rather