Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/components/panel/device_charging_indicator.vala
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@ namespace Singularity {
queue_sync();
}

private void on_device_removed(UPower.Device device) {
device.notify.disconnect(on_device_notify);
watched.remove(device);
private void on_device_removed(string object_path) {
foreach (var device in watched) {
if (device.get_object_path() != object_path) continue;
device.notify.disconnect(on_device_notify);
watched.remove(device);
break;
}
queue_sync();
}

Expand Down
3 changes: 2 additions & 1 deletion src/vapi/upower-glib.vapi
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ namespace UPower {
public bool get_lid_is_present ();

public signal void device_added (UPower.Device device);
public signal void device_removed (UPower.Device device);
public signal void device_removed (string object_path);
public signal void device_changed (UPower.Device device);
}

[CCode (cname = "UpDevice", cprefix = "up_device_", type_id = "up_device_get_type ()")]
public class Device : GLib.Object {
public unowned string get_object_path ();
[NoAccessorMethod]
public double percentage { get; }
[NoAccessorMethod]
Expand Down