[tracker] TrackerMinerManager: Make index_file() return boolean.



commit 363822d10289d7fb952820542d27c97a833e014d
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Aug 23 15:19:49 2010 +0200

    TrackerMinerManager: Make index_file() return boolean.

 src/libtracker-miner/tracker-miner-manager.c |   16 ++++++++++++----
 src/libtracker-miner/tracker-miner-manager.h |    6 +++---
 2 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-manager.c b/src/libtracker-miner/tracker-miner-manager.c
index 06f7162..868a459 100644
--- a/src/libtracker-miner/tracker-miner-manager.c
+++ b/src/libtracker-miner/tracker-miner-manager.c
@@ -982,17 +982,18 @@ tracker_miner_manager_ignore_next_update (TrackerMinerManager *manager,
 	return TRUE;
 }
 
-void
+gboolean
 tracker_miner_manager_index_file (TrackerMinerManager  *manager,
                                   GFile                *file,
                                   GError              **error)
 {
 	static DBusGProxy *proxy = NULL;
 	TrackerMinerManagerPrivate *priv;
+	GError *internal_error = NULL;
 	gchar *uri;
 
-	g_return_if_fail (TRACKER_IS_MINER_MANAGER (manager));
-	g_return_if_fail (G_IS_FILE (file));
+	g_return_val_if_fail (TRACKER_IS_MINER_MANAGER (manager), FALSE);
+	g_return_val_if_fail (G_IS_FILE (file), FALSE);
 
 	priv = TRACKER_MINER_MANAGER_GET_PRIVATE (manager);
 
@@ -1004,6 +1005,13 @@ tracker_miner_manager_index_file (TrackerMinerManager  *manager,
 	}
 
 	uri = g_file_get_uri (file);
-	org_freedesktop_Tracker1_Miner_Files_Index_index_file (proxy, uri, error);
+	org_freedesktop_Tracker1_Miner_Files_Index_index_file (proxy, uri, &internal_error);
 	g_free (uri);
+
+	if (internal_error) {
+		g_propagate_error (error, internal_error);
+		return FALSE;
+	}
+
+	return TRUE;
 }
diff --git a/src/libtracker-miner/tracker-miner-manager.h b/src/libtracker-miner/tracker-miner-manager.h
index 9e707d4..2ce9e62 100644
--- a/src/libtracker-miner/tracker-miner-manager.h
+++ b/src/libtracker-miner/tracker-miner-manager.h
@@ -99,9 +99,9 @@ const gchar *        tracker_miner_manager_get_display_name   (TrackerMinerManag
 const gchar *        tracker_miner_manager_get_description    (TrackerMinerManager  *manager,
                                                                const gchar          *miner);
 
-void                 tracker_miner_manager_index_file         (TrackerMinerManager  *manager,
-                                                               GFile                *file,
-                                                               GError              **error);
+gboolean             tracker_miner_manager_index_file          (TrackerMinerManager  *manager,
+                                                                GFile                *file,
+                                                                GError              **error);
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]