[tracker] libtracker-data: Also delete -shm and -wal files when deleting database



commit aa3f472361a964eb89bcfa55bfe21fcfab97a1ce
Author: Jürg Billeter <j bitron ch>
Date:   Thu Jul 8 11:55:42 2010 +0200

    libtracker-data: Also delete -shm and -wal files when deleting database

 src/libtracker-data/tracker-db-manager.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index 05904a9..c149c05 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -394,8 +394,19 @@ db_manager_remove_all (gboolean rm_journal)
 	 * calculate the absolute directories here.
 	 */
 	for (i = 1; i < G_N_ELEMENTS (dbs); i++) {
+		gchar *filename;
+
 		g_message ("  Removing database:'%s'", dbs[i].abs_filename);
 		g_unlink (dbs[i].abs_filename);
+
+		/* also delete shm and wal helper files */
+		filename = g_strdup_printf ("%s-shm", dbs[i].abs_filename);
+		g_unlink (filename);
+		g_free (filename);
+
+		filename = g_strdup_printf ("%s-wal", dbs[i].abs_filename);
+		g_unlink (filename);
+		g_free (filename);
 	}
 
 	if (rm_journal) {



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