[tracker-miners/wip/carlosg/miner-fs-ancillary-files: 10/10] tracker: Delete database location directories on reset




commit 822cc868ce838461e1be430a4c1ffdce0c5f32be
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Nov 8 21:57:16 2020 +0100

    tracker: Delete database location directories on reset
    
    This complements the first-index check that looks for the cache dir
    existing.

 src/tracker/tracker-reset.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/tracker/tracker-reset.c b/src/tracker/tracker-reset.c
index 3080d93e7..bd46e2fde 100644
--- a/src/tracker/tracker-reset.c
+++ b/src/tracker/tracker-reset.c
@@ -27,6 +27,7 @@
 #include <glib/gprintf.h>
 #include <gio/gio.h>
 #include <locale.h>
+#include <unistd.h>
 
 #include <libtracker-miners-common/tracker-common.h>
 #include <libtracker-sparql/tracker-sparql.h>
@@ -203,6 +204,8 @@ reset_run (void)
                location = g_file_new_for_path (dir);
                delete_location_content (location);
                g_object_unref (location);
+
+               rmdir (dir);
                g_free (dir);
        }
 
@@ -214,6 +217,7 @@ reset_run (void)
                cache_location = g_file_new_for_path (dir);
                delete_location_content (cache_location);
                g_object_unref (cache_location);
+               rmdir (dir);
                g_free (dir);
        }
 


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