aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcharles kerr <charlesk@canonical.com>2015-12-19 22:18:27 -0600
committercharles kerr <charlesk@canonical.com>2015-12-19 22:18:27 -0600
commit57f30a3dfc759826d7c19d69e46cb10d55e91837 (patch)
tree7f964e99693ea6008b184b4de26813093f9ba31d /src
parentf008f077e6978c99ba9548eda26ac29c073a46a8 (diff)
downloadayatana-indicator-sound-57f30a3dfc759826d7c19d69e46cb10d55e91837.tar.gz
ayatana-indicator-sound-57f30a3dfc759826d7c19d69e46cb10d55e91837.tar.bz2
ayatana-indicator-sound-57f30a3dfc759826d7c19d69e46cb10d55e91837.zip
remove 'ready' property from volume-warning
Diffstat (limited to 'src')
-rw-r--r--src/volume-control-pulse.vala5
-rw-r--r--src/volume-control.vala2
-rw-r--r--src/volume-warning.vala13
3 files changed, 8 insertions, 12 deletions
diff --git a/src/volume-control-pulse.vala b/src/volume-control-pulse.vala
index 22c3ee4..82c4791 100644
--- a/src/volume-control-pulse.vala
+++ b/src/volume-control-pulse.vala
@@ -86,9 +86,6 @@ public class VolumeControlPulse : VolumeControl
private bool _active_port_headphone = false;
private VolumeControl.ActiveOutput _active_output = VolumeControl.ActiveOutput.SPEAKERS;
- /** true when connected to the pulse server */
- public override bool ready { get; private set; }
-
/** true when a microphone is active **/
public override bool active_mic { get; private set; default = false; }
@@ -480,7 +477,7 @@ public class VolumeControlPulse : VolumeControl
c.set_subscribe_callback (context_events_cb);
update_sink ();
update_source ();
- this.ready = true;
+ this.ready = true; // true because we're connected to the pulse server
break;
case Context.State.FAILED:
diff --git a/src/volume-control.vala b/src/volume-control.vala
index f1c74a0..1b4288c 100644
--- a/src/volume-control.vala
+++ b/src/volume-control.vala
@@ -52,7 +52,7 @@ public abstract class VolumeControl : Object
}
public virtual string stream { get { return ""; } }
- public virtual bool ready { get { return false; } set { } }
+ public bool ready { get; protected set; default = false; }
public virtual bool active_mic { get { return false; } set { } }
public virtual bool high_volume { get { return false; } protected set { } }
public virtual bool mute { get { return false; } }
diff --git a/src/volume-warning.vala b/src/volume-warning.vala
index 2bb4dae..2a8c79f 100644
--- a/src/volume-warning.vala
+++ b/src/volume-warning.vala
@@ -82,9 +82,6 @@ public class VolumeWarning : VolumeControl
private bool _active_port_headphone = false;
private VolumeControl.ActiveOutput _active_output = VolumeControl.ActiveOutput.SPEAKERS;
- /** true when connected to the pulse server */
- public override bool ready { get; private set; }
-
/** true when a microphone is active **/
public override bool active_mic { get; private set; default = false; }
@@ -455,6 +452,8 @@ public class VolumeWarning : VolumeControl
this.active_mic = true;
}
+ private bool _connected_to_pulse = false;
+
private void context_state_callback (Context c)
{
switch (c.get_state ()) {
@@ -472,7 +471,7 @@ public class VolumeWarning : VolumeControl
c.set_subscribe_callback (context_events_cb);
update_sink ();
update_source ();
- this.ready = true;
+ _connected_to_pulse = true;
break;
case Context.State.FAILED:
@@ -482,7 +481,7 @@ public class VolumeWarning : VolumeControl
break;
default:
- this.ready = false;
+ _connected_to_pulse = false;
break;
}
}
@@ -496,10 +495,10 @@ public class VolumeWarning : VolumeControl
void reconnect_to_pulse ()
{
- if (this.ready) {
+ if (_connected_to_pulse) {
this.context.disconnect ();
this.context = null;
- this.ready = false;
+ _connected_to_pulse = false;
}
var props = new Proplist ();