Commit 90716f32 authored by Philip Van Hoof's avatar Philip Van Hoof Committed by Philip Van Hoof

Cleaning up removable devices' thumbnails after a long period of the

2009-03-13  Philip Van Hoof  <philip@codeminded.be>

        * src/trackerd/tracker-cleanup.c:
        * data/db/sqlite-stored-procs.sql: Cleaning up removable devices'
        thumbnails after a long period of the device not having been mounted


svn path=/trunk/; revision=3070
parent 15abddc5
2009-03-13 Philip Van Hoof <philip@codeminded.be>
* src/trackerd/tracker-cleanup.c:
* data/db/sqlite-stored-procs.sql: Cleaning up removable devices'
thumbnails after a long period of the device not having been mounted
2009-03-12 Philip Van Hoof <philip@codeminded.be>
* src/libtracker-data/tracker-data-update.c: Cope with the insanity of
......
......@@ -128,7 +128,7 @@ GetHitDetails SELECT ROWID, HitCount, HitArraySize FROM HitInde
GetVolumeID SELECT VolumeID FROM Volumes WHERE UDI = ?;
GetVolumeByPath SELECT VolumeID FROM Volumes WHERE Enabled = 1 AND (? = MountPath OR ? LIKE (MountPath || '/%'));
GetVolumesToClean SELECT VolumeID FROM Volumes WHERE DisabledDate < date('now', '-3 day');
GetVolumesToClean SELECT MountPath FROM Volumes WHERE DisabledDate < date('now', '-3 day');
InsertVolume INSERT INTO Volumes (MountPath, UDI, Enabled, DisabledDate) VALUES (?, ?, 1, date('now'));
EnableVolume UPDATE Volumes SET MountPath = ?, Enabled = 1 WHERE UDI = ?;
DisableVolume UPDATE Volumes SET Enabled = 0, DisabledDate = date ('now') WHERE UDI = ?;
......
......@@ -22,6 +22,8 @@
#include <stdlib.h>
#include <gio/gio.h>
#include <libtracker-db/tracker-db-manager.h>
#include <libtracker-data/tracker-data-update.h>
#include <libtracker-common/tracker-thumbnailer.h>
......@@ -59,18 +61,21 @@ check_for_volumes_to_cleanup (gpointer user_data)
gboolean is_valid = TRUE;
while (is_valid) {
GValue value = { 0, };
GValue value = { 0, };
const gchar *mount_point;
_tracker_db_result_set_get_value (result_set, 0, &value);
#if 0
mount_point = g_value_get_string (&value);
/* Add cleanup items here */
if (mount_point) {
tracker_thumbnailer_cleanup (mount_point);
GFile *dir_file = g_file_new_for_path (mount_point);
gchar *mntp_uri = g_file_get_uri (dir_file);
tracker_thumbnailer_cleanup (mntp_uri);
g_free (mntp_uri);
g_object_unref (dir_file);
}
#endif
g_value_unset (&value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment