diff options
author | Robert Tari <robert@tari.in> | 2020-10-25 16:10:26 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-10-26 11:37:13 +0100 |
commit | babfaba6f6f22b9cfb821c713cac4dbaaefd8605 (patch) | |
tree | 022cde30d95c68e5922ae10f6ad3916bd11abb15 | |
parent | 21b8f5e95840ddfb65b9fcfdd1a9fe83c07a36b9 (diff) | |
download | ayatana-indicator-bluetooth-babfaba6f6f22b9cfb821c713cac4dbaaefd8605.tar.gz ayatana-indicator-bluetooth-babfaba6f6f22b9cfb821c713cac4dbaaefd8605.tar.bz2 ayatana-indicator-bluetooth-babfaba6f6f22b9cfb821c713cac4dbaaefd8605.zip |
Make dependency on liburl-dispatcher optional.
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/desktop.vala | 20 | ||||
-rw-r--r-- | src/phone.vala | 8 |
4 files changed, 36 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 7dfa45d..65a0155 100644 --- a/configure.ac +++ b/configure.ac @@ -19,8 +19,15 @@ GIO_REQUIRED_VERSION=2.36 URL_DISPATCHER_1_REQUIRED_VERSION=1 PKG_CHECK_MODULES(SERVICE_DEPS, [glib-2.0 >= $GLIB_REQUIRED_VERSION - gio-unix-2.0 >= $GIO_REQUIRED_VERSION - url-dispatcher-1 >= $URL_DISPATCHER_1_REQUIRED_VERSION]) + gio-unix-2.0 >= $GIO_REQUIRED_VERSION]) + +PKG_CHECK_EXISTS(url-dispatcher-1, + [have_urldispatcher="yes"], + [have_urldispatcher="no"]) + +if test "x$have_urldispatcher" == "xyes"; then + PKG_CHECK_MODULES(URL_DISPATCHER, [url-dispatcher-1 >= $URL_DISPATCHER_1_REQUIRED_VERSION]) +fi SYSTEMD_USERDIR=`$PKG_CONFIG --variable=systemduserunitdir systemd` AC_SUBST(SYSTEMD_USERDIR) diff --git a/src/Makefile.am b/src/Makefile.am index 245b0f2..44d6406 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -27,9 +27,11 @@ ayatana_indicator_bluetooth_service_CFLAGS = \ -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \ -DLOCALE_DIR=\"$(datadir)/locale\" \ -w \ + $(URL_DISPATCHER_CFLAGS) \ $(SERVICE_DEPS_CFLAGS) ayatana_indicator_bluetooth_service_LDADD = \ + $(URL_DISPATCHER_LIBS) \ $(SERVICE_DEPS_LIBS) CLEANFILES = \ diff --git a/src/desktop.vala b/src/desktop.vala index 4186daa..7109874 100644 --- a/src/desktop.vala +++ b/src/desktop.vala @@ -226,12 +226,26 @@ class Desktop: Profile void show_settings (string panel) { - if (Environment.get_variable ("MIR_SOCKET") != null) - UrlDispatch.send ("settings:///system/bluetooth"); - else if (is_desktop ("Unity") && Environment.find_program_in_path ("unity-control-center") != null) + +#if HAS_URLDISPATCHER + + if (Environment.get_variable ("MIR_SOCKET") != null) + { + UrlDispatch.send ("settings:///system/bluetooth"); + + return; + } + +#endif + + 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); + } } Action create_discoverable_action (Bluetooth bluetooth) diff --git a/src/phone.vala b/src/phone.vala index 2b0b96b..cce016e 100644 --- a/src/phone.vala +++ b/src/phone.vala @@ -62,7 +62,15 @@ class Phone: Profile void show_settings (string panel) { + +#if HAS_URLDISPATCHER + UrlDispatch.send ("settings:///system/bluetooth"); + +#endif + + return; + } Action create_settings_action () |