[maemo-commits] [maemo-commits] r16737 - projects/haf/trunk/hildon-thumbnail/daemon/plugins

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Nov 18 15:29:13 EET 2008
Author: pvanhoof
Date: 2008-11-18 15:29:12 +0200 (Tue, 18 Nov 2008)
New Revision: 16737

Modified:
   projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-jpeg-out-plugin.c
Log:
Performance improvement

Modified: projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-jpeg-out-plugin.c
===================================================================
--- projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-jpeg-out-plugin.c	2008-11-18 13:01:54 UTC (rev 16736)
+++ projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-jpeg-out-plugin.c	2008-11-18 13:29:12 UTC (rev 16737)
@@ -79,7 +79,6 @@
 		sqlite3_prepare_v2 (db, sql, -1, &stmt, NULL);
 
 		while (result == SQLITE_OK  || result == SQLITE_ROW || result == SQLITE_BUSY) {
-			gchar *dsql;
 			const unsigned char *path;
 
 			result = sqlite3_step (stmt);
@@ -97,13 +96,13 @@
 			}
 
 			path = sqlite3_column_text (stmt, 0);
-			dsql = g_strdup_printf ("delete from jpegthumbnails where Path = '%s'",
-					       path);
-			sqlite3_exec (db, dsql, callback, 0, NULL);
-			g_free (dsql);
 			g_unlink (path);
 		}
 		g_free (sql);
+		sql = g_strdup_printf ("delete from jpegthumbnails where URI LIKE '%s%%' and MTime <= '%Lu'",
+					       uri_match, since);
+		sqlite3_exec (db, sql, callback, 0, NULL);
+		g_free (sql);
 	}
 #endif
 }


More information about the maemo-commits mailing list