aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2013-08-12 02:12:07 +0000
committerTarmac <Unknown>2013-08-12 02:12:07 +0000
commitb95b1793605426da03ca61d3c825c93bd9eaf64e (patch)
treeec407054fa0ec3ff4661055184a15a30b618fc60 /lib
parent0e3bb46532e1858f2cfee808bd66efa225cb2d94 (diff)
parent5c12e10be77351e88b6c550894e4ca34c99aacf8 (diff)
downloadayatana-indicator-keyboard-b95b1793605426da03ca61d3c825c93bd9eaf64e.tar.gz
ayatana-indicator-keyboard-b95b1793605426da03ca61d3c825c93bd9eaf64e.tar.bz2
ayatana-indicator-keyboard-b95b1793605426da03ca61d3c825c93bd9eaf64e.zip
Resolve flaky test by always forcing the delay.
The test used to kill a delay as soon as a change was observed on the action group which was activated. On slower systems, this caused an assertion failure because updating the dconf setting took much longer than getting the change notification. Approved by PS Jenkins bot, Mathieu Trudel-Lapierre.
Diffstat (limited to 'lib')
-rw-r--r--lib/main.vala8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/main.vala b/lib/main.vala
index 91466f8c..d601f6f9 100644
--- a/lib/main.vala
+++ b/lib/main.vala
@@ -220,8 +220,14 @@ public class Indicator.Keyboard.Service : Object {
private void update_indicator_action () {
var visible = indicator_settings.get_boolean ("visible");
var current = source_settings.get_uint ("current");
- var icon = get_sources ()[current].icon;
+ var sources = get_sources ();
+
Variant state;
+ Icon? icon = null;
+
+ if (current < sources.length) {
+ icon = sources[current].icon;
+ }
if (icon != null) {
state = new Variant.parsed ("{ 'visible' : <%b>, 'icon' : %v }", visible, ((!) icon).serialize ());