aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--src/volume-control-pulse.vala5
-rw-r--r--src/volume-control.vala2
-rw-r--r--src/volume-warning.vala13
-rw-r--r--tests/volume-control-mock.vala2
4 files changed, 9 insertions, 13 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 ();
diff --git a/tests/volume-control-mock.vala b/tests/volume-control-mock.vala
index d67a9db..f21f5c0 100644
--- a/tests/volume-control-mock.vala
+++ b/tests/volume-control-mock.vala
@@ -26,7 +26,7 @@ public class VolumeControlMock : VolumeControl
public string mock_stream { get; set; default = "multimedia"; }
public override string stream { get { return mock_stream; } }
- public override bool ready { get; set; }
+ public void mock_set_is_ready(bool b) { ready = b; }
public override bool active_mic { get; set; }
public bool mock_mute { get; set; }
public override bool mute { get { return mock_mute; } }