tracker r3070 - in trunk: . data/db src/trackerd
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r3070 - in trunk: . data/db src/trackerd
- Date: Fri, 13 Mar 2009 10:35:17 +0000 (UTC)
Author: pvanhoof
Date: Fri Mar 13 10:35:16 2009
New Revision: 3070
URL: http://svn.gnome.org/viewvc/tracker?rev=3070&view=rev
Log:
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
Modified:
trunk/ChangeLog
trunk/data/db/sqlite-stored-procs.sql
trunk/src/trackerd/tracker-cleanup.c
Modified: trunk/data/db/sqlite-stored-procs.sql
==============================================================================
--- trunk/data/db/sqlite-stored-procs.sql (original)
+++ trunk/data/db/sqlite-stored-procs.sql Fri Mar 13 10:35:16 2009
@@ -128,7 +128,7 @@
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 = ?;
Modified: trunk/src/trackerd/tracker-cleanup.c
==============================================================================
--- trunk/src/trackerd/tracker-cleanup.c (original)
+++ trunk/src/trackerd/tracker-cleanup.c Fri Mar 13 10:35:16 2009
@@ -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 @@
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]