[tracker/direct-access: 77/85] libtracker-miner: Fix bugs introduced by port to libtracker-sparql
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/direct-access: 77/85] libtracker-miner: Fix bugs introduced by port to libtracker-sparql
- Date: Tue, 20 Jul 2010 14:11:05 +0000 (UTC)
commit 4fb364407066727021c08f798b5052b27cf3c78a
Author: Jürg Billeter <j bitron ch>
Date: Mon Jul 19 18:30:09 2010 +0200
libtracker-miner: Fix bugs introduced by port to libtracker-sparql
src/libtracker-miner/tracker-miner-fs.c | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 6f16312..e11e063 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -68,6 +68,7 @@ typedef struct {
gchar *parent_urn;
GCancellable *cancellable;
TrackerSparqlBuilder *builder;
+ TrackerMiner *miner;
} ProcessData;
typedef struct {
@@ -575,7 +576,8 @@ tracker_miner_fs_init (TrackerMinerFS *object)
}
static ProcessData *
-process_data_new (GFile *file,
+process_data_new (TrackerMiner *miner,
+ GFile *file,
const gchar *urn,
const gchar *parent_urn,
GCancellable *cancellable,
@@ -584,6 +586,7 @@ process_data_new (GFile *file,
ProcessData *data;
data = g_slice_new0 (ProcessData);
+ data->miner = miner;
data->file = g_object_ref (file);
data->urn = g_strdup (urn);
data->parent_urn = g_strdup (parent_urn);
@@ -951,10 +954,9 @@ commit_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
- TrackerMiner *miner = TRACKER_MINER (object);
GError *error = NULL;
- tracker_sparql_connection_update_commit_finish (tracker_miner_get_connection (miner), result, &error);
+ tracker_sparql_connection_update_commit_finish (TRACKER_SPARQL_CONNECTION (object), result, &error);
if (error) {
g_critical ("Could not commit: %s", error->message);
@@ -1028,11 +1030,11 @@ sparql_update_cb (GObject *object,
ProcessData *data;
GError *error = NULL;
- tracker_sparql_connection_update_finish (tracker_miner_get_connection (TRACKER_MINER (object)), result, &error);
+ tracker_sparql_connection_update_finish (TRACKER_SPARQL_CONNECTION (object), result, &error);
- fs = TRACKER_MINER_FS (object);
- priv = fs->private;
data = user_data;
+ fs = TRACKER_MINER_FS (data->miner);
+ priv = fs->private;
if (error) {
g_critical ("Could not execute sparql: %s", error->message);
@@ -1043,7 +1045,7 @@ sparql_update_cb (GObject *object,
/* Only commit immediately for
* changes after initial crawling.
*/
- tracker_sparql_connection_update_commit_async (tracker_miner_get_connection (TRACKER_MINER (fs)), NULL, commit_cb, NULL);
+ tracker_sparql_connection_update_commit_async (TRACKER_SPARQL_CONNECTION (object), NULL, commit_cb, NULL);
}
if (fs->private->current_iri_cache_parent) {
@@ -1083,12 +1085,10 @@ item_query_exists_cb (GObject *object,
{
ItemQueryExistsData *data = user_data;
TrackerSparqlCursor *cursor;
- TrackerMiner *miner;
GError *error = NULL;
guint n_results;
- miner = TRACKER_MINER (object);
- cursor = tracker_sparql_connection_query_finish (tracker_miner_get_connection (miner), result, &error);
+ cursor = tracker_sparql_connection_query_finish (TRACKER_SPARQL_CONNECTION (object), result, &error);
g_main_loop_quit (data->main_loop);
@@ -1556,7 +1556,7 @@ item_add_or_update (TrackerMinerFS *fs,
urn = iri_cache_lookup (fs, file);
- data = process_data_new (file, urn, parent_urn, cancellable, sparql);
+ data = process_data_new (TRACKER_MINER (fs), file, urn, parent_urn, cancellable, sparql);
priv->processing_pool = g_list_prepend (priv->processing_pool, data);
if (do_process_file (fs, data)) {
@@ -1625,7 +1625,7 @@ item_remove (TrackerMinerFS *fs,
"}",
uri);
- data = process_data_new (file, NULL, NULL, NULL, NULL);
+ data = process_data_new (TRACKER_MINER (fs), file, NULL, NULL, NULL, NULL);
fs->private->processing_pool = g_list_prepend (fs->private->processing_pool, data);
tracker_sparql_connection_update_async (tracker_miner_get_connection (TRACKER_MINER (fs)),
@@ -1736,7 +1736,7 @@ item_update_children_uri_cb (GObject *object,
RecursiveMoveData *data = user_data;
GError *error = NULL;
- TrackerSparqlCursor *cursor = tracker_sparql_connection_query_finish (tracker_miner_get_connection (TRACKER_MINER (object)), result, &error);
+ TrackerSparqlCursor *cursor = tracker_sparql_connection_query_finish (TRACKER_SPARQL_CONNECTION (object), result, &error);
if (error) {
g_critical ("Could not query children: %s", error->message);
@@ -1931,7 +1931,7 @@ item_move (TrackerMinerFS *fs,
g_main_loop_unref (move_data.main_loop);
- data = process_data_new (file, NULL, NULL, NULL, NULL);
+ data = process_data_new (TRACKER_MINER (fs), file, NULL, NULL, NULL, NULL);
fs->private->processing_pool = g_list_prepend (fs->private->processing_pool, data);
tracker_sparql_connection_update_async (tracker_miner_get_connection (TRACKER_MINER (fs)),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]