fixed duplicate entry and entry for 'unknown' in the button config list
[deb_libcec.git] / src / LibCecTray / controller / applications / ApplicationController.cs
index 310f30f8ef05e12f25dbf04ecb3ae320912fb895..4d23071946db8ecfff2e61d5fc32c9a4e5240581 100644 (file)
@@ -353,18 +353,7 @@ namespace LibCECTray.controller.applications
     private CecButtonConfig _buttonConfig;
     public CecButtonConfig ButtonConfig
     {
-      get
-      {
-        if (_buttonConfig == null)
-        {
-          _buttonConfig = new CecButtonConfig(this);
-          foreach (CecUserControlCode key in Enum.GetValues(typeof(CecUserControlCode)))
-            _buttonConfig.Add(new CecButtonConfigItem(this, (new CecKeypress { Keycode = key })));
-
-          _buttonConfig.Load();
-        }
-        return _buttonConfig;
-      }
+      get { return _buttonConfig ?? (_buttonConfig = new CecButtonConfig(this)); }
     }
 
     public CECSettings Settings;