[tracker] tracker-store: Removed unused data_dir/user_data_dir/sys_tmp_dir



commit e6cfdda135e29431f7e7815274ab5e8af3dd4a55
Author: Martyn Russell <martyn lanedo com>
Date:   Mon Nov 2 12:57:29 2009 +0000

    tracker-store: Removed unused data_dir/user_data_dir/sys_tmp_dir

 src/tracker-store/tracker-main.c |  108 +++-----------------------------------
 src/tracker-store/tracker-main.h |    4 --
 2 files changed, 7 insertions(+), 105 deletions(-)
---
diff --git a/src/tracker-store/tracker-main.c b/src/tracker-store/tracker-main.c
index ea1316c..e9e3249 100644
--- a/src/tracker-store/tracker-main.c
+++ b/src/tracker-store/tracker-main.c
@@ -79,9 +79,6 @@ typedef struct {
 	GMainLoop	 *main_loop;
 	gchar		 *log_filename;
 
-	gchar		 *data_dir;
-	gchar		 *user_data_dir;
-	gchar		 *sys_tmp_dir;
 	gchar            *ttl_backup_file;
 
 	gboolean          first_time_index;
@@ -134,10 +131,6 @@ private_free (gpointer data)
 
 	private = data;
 
-	g_free (private->sys_tmp_dir);
-	g_free (private->user_data_dir);
-	g_free (private->data_dir);
-
 	g_free (private->ttl_backup_file);
 	g_free (private->log_filename);
 
@@ -227,69 +220,11 @@ initialize_priority (void)
 }
 
 static void
-initialize_locations (void)
-{
-	TrackerMainPrivate *private;
-	gchar		   *filename;
-
-	private = g_static_private_get (&private_key);
-
-	/* Public locations */
-	private->user_data_dir =
-		g_build_filename (g_get_user_data_dir (),
-				  "tracker",
-				  "data",
-				  NULL);
-
-	private->data_dir =
-		g_build_filename (g_get_user_cache_dir (),
-				  "tracker",
-				  NULL);
-
-	filename = g_strdup_printf ("tracker-%s", g_get_user_name ());
-	private->sys_tmp_dir =
-		g_build_filename (g_get_tmp_dir (),
-				  filename,
-				  NULL);
-	g_free (filename);
-
-	private->ttl_backup_file = 
-		g_build_filename (private->user_data_dir, 
-				  "tracker-userdata-backup.ttl",
-				  NULL);
-}
-
-static void
 initialize_directories (void)
 {
-	TrackerMainPrivate *private;
-	gchar		   *filename;
-
-	private = g_static_private_get (&private_key);
-
 	/* NOTE: We don't create the database directories here, the
 	 * tracker-db-manager does that for us.
 	 */
-
-	g_message ("Checking directory exists:'%s'", private->user_data_dir);
-	g_mkdir_with_parents (private->user_data_dir, 00755);
-
-	g_message ("Checking directory exists:'%s'", private->data_dir);
-	g_mkdir_with_parents (private->data_dir, 00755);
-
-	/* Remove old tracker dirs */
-	filename = g_build_filename (g_get_home_dir (), ".Tracker", NULL);
-
-	if (g_file_test (filename, G_FILE_TEST_EXISTS)) {
-		tracker_path_remove (filename);
-	}
-
-	g_free (filename);
-
-	/* Remove database if we are reindexing */
-	filename = g_build_filename (private->sys_tmp_dir, "Attachments", NULL);
-	g_mkdir_with_parents (filename, 00700);
-	g_free (filename);
 }
 
 static void
@@ -309,12 +244,6 @@ shutdown_databases (void)
 }
 
 static void
-shutdown_locations (void)
-{
-	/* Nothing to do here, this is done by the private free func */
-}
-
-static void
 shutdown_directories (void)
 {
 	TrackerMainPrivate *private;
@@ -452,14 +381,13 @@ main (gint argc, gchar *argv[])
 	/* This makes sure we don't steal all the system's resources */
 	initialize_priority ();
 
-	/* This makes sure we have all the locations like the data
-	 * dir, user data dir, etc all configured.
-	 *
-	 * The initialize_directories() function makes sure everything
-	 * exists physically and/or is reset depending on various
-	 * options (like if we reindex, we remove the data dir).
-	 */
-	initialize_locations ();
+	/* Public locations */
+	private->ttl_backup_file = 
+		g_build_filename (g_get_user_data_dir (),
+				  "tracker",
+				  "data",
+				  "tracker-userdata-backup.ttl",
+				  NULL);
 
 	/* Initialize major subsystems */
 	config = tracker_config_new ();
@@ -555,8 +483,6 @@ shutdown:
 
 	g_object_unref (config);
 
-	shutdown_locations ();
-
 	g_print ("\nOK\n\n");
 
 	return EXIT_SUCCESS;
@@ -578,26 +504,6 @@ tracker_shutdown (void)
 	}
 }
 
-const gchar *
-tracker_get_data_dir (void)
-{
-	TrackerMainPrivate *private;
-
-	private = g_static_private_get (&private_key);
-
-	return private->data_dir;
-}
-
-const gchar *
-tracker_get_sys_tmp_dir (void)
-{
-	TrackerMainPrivate *private;
-
-	private = g_static_private_get (&private_key);
-
-	return private->sys_tmp_dir;
-}
-
 void
 tracker_set_reindex_on_shutdown (gboolean value)
 {
diff --git a/src/tracker-store/tracker-main.h b/src/tracker-store/tracker-main.h
index 9f1e510..3f1a6db 100644
--- a/src/tracker-store/tracker-main.h
+++ b/src/tracker-store/tracker-main.h
@@ -28,10 +28,6 @@
 G_BEGIN_DECLS
 
 void	     tracker_shutdown		     (void);
-
-const gchar *tracker_get_data_dir	     (void);
-const gchar *tracker_get_sys_tmp_dir	     (void);
-
 void	     tracker_set_reindex_on_shutdown (gboolean value);
 
 G_END_DECLS



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