aboutsummaryrefslogtreecommitdiff
path: root/lib/main.vala
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2013-06-22 16:02:39 -0400
committerWilliam Hua <william.hua@canonical.com>2013-06-22 16:02:39 -0400
commitf0a27935a36b371d095001ba2f42633761630ef8 (patch)
tree24f949a44f4f163e98d38a2b0f217e539a2f7cb8 /lib/main.vala
parent904a7a40bf5fc1f2a5bf7c7650c6e9d710cd5ad5 (diff)
downloadayatana-indicator-keyboard-f0a27935a36b371d095001ba2f42633761630ef8.tar.gz
ayatana-indicator-keyboard-f0a27935a36b371d095001ba2f42633761630ef8.tar.bz2
ayatana-indicator-keyboard-f0a27935a36b371d095001ba2f42633761630ef8.zip
Change return type of get_icon_string ().
Diffstat (limited to 'lib/main.vala')
-rw-r--r--lib/main.vala12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/main.vala b/lib/main.vala
index f0c5852f..88b2e738 100644
--- a/lib/main.vala
+++ b/lib/main.vala
@@ -247,7 +247,7 @@ public class Indicator.Keyboard.Service : Object {
}
[DBus (visible = false)]
- private string? get_icon_string (uint index) {
+ private string get_icon_string (uint index) {
string? icon_string = null;
if (this.icon_strings == null) {
@@ -279,7 +279,11 @@ public class Indicator.Keyboard.Service : Object {
}
}
- return icon_string;
+ if (icon_string == null) {
+ icon_string = "";
+ }
+
+ return (!) icon_string;
}
[DBus (visible = false)]
@@ -367,7 +371,7 @@ public class Indicator.Keyboard.Service : Object {
var icon_unique = is_icon_string_unique (index);
var icon_subscript = get_icon_string_subscript (index);
- if (icon_string != null) {
+ if (icon_string.get_char () != '\0') {
string icon_name;
if (icon_unique) {
@@ -655,7 +659,7 @@ public class Indicator.Keyboard.Service : Object {
try {
string command;
- if (variant != null) {
+ if (variant != null && ((!) variant).get_char () != '\0') {
command = @"gkbd-keyboard-display -l \"$layout\t$((!) variant)\"";
} else {
command = @"gkbd-keyboard-display -l $layout";