]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/mimetype.cpp
check that string passed to FromUTF8() is valid even in release build, this is safer...
[wxWidgets.git] / src / unix / mimetype.cpp
index dd76cf2a6a0f9df934cdd0e56ac75a36c666379b..1bce2f312171102f6d2395b4e1f0ba279aab4ba3 100644 (file)
@@ -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