From 5dd9bda0ea449024dbc97e26f92631401048bc57 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 15 Oct 2014 13:24:48 -0500 Subject: Removing the remove code that was supposed to be removed earlier --- src/sound-menu.vala | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/sound-menu.vala b/src/sound-menu.vala index a9efd74..05570b9 100644 --- a/src/sound-menu.vala +++ b/src/sound-menu.vala @@ -118,7 +118,6 @@ public class SoundMenu: Object while ((location = find_action(this.volume_section, "indicator.high-volume-warning-item")) != -1) { this.volume_section.remove (location); } - this.volume_section.remove (this.volume_section.get_n_items () -1); this.high_volume_warning_shown = false; } } -- cgit v1.2.3 From 1e193a4b99e62b52fb759d00a8745f1c477d965f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 15 Oct 2014 13:52:31 -0500 Subject: Make sure to check the item in the loop --- src/sound-menu.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/sound-menu.vala b/src/sound-menu.vala index 05570b9..3881faf 100644 --- a/src/sound-menu.vala +++ b/src/sound-menu.vala @@ -127,7 +127,7 @@ public class SoundMenu: Object int n = menu.get_n_items (); for (int i = 0; i < n; i++) { string action; - menu.get_item_attribute (0, "action", "s", out action); + menu.get_item_attribute (i, "action", "s", out action); if (in_action == action) return i; } -- cgit v1.2.3 From 8a25cabee9738ced0da921fcac693495006070af Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 22 Oct 2014 15:52:54 -0400 Subject: Allow for the invalidated properties to be NULL --- src/volume-control.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/volume-control.vala b/src/volume-control.vala index ad186a7..e8d35a4 100644 --- a/src/volume-control.vala +++ b/src/volume-control.vala @@ -689,7 +689,7 @@ public class VolumeControl : Object } /* AccountsService operations */ - private void accountsservice_props_changed_cb (DBusProxy proxy, Variant changed_properties, string[] invalidated_properties) + private void accountsservice_props_changed_cb (DBusProxy proxy, Variant changed_properties, string[]? invalidated_properties) { Variant volume_variant = changed_properties.lookup_value ("Volume", new VariantType ("d")); if (volume_variant != null) { -- cgit v1.2.3 From edf067bcf194607f0f51f0152e3ad5eb6d70d0be Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 22 Oct 2014 15:58:32 -0400 Subject: Setup a try/catch on the getting of properties --- src/volume-control.vala | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/volume-control.vala b/src/volume-control.vala index e8d35a4..5061ae8 100644 --- a/src/volume-control.vala +++ b/src/volume-control.vala @@ -747,10 +747,14 @@ public class VolumeControl : Object // Get current values and listen for changes _user_proxy.g_properties_changed.connect (accountsservice_props_changed_cb); - var props_variant = yield _user_proxy.get_connection ().call (_user_proxy.get_name (), _user_proxy.get_object_path (), "org.freedesktop.DBus.Properties", "GetAll", new Variant ("(s)", _user_proxy.get_interface_name ()), null, DBusCallFlags.NONE, -1); - Variant props; - props_variant.get ("(@a{sv})", out props); - accountsservice_props_changed_cb(_user_proxy, props, null); + try { + var props_variant = yield _user_proxy.get_connection ().call (_user_proxy.get_name (), _user_proxy.get_object_path (), "org.freedesktop.DBus.Properties", "GetAll", new Variant ("(s)", _user_proxy.get_interface_name ()), null, DBusCallFlags.NONE, -1); + Variant props; + props_variant.get ("(@a{sv})", out props); + accountsservice_props_changed_cb(_user_proxy, props, null); + } catch (GLib.Error e) { + debug("Unable to get properties for user %s at first try: %s", username, e.message); + } } private void greeter_user_changed (string username) -- cgit v1.2.3 From 9ab88593b90ee51361c4b4789daf11a2f1d08429 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 22 Oct 2014 16:00:18 -0400 Subject: Remove usage of deprecated hint functions --- src/service.vala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/service.vala b/src/service.vala index 2a65492..4298ad7 100644 --- a/src/service.vala +++ b/src/service.vala @@ -69,7 +69,7 @@ public class IndicatorSound.Service: Object { List caps = Notify.get_server_caps (); if (caps.find_custom ("x-canonical-private-synchronous", strcmp) != null) { this.notification = new Notify.Notification ("indicator-sound", "", ""); - this.notification.set_hint_string ("x-canonical-private-synchronous", "indicator-sound"); + this.notification.set_hint ("x-canonical-private-synchronous", "indicator-sound"); } } @@ -186,7 +186,7 @@ public class IndicatorSound.Service: Object { icon = "notification-audio-volume-high"; this.notification.update ("indicator-sound", "", icon); - this.notification.set_hint_int32 ("value", ((int32) (100 * v / this.max_volume)).clamp (-1, 101)); + this.notification.set_hint ("value", ((int32) (100 * v / this.max_volume)).clamp (-1, 101)); try { this.notification.show (); } -- cgit v1.2.3 From 08bcdc3b069c4c5ce7cb2a769daa8573fce5cd5d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 5 Nov 2014 10:48:22 -0600 Subject: Missed part of a merge --- src/volume-control.vala | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src') diff --git a/src/volume-control.vala b/src/volume-control.vala index 295ebf5..6f22dc5 100644 --- a/src/volume-control.vala +++ b/src/volume-control.vala @@ -604,16 +604,6 @@ public class VolumeControl : Object { /* Using this to detect whether we're on the phone or not */ if (_pulse_use_stream_restore) { -<<<<<<< TREE - if (volume == 0.0) - _notification.update (_("Volume"), "", "audio-volume-muted"); - if (volume > 0.0 && volume <= 0.33) - _notification.update (_("Volume"), "", "audio-volume-low"); - if (volume > 0.33 && volume <= 0.66) - _notification.update (_("Volume"), "", "audio-volume-medium"); - if (volume > 0.66 && volume <= 1.0) - _notification.update (_("Volume"), "", "audio-volume-high"); -======= /* Watch for extreme */ if (volume > 0.75 && _active_port_headphone) high_volume = true; -- cgit v1.2.3