]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/mimetype.cpp
fix compilation for GTK1
[wxWidgets.git] / src / unix / mimetype.cpp
index 6d34ebc91c7c5b545a3a981c79bc197fff69f915..f1949358911dd883c17edfa2a79daea7278a4590 100644 (file)
@@ -1879,6 +1879,10 @@ int wxMimeTypesManagerImpl::AddToMimeData(const wxString& strType,
                         entryOld->AddOrReplaceVerb(verb, entry->GetCmd(i));
                     }
                 }
+
+                // as we don't store it anywhere, it won't be deleted later as
+                // usual -- do it immediately instead
+                delete entry;
             }
         }
     }
@@ -2185,14 +2189,19 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName)
             else if ( strLHS == wxT("exts") ) {
                 strExtensions = strRHS;
             }
-            else {
+            else if ( strLHS != _T("icon") )
+            {
                 // this one is simply ignored: it usually refers to Netscape
                 // built in icons which are useless for us anyhow
-                if ( strLHS != _T("icon") )
-                {
-                    wxLogWarning(_("Unknown field in file %s, line %d: '%s'."),
-                                 strFileName.c_str(), nLine + 1, strLHS.c_str());
-                }
+            }
+            else if ( !strLHS.StartsWith(_T("x-")) )
+            {
+                // we suppose that all fields starting with "X-" are
+                // unregistered extensions according to the standard practice,
+                // but it may be worth telling the user about other junk in
+                // his mime.types file
+                wxLogWarning(_("Unknown field in file %s, line %d: '%s'."),
+                             strFileName.c_str(), nLine + 1, strLHS.c_str());
             }
 
             if ( !entryEnded ) {