[tracker-miners] libtracker-miner: Fix up task look up code
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners] libtracker-miner: Fix up task look up code
- Date: Mon, 10 Aug 2020 16:09:45 +0000 (UTC)
commit e7ea1eace32344d817d68bf550f9e7eb2f4e07e0
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Aug 10 17:52:08 2020 +0200
libtracker-miner: Fix up task look up code
One missing place that didn't update to tracker_task_pool_find()
changes...
src/libtracker-miner/tracker-sparql-buffer.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-sparql-buffer.c b/src/libtracker-miner/tracker-sparql-buffer.c
index ba89c8019..aac5c18bb 100644
--- a/src/libtracker-miner/tracker-sparql-buffer.c
+++ b/src/libtracker-miner/tracker-sparql-buffer.c
@@ -517,23 +517,34 @@ tracker_sparql_buffer_push_finish (TrackerSparqlBuffer *buffer,
return task;
}
+static gboolean
+task_has_file (TrackerTask *task,
+ GFile *file)
+{
+ GFile *task_file;
+
+ task_file = tracker_task_get_file (task);
+
+ return g_file_equal (task_file, file);
+}
+
TrackerSparqlBufferState
tracker_sparql_buffer_get_state (TrackerSparqlBuffer *buffer,
GFile *file)
{
TrackerSparqlBufferPrivate *priv;
- TrackerTask *task;
g_return_val_if_fail (TRACKER_IS_SPARQL_BUFFER (buffer), TRACKER_BUFFER_STATE_UNKNOWN);
g_return_val_if_fail (G_IS_FILE (file), TRACKER_BUFFER_STATE_UNKNOWN);
priv = tracker_sparql_buffer_get_instance_private (TRACKER_SPARQL_BUFFER (buffer));
- task = tracker_task_pool_find (TRACKER_TASK_POOL (buffer), file);
- if (!task)
+ if (!tracker_task_pool_find (TRACKER_TASK_POOL (buffer), file))
return TRACKER_BUFFER_STATE_UNKNOWN;
- if (priv->tasks && g_ptr_array_find (priv->tasks, task, NULL))
+ if (priv->tasks &&
+ g_ptr_array_find_with_equal_func (priv->tasks, file,
+ (GEqualFunc) task_has_file, NULL))
return TRACKER_BUFFER_STATE_QUEUED;
return TRACKER_BUFFER_STATE_FLUSHING;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]