summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2017-07-18 03:15:53 +0200
committerBastien Nocera <hadess@hadess.net>2017-07-18 03:25:03 +0200
commite367134de0e3d2fd6e9445be91c3fb5572140b8c (patch)
treed3dc505e94949392ec266ed1bbf80d5eb9e59dd9
parent4ac20d7b6a032a654128e7e51bb141bd04d46c24 (diff)
downloadnautilus-e367134de0e3d2fd6e9445be91c3fb5572140b8c.tar.gz
build: Make tracker a hard dependency
A large number of core features require Tracker to work, and many of the new features using Tracker don't have any fallback support, failing to build when Tracker is not available, so make tracker a hard requirement. https://bugzilla.gnome.org/show_bug.cgi?id=784940
-rw-r--r--config.h.meson1
-rw-r--r--meson.build10
-rw-r--r--meson_options.txt4
-rw-r--r--src/meson.build24
-rw-r--r--src/nautilus-file-undo-operations.c4
-rw-r--r--src/nautilus-file.c3
-rw-r--r--src/nautilus-file.h2
-rw-r--r--src/nautilus-files-view.c8
-rw-r--r--src/nautilus-search-engine.c17
9 files changed, 14 insertions, 59 deletions
diff --git a/config.h.meson b/config.h.meson
index c494c9c58..4f5cb5848 100644
--- a/config.h.meson
+++ b/config.h.meson
@@ -6,7 +6,6 @@
#mesondefine HAVE_SELINUX
#mesondefine ENABLE_DESKTOP
#mesondefine ENABLE_PACKAGEKIT
-#mesondefine ENABLE_TRACKER
#mesondefine LOCALEDIR
#mesondefine NAUTILUS_DATADIR
#mesondefine NAUTILUS_EXTENSIONDIR
diff --git a/meson.build b/meson.build
index 4160c8fe0..2d6568e32 100644
--- a/meson.build
+++ b/meson.build
@@ -81,13 +81,9 @@ if get_option ('enable-selinux')
conf.set10 ('HAVE_SELINUX', true)
endif
-tracker_option = get_option ('enable-tracker')
-if tracker_option != 'no'
- tracker_sparql = dependency ('tracker-sparql-2.0', required: (tracker_option == 'yes'))
- if not tracker_sparql.found()
- tracker_sparql = dependency ('tracker-sparql-1.0', required: (tracker_option == 'yes'))
- endif
- conf.set10 ('ENABLE_TRACKER', tracker_sparql.found())
+tracker_sparql = dependency ('tracker-sparql-2.0', required: false)
+if not tracker_sparql.found()
+ tracker_sparql = dependency ('tracker-sparql-1.0')
endif
if get_option ('enable-xmp')
diff --git a/meson_options.txt b/meson_options.txt
index 4e2880ab1..c934dd8b1 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -21,10 +21,6 @@ option ('enable-desktop',
option ('enable-packagekit',
type: 'boolean',
value: true)
-option ('enable-tracker',
- type: 'combo',
- choices: ['yes', 'no', 'auto'],
- value: 'auto')
option ('enable-gtk-doc',
type: 'boolean',
value: false)
diff --git a/src/meson.build b/src/meson.build
index dd49350c1..e9252f221 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -255,18 +255,15 @@ libnautilus_sources = [
'nautilus-file-undo-operations.c',
'nautilus-file-undo-operations.h',
'nautilus-file-undo-manager.c',
- 'nautilus-file-undo-manager.h'
+ 'nautilus-file-undo-manager.h',
+ 'nautilus-batch-rename-dialog.c',
+ 'nautilus-batch-rename-dialog.h',
+ 'nautilus-batch-rename-utilities.c',
+ 'nautilus-batch-rename-utilities.h',
+ 'nautilus-search-engine-tracker.c',
+ 'nautilus-search-engine-tracker.h'
]
-if tracker_sparql.found()
- libnautilus_sources += ['nautilus-batch-rename-dialog.c',
- 'nautilus-batch-rename-dialog.h',
- 'nautilus-batch-rename-utilities.c',
- 'nautilus-batch-rename-utilities.h',
- 'nautilus-search-engine-tracker.c',
- 'nautilus-search-engine-tracker.h']
-endif
-
nautilus_deps = [glib,
gtk,
autoar,
@@ -278,16 +275,13 @@ nautilus_deps = [glib,
eel_2,
nautilus_extension,
x11,
- gmodule_no_export]
+ gmodule_no_export,
+ tracker_sparql]
if get_option ('enable-exif')
nautilus_deps += exif
endif
-if tracker_sparql.found()
- nautilus_deps += tracker_sparql
-endif
-
if get_option ('enable-selinux')
nautilus_deps += selinux
endif
diff --git a/src/nautilus-file-undo-operations.c b/src/nautilus-file-undo-operations.c
index 87ee93f41..e833d0578 100644
--- a/src/nautilus-file-undo-operations.c
+++ b/src/nautilus-file-undo-operations.c
@@ -31,10 +31,8 @@
#include "nautilus-file-operations.h"
#include "nautilus-file.h"
#include "nautilus-file-undo-manager.h"
-#ifdef ENABLE_TRACKER
#include "nautilus-batch-rename-dialog.h"
#include "nautilus-batch-rename-utilities.h"
-#endif /* ENABLE_TRACKER */
/* Since we use g_get_current_time for setting "orig_trash_time" in the undo
@@ -1088,7 +1086,6 @@ nautilus_file_undo_info_rename_set_data_post (NautilusFileUndoInfoRename *self,
self->priv->new_file = g_object_ref (new_file);
}
-#ifdef ENABLE_TRACKER
/* batch rename */
G_DEFINE_TYPE (NautilusFileUndoInfoBatchRename, nautilus_file_undo_info_batch_rename, NAUTILUS_TYPE_FILE_UNDO_INFO);
@@ -1306,7 +1303,6 @@ nautilus_file_undo_info_batch_rename_set_data_post (NautilusFileUndoInfoBatchRen
self->priv->new_display_names = g_list_reverse (self->priv->new_display_names);
}
-#endif /* ENABLE_TRACKER */
/* trash */
G_DEFINE_TYPE (NautilusFileUndoInfoTrash, nautilus_file_undo_info_trash, NAUTILUS_TYPE_FILE_UNDO_INFO)
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index daa4009dd..0b35f6276 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -2216,7 +2216,6 @@ nautilus_file_rename_handle_file_gone (NautilusFile *file,
return FALSE;
}
-#ifdef ENABLE_TRACKER
typedef struct
{
NautilusFileOperation *op;
@@ -2422,8 +2421,6 @@ nautilus_file_batch_rename (GList *files,
callback_data);
}
-#endif /* ENABLE_TRACKER */
-
static void
real_rename (NautilusFile *file,
const char *new_name,
diff --git a/src/nautilus-file.h b/src/nautilus-file.h
index c4d17801e..417977856 100644
--- a/src/nautilus-file.h
+++ b/src/nautilus-file.h
@@ -332,12 +332,10 @@ void nautilus_file_rename (Nautilu
const char *new_name,
NautilusFileOperationCallback callback,
gpointer callback_data);
-#ifdef ENABLE_TRACKER
void nautilus_file_batch_rename (GList *files,
GList *new_names,
NautilusFileOperationCallback callback,
gpointer callback_data);
-#endif /* ENABLE_TRACKER */
void nautilus_file_cancel (NautilusFile *file,
NautilusFileOperationCallback callback,
gpointer callback_data);
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 3d569131a..0a358d1e1 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -28,10 +28,8 @@
#include "nautilus-files-view.h"
#include "nautilus-application.h"
-#ifdef ENABLE_TRACKER
#include "nautilus-batch-rename-dialog.h"
#include "nautilus-batch-rename-utilities.h"
-#endif
#include "nautilus-error-reporting.h"
#include "nautilus-file-undo-manager.h"
#include "nautilus-floating-bar.h"
@@ -6254,7 +6252,6 @@ real_action_rename (NautilusFilesView *view)
{
invoke_external_bulk_rename_utility (view, selection);
}
-#ifdef ENABLE_TRACKER
else
{
GdkCursor *cursor;
@@ -6272,7 +6269,6 @@ real_action_rename (NautilusFilesView *view)
gtk_widget_show (GTK_WIDGET (dialog));
}
-#endif
}
else
{
@@ -7464,12 +7460,8 @@ real_update_actions_state (NautilusFilesView *view)
}
else
{
-#ifdef ENABLE_TRACKER
g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
nautilus_file_can_rename_files (selection));
-#else
- g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
-#endif
}
}
else
diff --git a/src/nautilus-search-engine.c b/src/nautilus-search-engine.c
index f2bc0126b..209bd4f80 100644
--- a/src/nautilus-search-engine.c
+++ b/src/nautilus-search-engine.c
@@ -28,16 +28,11 @@
#include "nautilus-search-engine-model.h"
#define DEBUG_FLAG NAUTILUS_DEBUG_SEARCH
#include "nautilus-debug.h"
-
-#ifdef ENABLE_TRACKER
#include "nautilus-search-engine-tracker.h"
-#endif
typedef struct
{
-#ifdef ENABLE_TRACKER
NautilusSearchEngineTracker *tracker;
-#endif
NautilusSearchEngineSimple *simple;
NautilusSearchEngineModel *model;
@@ -78,9 +73,7 @@ nautilus_search_engine_set_query (NautilusSearchProvider *provider,
engine = NAUTILUS_SEARCH_ENGINE (provider);
priv = nautilus_search_engine_get_instance_private (engine);
-#ifdef ENABLE_TRACKER
nautilus_search_provider_set_query (NAUTILUS_SEARCH_PROVIDER (priv->tracker), query);
-#endif
nautilus_search_provider_set_query (NAUTILUS_SEARCH_PROVIDER (priv->model), query);
nautilus_search_provider_set_query (NAUTILUS_SEARCH_PROVIDER (priv->simple), query);
}
@@ -102,10 +95,9 @@ search_engine_start_real (NautilusSearchEngine *engine)
g_object_ref (engine);
-#ifdef ENABLE_TRACKER
nautilus_search_provider_start (NAUTILUS_SEARCH_PROVIDER (priv->tracker));
priv->providers_running++;
-#endif
+
if (nautilus_search_engine_model_get_model (priv->model))
{
nautilus_search_provider_start (NAUTILUS_SEARCH_PROVIDER (priv->model));
@@ -166,9 +158,7 @@ nautilus_search_engine_stop (NautilusSearchProvider *provider)
DEBUG ("Search engine stop");
-#ifdef ENABLE_TRACKER
nautilus_search_provider_stop (NAUTILUS_SEARCH_PROVIDER (priv->tracker));
-#endif
nautilus_search_provider_stop (NAUTILUS_SEARCH_PROVIDER (priv->model));
nautilus_search_provider_stop (NAUTILUS_SEARCH_PROVIDER (priv->simple));
@@ -343,9 +333,7 @@ nautilus_search_engine_finalize (GObject *object)
g_hash_table_destroy (priv->uris);
-#ifdef ENABLE_TRACKER
g_clear_object (&priv->tracker);
-#endif
g_clear_object (&priv->model);
g_clear_object (&priv->simple);
@@ -399,10 +387,9 @@ nautilus_search_engine_init (NautilusSearchEngine *engine)
priv = nautilus_search_engine_get_instance_private (engine);
priv->uris = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
-#ifdef ENABLE_TRACKER
priv->tracker = nautilus_search_engine_tracker_new ();
connect_provider_signals (engine, NAUTILUS_SEARCH_PROVIDER (priv->tracker));
-#endif
+
priv->model = nautilus_search_engine_model_new ();
connect_provider_signals (engine, NAUTILUS_SEARCH_PROVIDER (priv->model));