diff options
author | Siegfried-Angel Gevatter Pujals <siegfried@gevatter.com> | 2012-02-06 15:59:35 +0100 |
---|---|---|
committer | Siegfried-Angel Gevatter Pujals <siegfried@gevatter.com> | 2012-02-06 15:59:35 +0100 |
commit | d301efcf079deeeae537e1a499b954fd673c5f4d (patch) | |
tree | 45af5e4288343e8c73a7b79b8a0afc0632154d8b | |
parent | e2ed6d87c199f40dbd45bc2bac3cd5b2c4ab1b37 (diff) |
Add a configure time option to disable the downloads directory monitor.
-rw-r--r-- | config.vapi | 4 | ||||
-rw-r--r-- | configure.ac | 22 | ||||
-rw-r--r-- | src/Makefile.am | 6 | ||||
-rw-r--r-- | src/zeitgeist-datahub.vala | 4 |
4 files changed, 35 insertions, 1 deletions
diff --git a/config.vapi b/config.vapi new file mode 100644 index 0000000..03e8633 --- /dev/null +++ b/config.vapi @@ -0,0 +1,4 @@ +[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")] +namespace Config { + public const bool DOWNLOADS_MONITOR_ENABLED; +} diff --git a/configure.ac b/configure.ac index 32396a4..8ee144f 100644 --- a/configure.ac +++ b/configure.ac @@ -36,6 +36,28 @@ AM_PROG_VALAC([0.11.2]) AM_SILENT_RULES([yes]) dnl ============================================== +dnl Check settings for optional providers +AC_ARG_ENABLE([downloads-monitor], + AS_HELP_STRING([--disable-downloads-monitor], + [Disables the XDG_DOWNLOAD_DIRECTORY file monitor] + ), + [ + if test "x$enableval" != "xno"; then + with_downloads_monitor=yes + fi + ], + [with_downloads_monitor=yes]) + +AM_CONDITIONAL(DOWNLOADS_MONITOR_ENABLED, test "x$with_downloads_monitor" = "xyes") + +if test "x$with_downloads_monitor" = "xyes"; then + AC_DEFINE([DOWNLOADS_MONITOR_ENABLED], [1], [Is the XDG_DOWNLOAD_DIRECTORY file monitor enabled?]) +else + AC_DEFINE([DOWNLOADS_MONITOR_ENABLED], [0], [Is the XDG_DOWNLOAD_DIRECTORY file monitor enabled?]) +fi +dnl ============================================== + +dnl ============================================== dnl Check that we meet the dependencies dnl ============================================== MIN_GLIB_VERSION=2.26.0 diff --git a/src/Makefile.am b/src/Makefile.am index 1973457..62c3e9a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,9 +1,14 @@ +AM_CPPFLAGS = \ + -include $(CONFIG_HEADER) \ + $(NULL) + VALAFLAGS = \ --pkg gio-2.0 \ --pkg gio-unix-2.0 \ --pkg gtk+-2.0 \ --pkg zeitgeist-1.0 \ glib-extra.vapi \ + $(top_srcdir)/config.vapi \ $(NULL) datahubdir = $(bindir) @@ -20,6 +25,7 @@ zeitgeist_datahub_SOURCES = \ recent-manager-provider.vala \ utils.vala \ zeitgeist-datahub.vala \ + $(optional_zeitgeist_datahub_SOURCES) \ $(NULL) xdgautostart_in_files = \ diff --git a/src/zeitgeist-datahub.vala b/src/zeitgeist-datahub.vala index 5e05d7f..dea323b 100644 --- a/src/zeitgeist-datahub.vala +++ b/src/zeitgeist-datahub.vala @@ -111,7 +111,9 @@ public class DataHub : Object, DataHubService */ providers.prepend (new RecentManagerGtk (this)); providers.prepend (new RecentDocumentsKDE (this)); - providers.prepend (new DownloadsDirectoryMonitor (this)); + + if (Config.DOWNLOADS_MONITOR_ENABLED) + providers.prepend (new DownloadsDirectoryMonitor (this)); if (GLibExtra.check_version (2, 28, 0)) { |