fixed: specify mask correctly instead of playing silly games
authorspiff <spiff@xbmc.org>
Wed, 21 Mar 2012 20:23:25 +0000 (21:23 +0100)
committerspiff <spiff@xbmc.org>
Wed, 21 Mar 2012 20:44:14 +0000 (21:44 +0100)
xbmc/input/ButtonTranslator.cpp

index 012422e..13304a0 100644 (file)
@@ -433,13 +433,11 @@ bool CButtonTranslator::Load(bool AlwaysLoad)
       if( XFILE::CDirectory::Exists(DIRS_TO_CHECK[dirIndex]) )
       {
         CFileItemList files;
-        XFILE::CDirectory::GetDirectory(DIRS_TO_CHECK[dirIndex], files, "*.xml");
+        XFILE::CDirectory::GetDirectory(DIRS_TO_CHECK[dirIndex], files, ".xml");
         // Sort the list for filesystem based priorities, e.g. 01-keymap.xml, 02-keymap-overrides.xml
         files.Sort(SORT_METHOD_FILE, SORT_ORDER_ASC);
-        // In (at least) Windows the GetDirectory returns all files not just *.xml files
         for(int fileIndex = 0; fileIndex<files.Size(); ++fileIndex)
-          if (files[fileIndex]->GetPath().Right(4) == ".xml")
-            success |= LoadKeymap(files[fileIndex]->GetPath());
+          success |= LoadKeymap(files[fileIndex]->GetPath());
 
       // Load mappings for any HID devices we have connected
       std::list<CStdString>::iterator it;
@@ -451,12 +449,11 @@ bool CButtonTranslator::Load(bool AlwaysLoad)
         if( XFILE::CDirectory::Exists(devicedir) )
         {
           CFileItemList files;
-          XFILE::CDirectory::GetDirectory(devicedir, files, "*.xml");
+          XFILE::CDirectory::GetDirectory(devicedir, files, ".xml");
           // Sort the list for filesystem based priorities, e.g. 01-keymap.xml, 02-keymap-overrides.xml
           files.Sort(SORT_METHOD_FILE, SORT_ORDER_ASC);
           for(int fileIndex = 0; fileIndex<files.Size(); ++fileIndex)
-            if (files[fileIndex]->GetPath().Right(4) == ".xml")
-              success |= LoadKeymap(files[fileIndex]->GetPath());
+            success |= LoadKeymap(files[fileIndex]->GetPath());
         }
       }
       }