aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2016-10-03 10:14:37 +0000
committerBileto Bot <ci-train-bot@canonical.com>2016-10-03 10:14:37 +0000
commitc41ef290ef3e76eb41b112d7c5d4e044123aae21 (patch)
tree5103ff4b4d0f1a89c3b44d156918605d8912ccf5
parenteb2d435fb70c6036e9005ccbd84927f852c05f48 (diff)
parent6578e2792b139580a6bbc40f6f2b9a6ddafbfd25 (diff)
downloadayatana-indicator-bluetooth-c41ef290ef3e76eb41b112d7c5d4e044123aae21.tar.gz
ayatana-indicator-bluetooth-c41ef290ef3e76eb41b112d7c5d4e044123aae21.tar.bz2
ayatana-indicator-bluetooth-c41ef290ef3e76eb41b112d7c5d4e044123aae21.zip
Correctly use XDG_CURRENT_DESKTOP (LP: #1554878)
Approved by: Iain Lane, unity-api-1-bot
-rw-r--r--src/desktop.vala15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/desktop.vala b/src/desktop.vala
index 35f5177..5adaaf1 100644
--- a/src/desktop.vala
+++ b/src/desktop.vala
@@ -211,11 +211,24 @@ class Desktop: Profile
/// Actions
///
+ private bool is_desktop (string name)
+ {
+ var desktop_name_list = Environment.get_variable ("XDG_CURRENT_DESKTOP");
+ if (desktop_name_list == null)
+ return false;
+
+ foreach (var n in desktop_name_list.split (":"))
+ if (n == name)
+ return true;
+
+ return false;
+ }
+
void show_settings (string panel)
{
if (Environment.get_variable ("MIR_SOCKET") != null)
UrlDispatch.send ("settings:///system/bluetooth");
- else if (Environment.get_variable ("XDG_CURRENT_DESKTOP") == "Unity" && Environment.find_program_in_path ("unity-control-center") != null)
+ else if (is_desktop ("Unity") && Environment.find_program_in_path ("unity-control-center") != null)
spawn_command_line_async ("unity-control-center " + panel);
else
spawn_command_line_async ("gnome-control-center " + panel);