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



commit 6fd2b557b4a1efa37d7a0047ea5364af229445cd
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 |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index fbdcbda..836c6f9 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -427,10 +427,20 @@ 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]