Skip to content

Commit feda3aa

Browse files
committed
Remove Agent
1 parent f19ddc7 commit feda3aa

File tree

6 files changed

+0
-359
lines changed

6 files changed

+0
-359
lines changed

po/POTFILES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
src/Plug.vala
22
src/MainView.vala
3-
src/PairDialog.vala
43
src/DeviceRow.vala
54
src/Services/Manager.vala
65
src/Services/Device.vala

src/PairDialog.vala

Lines changed: 0 additions & 130 deletions
This file was deleted.

src/Plug.vala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,11 @@ public class Bluetooth.Plug : Switchboard.Plug {
6262
}
6363

6464
public override void shown () {
65-
manager.register_agent.begin (main_view.get_root () as Gtk.Window);
6665
manager.set_global_state.begin (true); /* Also sets discoverable true and starts discovery */
6766
}
6867

6968
public override void hidden () {
7069
Application.get_default ().hold ();
71-
manager.unregister_agent.begin ();
7270
manager.discoverable = false; /* Does not change is_powered or connections*/
7371
manager.stop_discovery.begin (() => {
7472
Application.get_default ().release ();

src/Services/Agent.vala

Lines changed: 0 additions & 165 deletions
This file was deleted.

src/Services/Manager.vala

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@
1818
* Authored by: Corentin Noël <[email protected]>
1919
*/
2020

21-
[DBus (name = "org.bluez.AgentManager1")]
22-
public interface Bluetooth.Services.AgentManager : Object {
23-
public abstract void register_agent (ObjectPath agent, string capability) throws Error;
24-
public abstract void request_default_agent (ObjectPath agent) throws Error;
25-
public abstract void unregister_agent (ObjectPath agent) throws Error;
26-
}
27-
2821
public class Bluetooth.Services.ObjectManager : Object {
2922
private const string SCHEMA = "io.elementary.desktop.wingpanel.bluetooth";
3023
public signal void adapter_added (Bluetooth.Services.Adapter adapter);
@@ -40,12 +33,8 @@ public class Bluetooth.Services.ObjectManager : Object {
4033
public bool is_powered {get; private set; default = false; }
4134
public bool is_connected {get; private set; default = false; }
4235

43-
private bool is_registered = false;
44-
4536
private Settings? settings = null;
4637
private GLib.DBusObjectManagerClient object_manager;
47-
private Bluetooth.Services.AgentManager agent_manager;
48-
private Bluetooth.Services.Agent agent;
4938

5039
construct {
5140
var settings_schema = SettingsSchemaSource.get_default ().lookup (SCHEMA, true);
@@ -239,54 +228,6 @@ public class Bluetooth.Services.ObjectManager : Object {
239228
return null;
240229
}
241230

242-
private async void create_agent (Gtk.Window? window) {
243-
if (object_manager == null) {
244-
return;
245-
}
246-
GLib.DBusObject? bluez_object = object_manager.get_object ("/org/bluez");
247-
if (bluez_object != null) {
248-
agent_manager = (Bluetooth.Services.AgentManager) bluez_object.get_interface ("org.bluez.AgentManager1");
249-
}
250-
251-
agent = new Bluetooth.Services.Agent (window);
252-
agent.notify["ready"].connect (() => {
253-
if (is_registered) {
254-
register_agent.begin (window);
255-
}
256-
});
257-
258-
agent.unregistered.connect (() => {
259-
is_registered = false;
260-
});
261-
}
262-
263-
public async void register_agent (Gtk.Window? window) {
264-
is_registered = true;
265-
if (agent_manager == null) {
266-
yield create_agent (window);
267-
}
268-
269-
if (agent_manager != null && agent.ready) {
270-
try {
271-
agent_manager.register_agent (agent.get_path (), "DisplayYesNo");
272-
agent_manager.request_default_agent (agent.get_path ());
273-
} catch (Error e) {
274-
critical (e.message);
275-
}
276-
}
277-
}
278-
279-
public async void unregister_agent () {
280-
is_registered = false;
281-
if (agent_manager != null && agent.ready) {
282-
try {
283-
agent_manager.unregister_agent (agent.get_path ());
284-
} catch (Error e) {
285-
critical (e.message);
286-
}
287-
}
288-
}
289-
290231
public void check_global_state () {
291232
/* As this is called within a signal handler and emits a signal
292233
* it should be in a Idle loop else races occur */

0 commit comments

Comments
 (0)