]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/mimetype.cpp
unused param warning suppressed
[wxWidgets.git] / src / common / mimetype.cpp
index e4dcc9cf34583143eb1f451694ffe38670a9c94e..8e068c6f0f7eb3926b1128e6d16fcbce1c61f269 100644 (file)
@@ -285,7 +285,7 @@ public:
     bool GetExtensions(wxArrayString& extensions);
     bool GetMimeType(wxString *mimeType) const
         { *mimeType = m_manager->m_aTypes[m_index]; return TRUE; }
-    bool GetIcon(wxIcon *icon) const
+    bool GetIcon(wxIcon * WXUNUSED(icon)) const
         { return FALSE; }   // @@ maybe with Gnome/KDE integration...
     bool GetDescription(wxString *desc) const
         { *desc = m_manager->m_aDescriptions[m_index]; return TRUE; }
@@ -993,6 +993,16 @@ void wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName)
             }
         }
 
+        // although it doesn't seem to be covered by RFCs, some programs
+        // (notably Netscape) create their entries with several comma
+        // separated extensions (RFC mention the spaces only)
+        strExtensions.Replace(",", " ");
+
+        // also deal with the leading dot
+        if ( !strExtensions.IsEmpty() && strExtensions[0] == '.' ) {
+            strExtensions.erase(0, 1);
+        }
+
         int index = m_aTypes.Index(strMimeType);
         if ( index == wxNOT_FOUND ) {
             // add a new entry