save the correct xml file in LibCecTray, so XBMC picks up the correct config
[deb_libcec.git] / src / LibCecTray / controller / applications / internal / XBMCController.cs
index 5ffe8f9ec88c15d3968d48bec1354d471dd4115b..5ab82833d8079e17a3d071e803aacba0347f0cce 100644 (file)
@@ -71,7 +71,9 @@ namespace LibCECTray.controller.applications.@internal
     public bool LoadXMLConfiguration()
     {
       var xbmcDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\XBMC\userdata\peripheral_data";
-      return LoadXMLConfiguration(xbmcDir + @"\usb_2548_1001.xml") || LoadXMLConfiguration(xbmcDir + @"\usb_2548_1002.xml");
+      return LoadXMLConfiguration(xbmcDir + string.Format(@"\usb_{0:X}_{1:X}.xml", Program.Instance.Controller.AdapterVendorId, Program.Instance.Controller.AdapterProductId)) ||
+             LoadXMLConfiguration(xbmcDir + @"\usb_2548_1001.xml") ||
+             LoadXMLConfiguration(xbmcDir + @"\usb_2548_1002.xml");
     }
 
     public bool LoadXMLConfiguration(string filename)
@@ -219,7 +221,7 @@ namespace LibCECTray.controller.applications.@internal
       {
         Title = Resources.store_settings_where,
         InitialDirectory = xbmcDir,
-        FileName = string.Format("usb_{0}.xml", Program.Instance.Controller.USBDescriptor.Replace(':', '_')),
+        FileName = string.Format("usb_{0:X}_{1:X}.xml", Program.Instance.Controller.AdapterVendorId, Program.Instance.Controller.AdapterProductId),
         Filter = Resources.xml_file_filter,
         FilterIndex = 1
       };