@@ -26,7 +26,8 @@ public interface Bluetooth.Services.AgentManager : Object {
2626}
2727
2828public class Bluetooth.Services.ObjectManager : Object {
29- private const string SCHEMA = " io.elementary.desktop.wingpanel.bluetooth" ;
29+ private const string DAEMON_SCHEMA = " io.elementary.desktop.bluetooth" ;
30+ private const string PANEL_SCHEMA = " io.elementary.desktop.wingpanel.bluetooth" ;
3031 public signal void adapter_added (Bluetooth .Services .Adapter adapter );
3132 public signal void adapter_removed (Bluetooth .Services .Adapter adapter );
3233 public signal void device_added (Bluetooth .Services .Device device );
@@ -41,16 +42,23 @@ public class Bluetooth.Services.ObjectManager : Object {
4142 public bool is_connected {get ; private set ; default = false ; }
4243
4344 private bool is_registered = false ;
45+ private string enabled_key = " enabled" ;
4446
4547 private Settings ? settings = null ;
4648 private GLib . DBusObjectManagerClient object_manager;
4749 private Bluetooth . Services . AgentManager agent_manager;
4850 private Bluetooth . Services . Agent agent;
4951
5052 construct {
51- var settings_schema = SettingsSchemaSource . get_default (). lookup (SCHEMA , true );
53+ var settings_schema = SettingsSchemaSource . get_default (). lookup (DAEMON_SCHEMA , true );
5254 if (settings_schema != null ) {
53- settings = new Settings (SCHEMA );
55+ settings = new Settings (DAEMON_SCHEMA );
56+ } else {
57+ settings_schema = SettingsSchemaSource . get_default (). lookup (PANEL_SCHEMA , true );
58+ if (settings_schema != null ) {
59+ settings = new Settings (PANEL_SCHEMA );
60+ enabled_key = " bluetooth-enabled" ;
61+ }
5462 }
5563 create_manager. begin ();
5664
@@ -378,7 +386,7 @@ public class Bluetooth.Services.ObjectManager : Object {
378386 }
379387
380388 if (settings != null ) {
381- settings. set_boolean (" bluetooth-enabled " , state);
389+ settings. set_boolean (enabled_key , state);
382390 }
383391
384392 if (! state) {
0 commit comments