aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2016-10-22 11:06:13 +0200
committerTed Gould <ted@gould.cx>2016-10-22 11:06:13 +0200
commit8a43e4ad200c5cba00ec1a16028ce90cc46fa5f9 (patch)
tree561ae6778b86b4be654b142a47427db1a360911b
parent8d1998093be0403f117f618c808b4711fda0396a (diff)
parent285ce0ffd0aef8f689e943ae638af18f84f8b9a5 (diff)
downloadayatana-indicator-bluetooth-8a43e4ad200c5cba00ec1a16028ce90cc46fa5f9.tar.gz
ayatana-indicator-bluetooth-8a43e4ad200c5cba00ec1a16028ce90cc46fa5f9.tar.bz2
ayatana-indicator-bluetooth-8a43e4ad200c5cba00ec1a16028ce90cc46fa5f9.zip
Merging trunk
-rw-r--r--debian/changelog7
-rw-r--r--src/desktop.vala15
2 files changed, 21 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 7bc4ad0..841c3d3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+indicator-bluetooth (0.0.6+16.10.20161003-0ubuntu1) yakkety; urgency=medium
+
+ [ Robert Ancell ]
+ * Correctly use XDG_CURRENT_DESKTOP (LP: #1554878)
+
+ -- iain@orangesquash.org.uk <iain@orangesquash.org.uk> Mon, 03 Oct 2016 10:15:04 +0000
+
indicator-bluetooth (0.0.6+16.10.20160526-0ubuntu1) yakkety; urgency=medium
* Remove the "browse" action since there is no working backend (LP:
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);