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



commit e0bd4ed4ea5b0e06c1e0481968cc34df995a65b8
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 813f7b6..0bd6bd8 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -457,8 +457,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]