tracker r1558 - in branches/indexer-split: . src/libtracker-common src/tracker-indexer src/trackerd



Author: carlosg
Date: Mon Jun  2 13:07:38 2008
New Revision: 1558
URL: http://svn.gnome.org/viewvc/tracker?rev=1558&view=rev

Log:
2008-06-02  Carlos Garnacho  <carlos imendio com>

        * src/libtracker-utils/tracker-file-utils.[ch] (tracker_dir_remove):
        Renamed to tracker_path_remove(). Use g_remove() instead of g_rmdir(),
        so it can be used too on files.
        * src/tracker-indexer/tracker-indexer.c:
        * src/trackerd/tracker-main.c: Replace all occurrences.


Modified:
   branches/indexer-split/ChangeLog
   branches/indexer-split/src/libtracker-common/tracker-file-utils.c
   branches/indexer-split/src/libtracker-common/tracker-file-utils.h
   branches/indexer-split/src/tracker-indexer/tracker-indexer.c
   branches/indexer-split/src/trackerd/tracker-main.c

Modified: branches/indexer-split/src/libtracker-common/tracker-file-utils.c
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-file-utils.c	(original)
+++ branches/indexer-split/src/libtracker-common/tracker-file-utils.c	Mon Jun  2 13:07:38 2008
@@ -422,7 +422,7 @@
 }
 
 void
-tracker_dir_remove (const gchar *uri)
+tracker_path_remove (const gchar *uri)
 {
 	GQueue *dirs;
 	GSList *dirs_to_remove = NULL;
@@ -463,7 +463,7 @@
 	g_queue_free (dirs);
 
 	/* Remove directories (now they are empty) */
-	g_slist_foreach (dirs_to_remove, (GFunc) g_rmdir, NULL);
+	g_slist_foreach (dirs_to_remove, (GFunc) g_remove, NULL);
 	g_slist_foreach (dirs_to_remove, (GFunc) g_free, NULL);
 	g_slist_free (dirs_to_remove);
 }

Modified: branches/indexer-split/src/libtracker-common/tracker-file-utils.h
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-file-utils.h	(original)
+++ branches/indexer-split/src/libtracker-common/tracker-file-utils.h	Mon Jun  2 13:07:38 2008
@@ -36,6 +36,6 @@
 gchar *  tracker_file_get_vfs_path  (const gchar *uri);
 gchar *  tracker_file_get_vfs_name  (const gchar *uri);
 
-void     tracker_dir_remove         (const gchar *uri);
+void     tracker_path_remove        (const gchar *uri);
 
 #endif /* __LIBTRACKER_COMMON_FILE_UTILS_H__ */

Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer.c	(original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer.c	Mon Jun  2 13:07:38 2008
@@ -259,8 +259,8 @@
 
 	priv = TRACKER_INDEXER_GET_PRIVATE (indexer);
 
-	if (priv->reindex) {
-		tracker_dir_remove (priv->db_dir);
+	if (priv->reindex || !g_file_test (priv->db_dir, G_FILE_TEST_IS_DIR)) {
+		tracker_path_remove (priv->db_dir);
 	}
 
 	if (!g_file_test (priv->db_dir, G_FILE_TEST_EXISTS)) {

Modified: branches/indexer-split/src/trackerd/tracker-main.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-main.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-main.c	Mon Jun  2 13:07:38 2008
@@ -503,21 +503,21 @@
 	
 	/* Remove an existing one */
 	if (g_file_test (sys_tmp_dir, G_FILE_TEST_EXISTS)) {
-		tracker_dir_remove (sys_tmp_dir);
+		tracker_path_remove (sys_tmp_dir);
 	}
 
 	/* Remove old tracker dirs */
         filename = g_build_filename (g_get_home_dir (), ".Tracker", NULL);
 
 	if (g_file_test (filename, G_FILE_TEST_EXISTS)) {
-		tracker_dir_remove (filename);
+		tracker_path_remove (filename);
 	}
 
 	g_free (filename);
 
 	/* Remove database if we are reindexing */
 	if (reindex || tracker_db_needs_setup ()) {
-		tracker_dir_remove (data_dir);
+		tracker_path_remove (data_dir);
 		*need_index = TRUE;
 	}
 
@@ -792,13 +792,13 @@
 {
 	/* If we are reindexing, just remove the databases */
 	if (tracker->reindex) {
-		tracker_dir_remove (data_dir);
+		tracker_path_remove (data_dir);
 		g_mkdir_with_parents (data_dir, 00755);
 	}
 
 	/* Remove sys tmp directory */
 	if (sys_tmp_dir) {
-		tracker_dir_remove (sys_tmp_dir);
+		tracker_path_remove (sys_tmp_dir);
 	}
 }
 



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