[tracker-miners/sam/index-location: 21/21] fixup flags
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/sam/index-location: 21/21] fixup flags
- Date: Thu, 9 Jul 2020 23:05:32 +0000 (UTC)
commit 5672444a0200c2157addc4935dff0027e8a882c6
Author: Sam Thursfield <sam afuera me uk>
Date: Fri Jul 10 00:49:55 2020 +0200
fixup flags
src/libtracker-miners-common/tracker-enums.h | 6 +++---
src/miners/fs/tracker-miner-files-index.c | 15 +++++++++------
src/tracker/tracker-index.c | 2 +-
3 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/src/libtracker-miners-common/tracker-enums.h b/src/libtracker-miners-common/tracker-enums.h
index 3b1cbcf68..708e81b2b 100644
--- a/src/libtracker-miners-common/tracker-enums.h
+++ b/src/libtracker-miners-common/tracker-enums.h
@@ -35,9 +35,9 @@ typedef enum {
typedef enum {
TRACKER_INDEX_LOCATION_FLAGS_NONE = 0,
- TRACKER_INDEX_LOCATION_FLAG_WATCH_FOR_CALLER = 1 << 0,
- TRACKER_INDEX_LOCATION_FLAG_AWAIT_MINER_FS = 1 << 1,
- TRACKER_INDEX_LOCATION_FLAG_AWAIT_EXTRACT = 1 << 2,
+ TRACKER_INDEX_LOCATION_WATCH_FOR_CALLER = 1 << 0,
+ TRACKER_INDEX_LOCATION_AWAIT_MINER_FS = 1 << 1,
+ TRACKER_INDEX_LOCATION_AWAIT_EXTRACT = 1 << 2,
} TrackerIndexLocationFlags;
G_END_DECLS
diff --git a/src/miners/fs/tracker-miner-files-index.c b/src/miners/fs/tracker-miner-files-index.c
index 1103a1562..cc59ebfdd 100644
--- a/src/miners/fs/tracker-miner-files-index.c
+++ b/src/miners/fs/tracker-miner-files-index.c
@@ -116,7 +116,7 @@ await_miner_fs_data_new (GFile *file,
data = g_slice_new0 (AwaitMinerFsData);
data->file = g_object_ref (file);
- data->request = g_object_ref (request);
+ data->request = request;
data->invocation = g_object_ref (invocation);
return data;
@@ -224,11 +224,12 @@ parse_index_location_flags (const gchar **flags_strv,
TrackerIndexLocationFlags flags = 0;
GFlagsClass *type_class;
GFlagsValue *value;
- const gchar *flag_string;
type_class = g_type_class_ref (TRACKER_TYPE_INDEX_LOCATION_FLAGS);
- for (flag_string = *flags_strv; flag_string; flag_string ++) {
+ while (*flags_strv) {
+ const gchar *flag_string = *flags_strv;
+
value = g_flags_get_value_by_nick (type_class, flag_string);
if (value == NULL) {
@@ -241,6 +242,8 @@ parse_index_location_flags (const gchar **flags_strv,
}
flags |= value->value;
+
+ flags_strv ++;
}
g_type_class_unref (type_class);
@@ -381,12 +384,12 @@ handle_method_call_index_location (TrackerMinerFilesIndex *miner,
return;
}
- watch_for_caller = flags & TRACKER_INDEX_LOCATION_FLAG_WATCH_FOR_CALLER;
+ watch_for_caller = flags & TRACKER_INDEX_LOCATION_WATCH_FOR_CALLER;
is_dir = (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY);
g_object_unref (file_info);
- if (flags & TRACKER_INDEX_LOCATION_FLAG_AWAIT_MINER_FS) {
+ if (flags & TRACKER_INDEX_LOCATION_AWAIT_MINER_FS) {
AwaitMinerFsData *data;
data = await_miner_fs_data_new (file, request, invocation);
@@ -415,7 +418,7 @@ handle_method_call_index_location (TrackerMinerFilesIndex *miner,
}
}
- if (flags & TRACKER_INDEX_LOCATION_FLAG_AWAIT_MINER_FS) {
+ if (flags & TRACKER_INDEX_LOCATION_AWAIT_MINER_FS) {
/* DBus request will return in await_miner_fs_files_processed_cb */
} else {
tracker_dbus_request_end (request, NULL);
diff --git a/src/tracker/tracker-index.c b/src/tracker/tracker-index.c
index 77350f343..6c9e9e01d 100644
--- a/src/tracker/tracker-index.c
+++ b/src/tracker/tracker-index.c
@@ -200,7 +200,7 @@ index_run (void)
file = g_file_new_for_commandline_arg (*p);
if (monitor_mode) {
- flags |= TRACKER_INDEX_LOCATION_FLAG_WATCH_FOR_CALLER;
+ flags |= TRACKER_INDEX_LOCATION_WATCH_FOR_CALLER;
}
status = tracker_miner_manager_index_location_async (manager, file, flags, NULL,
index_location_cb, main_loop);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]