aboutsummaryrefslogtreecommitdiff
path: root/src/service.vala
diff options
context:
space:
mode:
authorMuhammad Asif <thevancedgamer@mentallysanemainliners.org>2025-06-24 00:19:48 +0500
committerMuhammad <thevancedgamer@mentallysanemainliners.org>2025-06-24 00:19:48 +0500
commit568f6aa32e290b4e37b61dfd9985ae81a08e2892 (patch)
treea67dc0a2af71f71a0ed6c47e85c9d5e25e084097 /src/service.vala
parent5b45748c5dc9c2d1718b6219e30a64e07e5ca313 (diff)
downloadayatana-indicator-bluetooth-568f6aa32e290b4e37b61dfd9985ae81a08e2892.tar.gz
ayatana-indicator-bluetooth-568f6aa32e290b4e37b61dfd9985ae81a08e2892.tar.bz2
ayatana-indicator-bluetooth-568f6aa32e290b4e37b61dfd9985ae81a08e2892.zip
agent: use signals to register agent to BlueZ
Signed-off-by: Muhammad Asif <thevancedgamer@mentallysanemainliners.org>
Diffstat (limited to 'src/service.vala')
-rw-r--r--src/service.vala12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/service.vala b/src/service.vala
index b79056e..e651811 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -29,7 +29,7 @@ public class Service: Object
private MainLoop loop;
private SimpleActionGroup actions;
private HashTable<string,Profile> profiles;
- private Bluetooth bluez;
+ private Bluetooth bluetooth;
private DBusConnection connection;
private uint exported_action_id;
private const string OBJECT_PATH = "/org/ayatana/indicator/bluetooth";
@@ -50,10 +50,10 @@ public class Service: Object
}
}
- public Service (Bluetooth bluetooth)
+ public Service (Bluetooth bluetooth_service)
{
actions = new SimpleActionGroup ();
- bluez = bluetooth;
+ bluetooth = bluetooth_service;
profiles = new HashTable<string,Profile> (str_hash, str_equal);
profiles.insert ("phone", new Phone (bluetooth, actions));
@@ -83,6 +83,10 @@ public class Service: Object
null,
null);
+ bluetooth.agent_manager_ready.connect (() => {
+ bluetooth.add_agent ("/agent");
+ });
+
loop = new MainLoop (null, false);
loop.run ();
@@ -97,7 +101,7 @@ public class Service: Object
{
try
{
- connection.register_object ("/agent", new Agent (bluez));
+ connection.register_object ("/agent", new Agent (bluetooth));
}
catch (GLib.IOError pError)
{