]> git.saurik.com Git - wxWidgets.git/commitdiff
fix to parse the new GNOME .keys files
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 18 Dec 2000 16:16:30 +0000 (16:16 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 18 Dec 2000 16:16:30 +0000 (16:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8943 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/unix/mimetype.cpp

index 1b8cf25097cf4e6eebe03c298fea0d652bfb64af..573747fe13cfaa14804b16d04a571c2ae294f7bc 100644 (file)
@@ -322,6 +322,9 @@ ArrayIconHandlers wxMimeTypesManagerImpl::ms_iconHandlers;
 // with blank lines separating the entries and indented lines starting with
 // TABs. We're interested in the field icon-filename whose value is the path
 // containing the icon.
+//
+// Update (Chris Elliott): apparently there may be an optional "[lang]" prefix
+// just before the field name.
 
 void wxGNOMEIconHandler::LoadIconsFromKeyFile(const wxString& filename)
 {
@@ -389,6 +392,16 @@ void wxGNOMEIconHandler::LoadIconsFromKeyFile(const wxString& filename)
             // this is a field=value ling
             pc++; // skip leading TAB
 
+            // skip optional "[lang]"
+            if ( *pc == _T('[') )
+            {
+                while ( *pc )
+                {
+                    if ( *pc++ == _T(']') )
+                        break;
+                }
+            }
+
             static const int lenField = 13; // strlen("icon-filename")
             if ( wxStrncmp(pc, _T("icon-filename"), lenField) == 0 )
             {