tracker r2564 - in trunk: . data/db src/libtracker-common src/tracker-extract src/tracker-indexer src/trackerd tests/tracker-indexer
- From: mr svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2564 - in trunk: . data/db src/libtracker-common src/tracker-extract src/tracker-indexer src/trackerd tests/tracker-indexer
- Date: Tue, 25 Nov 2008 14:42:26 +0000 (UTC)
Author: mr
Date: Tue Nov 25 14:42:26 2008
New Revision: 2564
URL: http://svn.gnome.org/viewvc/tracker?rev=2564&view=rev
Log:
* configure.ac:
* data/db/sqlite-stored-procs.sql:
* data/db/sqlite-tracker.sql:
* src/libtracker-common/Makefile.am:
* src/libtracker-common/tracker-thumbnailer.[ch]:
* src/tracker-extract/tracker-albumart.c:
* src/tracker-indexer/Makefile.am:
* src/tracker-indexer/tracker-dbus.c:
* src/tracker-indexer/tracker-indexer.c:
* src/tracker-indexer/tracker-main.c:
* src/tracker-indexer/tracker-metadata-utils.c:
* src/tracker-indexer/tracker-thumbnailer.[ch]:
* src/trackerd/Makefile.am:
* src/trackerd/tracker-main.c:
* tests/tracker-indexer/Makefile.am: Added code to clean up
database volumes which have been disabled for more than 3 days.
Moved the thumbnailer code to libtracker-common since it is used
by the indexer and the daemon. This patch was written by Phillip.
Added:
trunk/src/libtracker-common/tracker-thumbnailer.c
trunk/src/libtracker-common/tracker-thumbnailer.h
Removed:
trunk/src/tracker-indexer/tracker-thumbnailer.c
trunk/src/tracker-indexer/tracker-thumbnailer.h
Modified:
trunk/ChangeLog
trunk/configure.ac
trunk/data/db/sqlite-stored-procs.sql
trunk/data/db/sqlite-tracker.sql
trunk/src/libtracker-common/Makefile.am
trunk/src/tracker-extract/tracker-albumart.c
trunk/src/tracker-indexer/Makefile.am
trunk/src/tracker-indexer/tracker-dbus.c
trunk/src/tracker-indexer/tracker-indexer.c
trunk/src/tracker-indexer/tracker-main.c
trunk/src/tracker-indexer/tracker-metadata-utils.c
trunk/src/trackerd/Makefile.am
trunk/src/trackerd/tracker-main.c
trunk/tests/tracker-indexer/Makefile.am
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Tue Nov 25 14:42:26 2008
@@ -1114,8 +1114,6 @@
tests/tracker-indexer/tracker-module-file.h:src/tracker-indexer/tracker-module-file.h
tests/tracker-indexer/tracker-module-iteratable.c:src/tracker-indexer/tracker-module-iteratable.c
tests/tracker-indexer/tracker-module-iteratable.h:src/tracker-indexer/tracker-module-iteratable.h
- tests/tracker-indexer/tracker-thumbnailer.h:src/tracker-indexer/tracker-thumbnailer.h
- tests/tracker-indexer/tracker-thumbnailer.c:src/tracker-indexer/tracker-thumbnailer.c
)
##################################################################
Modified: trunk/data/db/sqlite-stored-procs.sql
==============================================================================
--- trunk/data/db/sqlite-stored-procs.sql (original)
+++ trunk/data/db/sqlite-stored-procs.sql Tue Nov 25 14:42:26 2008
@@ -131,9 +131,10 @@
GetVolumeID SELECT VolumeID FROM Volumes WHERE UDI = ?;
GetVolumeByPath SELECT VolumeID FROM Volumes WHERE Enabled = 1 AND (? = MountPath OR ? LIKE (MountPath || '/%'));
-InsertVolume INSERT INTO Volumes (MountPath, UDI, Enabled) VALUES (?, ?, 1);
+GetVolumesToClean SELECT VolumeID 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 WHERE UDI = ?;
+DisableVolume UPDATE Volumes SET Enabled = 0, DisabledDate = date ('now') WHERE UDI = ?;
DisableAllVolumes UPDATE Volumes SET Enabled = 0;
/*
Modified: trunk/data/db/sqlite-tracker.sql
==============================================================================
--- trunk/data/db/sqlite-tracker.sql (original)
+++ trunk/data/db/sqlite-tracker.sql Tue Nov 25 14:42:26 2008
@@ -17,8 +17,8 @@
UDI Text,
VolumeName Text,
MountPath Text,
- Enabled Integer default 0
-
+ Enabled Integer default 0,
+ DisabledDate Text
);
Modified: trunk/src/libtracker-common/Makefile.am
==============================================================================
--- trunk/src/libtracker-common/Makefile.am (original)
+++ trunk/src/libtracker-common/Makefile.am Tue Nov 25 14:42:26 2008
@@ -47,7 +47,8 @@
tracker-parser.c \
tracker-service.c \
tracker-type-utils.c \
- tracker-utils.c
+ tracker-utils.c \
+ tracker-thumbnailer.c
noinst_HEADERS = \
$(hal_headers) \
@@ -56,7 +57,8 @@
tracker-ioprio.h \
tracker-log.h \
tracker-nfs-lock.h \
- tracker-os-dependant.h
+ tracker-os-dependant.h \
+ tracker-thumbnailer.h
libtracker_commoninclude_HEADERS = \
tracker-common.h \
Added: trunk/src/libtracker-common/tracker-thumbnailer.c
==============================================================================
--- (empty file)
+++ trunk/src/libtracker-common/tracker-thumbnailer.c Tue Nov 25 14:42:26 2008
@@ -0,0 +1,468 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc gnome org)
+ * Copyright (C) 2008, Nokia
+
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include "tracker-dbus.h"
+
+/* Undef this to disable thumbnailing (don't remove unless you
+ * understand that that either you need to put in place another method
+ * to disable/enable this and that what will be used by the packager
+ * is probably *your* default, or unless you want to break expected
+ * functionality on-purpose) (It's not the first time that these
+ * ifdef-else-endifs where rewrapped incorrectly, and that way
+ * obviously broke the feature)
+ */
+
+#ifndef THUMBNAILING_OVER_DBUS
+#define THUMBNAILING_OVER_DBUS
+#endif
+
+#ifdef THUMBNAILING_OVER_DBUS
+
+#define THUMBNAILER_SERVICE "org.freedesktop.thumbnailer"
+#define THUMBNAILER_PATH "/org/freedesktop/thumbnailer/Generic"
+#define THUMBNAILER_INTERFACE "org.freedesktop.thumbnailer.Generic"
+
+#define THUMBMAN_PATH "/org/freedesktop/thumbnailer/Manager"
+#define THUMBMAN_INTERFACE "org.freedesktop.thumbnailer.Manager"
+
+#define THUMBNAIL_REQUEST_LIMIT 50
+
+
+
+static DBusGProxy*
+get_thumb_requester (void)
+{
+ static DBusGProxy *thumb_proxy = NULL;
+
+ if (!thumb_proxy) {
+ GError *error = NULL;
+ DBusGConnection *connection;
+
+ connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
+
+ if (!error) {
+ thumb_proxy = dbus_g_proxy_new_for_name (connection,
+ THUMBNAILER_SERVICE,
+ THUMBNAILER_PATH,
+ THUMBNAILER_INTERFACE);
+ } else {
+ g_error_free (error);
+ }
+ }
+
+ return thumb_proxy;
+}
+
+
+static DBusGProxy*
+get_thumb_manager (void)
+{
+ static DBusGProxy *thumbm_proxy = NULL;
+
+ if (!thumbm_proxy) {
+ GError *error = NULL;
+ DBusGConnection *connection;
+
+ connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
+
+ if (!error) {
+ thumbm_proxy = dbus_g_proxy_new_for_name (connection,
+ THUMBNAILER_SERVICE,
+ THUMBMAN_PATH,
+ THUMBMAN_INTERFACE);
+ } else {
+ g_error_free (error);
+ }
+ }
+
+ return thumbm_proxy;
+}
+
+typedef struct {
+ GStrv supported_mime_types;
+
+ gchar *uris[THUMBNAIL_REQUEST_LIMIT + 1];
+ gchar *mime_types[THUMBNAIL_REQUEST_LIMIT + 1];
+
+ guint request_id;
+ guint count;
+ guint timeout_id;
+
+ gboolean service_is_prepared;
+} TrackerThumbnailerPrivate;
+
+static GStaticPrivate private_key = G_STATIC_PRIVATE_INIT;
+
+static void
+private_free (gpointer data)
+{
+ TrackerThumbnailerPrivate *private;
+ gint i;
+
+ private = data;
+
+ g_strfreev (private->supported_mime_types);
+
+ for (i = 0; i <= private->count; i++) {
+ g_free (private->uris[i]);
+ g_free (private->mime_types[i]);
+ }
+
+ if (private->timeout_id) {
+ g_source_remove (private->timeout_id);
+ }
+
+ g_free (private);
+}
+
+static gboolean
+should_be_thumbnailed (GStrv list,
+ const gchar *mime)
+{
+ gboolean should_thumbnail;
+ guint i;
+
+ if (!list) {
+ return TRUE;
+ }
+
+ for (should_thumbnail = FALSE, i = 0;
+ should_thumbnail == FALSE && list[i] != NULL;
+ i++) {
+ if (g_ascii_strcasecmp (list[i], mime) == 0) {
+ should_thumbnail = TRUE;
+ }
+ }
+
+ return should_thumbnail;
+}
+
+static void
+thumbnailer_reply_cb (DBusGProxy *proxy,
+ DBusGProxyCall *call,
+ gpointer user_data)
+{
+ GError *error = NULL;
+ guint handle;
+
+ /* The point of this is dbus-glib correctness. Answering this
+ * because this comment used to be the question: what is the
+ * point of this. It's correct this way because we do
+ * asynchronous DBus calls using glib-dbus. For asynchronous
+ * DBus calls it's recommended (if not required for cleaning
+ * up) to call dbus_g_proxy_end_call.
+ */
+ dbus_g_proxy_end_call (proxy, call, &error,
+ G_TYPE_UINT, &handle,
+ G_TYPE_INVALID);
+
+ if (error) {
+ g_warning ("%s", error->message);
+ g_error_free (error);
+ return;
+ }
+
+ g_message ("Received response from thumbnailer, request ID:%d",
+ GPOINTER_TO_UINT (user_data));
+}
+
+static gboolean
+thumbnailer_request_timeout_cb (gpointer data)
+{
+ TrackerThumbnailerPrivate *private;
+ guint i;
+
+ private = g_static_private_get (&private_key);
+ g_return_val_if_fail (private != NULL, FALSE);
+
+ private->request_id++;
+
+ private->uris[private->count] = NULL;
+ private->mime_types[private->count] = NULL;
+
+ g_message ("Sending request to thumbnailer to queue %d files, request ID:%d...",
+ private->count,
+ private->request_id);
+
+ dbus_g_proxy_begin_call (get_thumb_requester (),
+ "Queue",
+ thumbnailer_reply_cb,
+ GUINT_TO_POINTER (private->request_id),
+ NULL,
+ G_TYPE_STRV, private->uris,
+ G_TYPE_STRV, private->mime_types,
+ G_TYPE_UINT, 0,
+ G_TYPE_INVALID);
+
+ for (i = 0; i <= private->count; i++) {
+ g_free (private->uris[i]);
+ g_free (private->mime_types[i]);
+ private->uris[i] = NULL;
+ private->mime_types[i] = NULL;
+ }
+
+ private->count = 0;
+ private->timeout_id = 0;
+
+ return FALSE;
+}
+
+static void
+thumbnailer_prepare (void)
+{
+ TrackerThumbnailerPrivate *private;
+ GStrv mime_types = NULL;
+ GError *error = NULL;
+
+ private = g_static_private_get (&private_key);
+
+ if (private->service_is_prepared) {
+ return;
+ }
+
+ /* It's known that this relatively small GStrv is leaked: it contains
+ * the MIME types that the DBus thumbnailer supports. If a MIME type
+ * is not within this list, yet we retrieved it once, then we decide
+ * not to perform thumbnail actions over DBus. This is a performance
+ * improvement and the GStrv can be resident in memory until the end
+ * of the application - it's a cache -
+ *
+ * It doesn't support detecting when the DBus thumbnailer starts
+ * supporting more formats (which can indeed start happening). This is
+ * a known tradeoff and limitation of this cache. We could enhance this
+ * cache to listen for changes on the bus, and invalidate it once we
+ * know that more MIME types have become supported. It has no high
+ * priority now, though (therefore, is this a TODO).
+ */
+
+ g_message ("Thumbnailer supported mime types being requested...");
+
+ dbus_g_proxy_call (get_thumb_manager (),
+ "GetSupported", &error,
+ G_TYPE_INVALID,
+ G_TYPE_STRV, &mime_types,
+ G_TYPE_INVALID);
+
+ if (error) {
+ g_warning ("Thumbnailer service did not return supported mime types, %s",
+ error->message);
+ g_error_free (error);
+ } else if (mime_types) {
+ g_message ("Thumbnailer supports %d mime types",
+ g_strv_length (mime_types));
+ private->supported_mime_types = mime_types;
+ }
+
+ private->service_is_prepared = TRUE;
+}
+
+#endif /* THUMBNAILING_OVER_DBUS */
+
+void
+tracker_thumbnailer_init (void)
+{
+ TrackerThumbnailerPrivate *private;
+
+ private = g_new0 (TrackerThumbnailerPrivate, 1);
+ g_static_private_set (&private_key,
+ private,
+ private_free);
+
+ thumbnailer_prepare ();
+}
+
+void
+tracker_thumbnailer_shutdown (void)
+{
+ g_static_private_set (&private_key, NULL, NULL);
+}
+
+void
+tracker_thumbnailer_move (const gchar *from_uri,
+ const gchar *mime_type,
+ const gchar *to_uri)
+{
+#ifdef THUMBNAILING_OVER_DBUS
+ TrackerThumbnailerPrivate *private;
+ const gchar *to[2] = { NULL, NULL };
+ const gchar *from[2] = { NULL, NULL };
+
+ g_return_if_fail (from_uri != NULL);
+ g_return_if_fail (mime_type != NULL);
+ g_return_if_fail (to_uri != NULL);
+
+ private = g_static_private_get (&private_key);
+ g_return_if_fail (private != NULL);
+
+ if (!should_be_thumbnailed (private->supported_mime_types, mime_type)) {
+ g_debug ("Thumbnailer ignoring mime type:'%s'",
+ mime_type);
+ return;
+ }
+
+ private->request_id++;
+
+ g_message ("Requesting thumbnailer moves URI from:'%s' to:'%s', request_id:%d...",
+ from_uri,
+ to_uri,
+ private->request_id);
+
+ to[0] = to_uri;
+ from[0] = from_uri;
+
+ dbus_g_proxy_begin_call (get_thumb_requester (),
+ "Move",
+ thumbnailer_reply_cb,
+ GUINT_TO_POINTER (private->request_id),
+ NULL,
+ G_TYPE_STRV, from,
+ G_TYPE_STRV, to,
+ G_TYPE_INVALID);
+#endif /* THUMBNAILING_OVER_DBUS */
+}
+
+void
+tracker_thumbnailer_remove (const gchar *uri,
+ const gchar *mime_type)
+{
+#ifdef THUMBNAILING_OVER_DBUS
+ TrackerThumbnailerPrivate *private;
+ const gchar *uris[2] = { NULL, NULL };
+
+ g_return_if_fail (uri != NULL);
+ g_return_if_fail (mime_type != NULL);
+
+ private = g_static_private_get (&private_key);
+ g_return_if_fail (private != NULL);
+
+ if (!should_be_thumbnailed (private->supported_mime_types, mime_type)) {
+ g_debug ("Thumbnailer ignoring mime type:'%s' and uri:'%s'",
+ mime_type,
+ uri);
+ return;
+ }
+
+ private->request_id++;
+
+ uris[0] = uri;
+
+ g_message ("Requesting thumbnailer removes URI:'%s', request_id:%d...",
+ uri,
+ private->request_id);
+
+ dbus_g_proxy_begin_call (get_thumb_requester (),
+ "Delete",
+ thumbnailer_reply_cb,
+ GUINT_TO_POINTER (private->request_id),
+ NULL,
+ G_TYPE_STRV, uri,
+ G_TYPE_INVALID);
+#endif /* THUMBNAILING_OVER_DBUS */
+}
+
+void
+tracker_thumbnailer_cleanup (const gchar *uri_prefix)
+{
+#ifdef THUMBNAILING_OVER_DBUS
+ TrackerThumbnailerPrivate *private;
+
+ private = g_static_private_get (&private_key);
+ g_return_if_fail (private != NULL);
+
+ private->request_id++;
+
+ g_message ("Requesting thumbnailer cleanup URI:'%s', request_id:%d...",
+ uri_prefix,
+ private->request_id);
+
+ dbus_g_proxy_begin_call (get_thumb_requester (),
+ "Cleanup",
+ thumbnailer_reply_cb,
+ GUINT_TO_POINTER (private->request_id),
+ NULL,
+ G_TYPE_STRING, uri_prefix,
+ G_TYPE_INT64, 0,
+ G_TYPE_INVALID);
+
+#endif /* THUMBNAILING_OVER_DBUS */
+}
+
+
+void
+tracker_thumbnailer_get_file_thumbnail (const gchar *uri,
+ const gchar *mime_type)
+{
+#ifdef THUMBNAILING_OVER_DBUS
+ TrackerThumbnailerPrivate *private;
+
+ g_return_if_fail (uri != NULL);
+ g_return_if_fail (mime_type != NULL);
+
+ private = g_static_private_get (&private_key);
+ g_return_if_fail (private != NULL);
+
+ if (!should_be_thumbnailed (private->supported_mime_types, mime_type)) {
+ g_debug ("Thumbnailer ignoring mime type:'%s' and uri:'%s'",
+ mime_type,
+ uri);
+ return;
+ }
+
+ private->request_id++;
+
+ g_message ("Requesting thumbnailer to get thumbnail for URI:'%s', request_id:%d...",
+ uri,
+ private->request_id);
+
+ /* We want to deal with the current list first if it is
+ * already at the limit.
+ */
+ if (private->count == THUMBNAIL_REQUEST_LIMIT) {
+ g_debug ("Already have %d thumbnails queued, forcing thumbnailer request",
+ THUMBNAIL_REQUEST_LIMIT);
+
+ g_source_remove (private->timeout_id);
+ private->timeout_id = 0;
+
+ thumbnailer_request_timeout_cb (NULL);
+ }
+
+ /* Add new URI */
+ private->uris[private->count] = g_strdup (uri);
+
+ if (mime_type) {
+ private->mime_types[private->count] = g_strdup (mime_type);
+ } else if (g_strv_length (private->mime_types) > 0) {
+ private->mime_types[private->count] = g_strdup ("unknown/unknown");
+ }
+
+ private->count++;
+
+ if (private->timeout_id == 0) {
+ private->timeout_id =
+ g_timeout_add_seconds (30,
+ thumbnailer_request_timeout_cb,
+ NULL);
+ }
+#endif /* THUMBNAILING_OVER_DBUS */
+}
Added: trunk/src/libtracker-common/tracker-thumbnailer.h
==============================================================================
--- (empty file)
+++ trunk/src/libtracker-common/tracker-thumbnailer.h Tue Nov 25 14:42:26 2008
@@ -0,0 +1,44 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc gnome org)
+ * Copyright (C) 2008, Nokia
+
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __TRACKER_METADATA_UTILS_H__
+#define __TRACKER_METADATA_UTILS_H__
+
+#include <libtracker-data/tracker-data-metadata.h>
+#include <tracker-indexer/tracker-module-file.h>
+
+G_BEGIN_DECLS
+
+void tracker_thumbnailer_init (void);
+void tracker_thumbnailer_shutdown (void);
+
+void tracker_thumbnailer_get_file_thumbnail (const gchar *path,
+ const gchar *mime);
+void tracker_thumbnailer_move (const gchar *from_uri,
+ const gchar *mime_type,
+ const gchar *to_uri);
+void tracker_thumbnailer_remove (const gchar *uri,
+ const gchar *mime_type);
+void tracker_thumbnailer_cleanup (const gchar *uri_prefix);
+
+G_END_DECLS
+
+#endif /* __TRACKER_METADATA_UTILS_H__ */
Modified: trunk/src/tracker-extract/tracker-albumart.c
==============================================================================
--- trunk/src/tracker-extract/tracker-albumart.c (original)
+++ trunk/src/tracker-extract/tracker-albumart.c Tue Nov 25 14:42:26 2008
@@ -40,6 +40,7 @@
#include <dbus/dbus-glib-bindings.h>
#include <libtracker-common/tracker-common.h>
+#include <libtracker-common/tracker-thumbnailer.h>
#include "tracker-albumart.h"
@@ -59,31 +60,6 @@
gchar **path,
gchar **local);
-
-static DBusGProxy*
-get_thumb_requester (void)
-{
- static DBusGProxy *thumb_proxy = NULL;
-
- if (!thumb_proxy) {
- GError *error = NULL;
- DBusGConnection *connection;
-
- connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
-
- if (!error) {
- thumb_proxy = dbus_g_proxy_new_for_name (connection,
- THUMBNAILER_SERVICE,
- THUMBNAILER_PATH,
- THUMBNAILER_INTERFACE);
- } else {
- g_error_free (error);
- }
- }
-
- return thumb_proxy;
-}
-
#ifndef HAVE_STRCASESTR
static gchar *
@@ -254,23 +230,6 @@
return retval;
}
-static void
-thumbnail_generic_cb (DBusGProxy *proxy,
- DBusGProxyCall *call,
- gpointer user_data)
-{
- GError *error = NULL;
- guint handle;
-
- dbus_g_proxy_end_call (proxy, call, &error,
- G_TYPE_UINT, &handle,
- G_TYPE_INVALID);
-
- if (error) {
- g_warning ("%s", error->message);
- g_error_free (error);
- }
-}
static void
perhaps_copy_to_local (const gchar *filename, const gchar *local_uri)
@@ -287,23 +246,7 @@
if (!filename)
return;
- as_uri = (gchar **) g_malloc0 (sizeof (gchar *) * 2);
- hints = (gchar **) g_malloc0 (sizeof (gchar *) * 2);
-
- as_uri[0] = g_strdup_printf ("file://%s", filename);
- hints[0] = g_strdup ("image/jpeg");
-
- dbus_g_proxy_begin_call (get_thumb_requester (),
- "Queue",
- thumbnail_generic_cb,
- NULL, NULL,
- G_TYPE_STRV, as_uri,
- G_TYPE_STRV, hints,
- G_TYPE_UINT, 0,
- G_TYPE_INVALID);
-
- g_strfreev (as_uri);
- g_strfreev (hints);
+ tracker_thumbnailer_get_file_thumbnail (filename, "image/jpeg");
if (!local_uri)
return;
Modified: trunk/src/tracker-indexer/Makefile.am
==============================================================================
--- trunk/src/tracker-indexer/Makefile.am (original)
+++ trunk/src/tracker-indexer/Makefile.am Tue Nov 25 14:42:26 2008
@@ -39,9 +39,7 @@
tracker-indexer-module.c \
tracker-indexer-module.h \
tracker-main.c \
- tracker-marshal-main.c \
- tracker-thumbnailer.c \
- tracker-thumbnailer.h
+ tracker-marshal-main.c
tracker_indexer_LDADD = \
libtracker-indexer.la \
Modified: trunk/src/tracker-indexer/tracker-dbus.c
==============================================================================
--- trunk/src/tracker-indexer/tracker-dbus.c (original)
+++ trunk/src/tracker-indexer/tracker-dbus.c Tue Nov 25 14:42:26 2008
@@ -27,17 +27,8 @@
#include "tracker-indexer.h"
#include "tracker-indexer-glue.h"
-#define THUMBNAILER_SERVICE "org.freedesktop.thumbnailer"
-#define THUMBNAILER_PATH "/org/freedesktop/thumbnailer/Generic"
-#define THUMBNAILER_INTERFACE "org.freedesktop.thumbnailer.Generic"
-
-#define THUMBMAN_PATH "/org/freedesktop/thumbnailer/Manager"
-#define THUMBMAN_INTERFACE "org.freedesktop.thumbnailer.Manager"
-
static DBusGConnection *connection;
static DBusGProxy *proxy;
-static DBusGProxy *thumb_proxy;
-static DBusGProxy *thumbm_proxy;
static gboolean
dbus_register_service (DBusGProxy *proxy,
@@ -111,18 +102,6 @@
return TRUE;
}
-DBusGProxy*
-tracker_dbus_get_thumbnailer (void)
-{
- return thumb_proxy;
-}
-
-DBusGProxy*
-tracker_dbus_get_thumb_manager (void)
-{
- return thumbm_proxy;
-}
-
static gboolean
dbus_register_names (void)
{
@@ -160,15 +139,6 @@
return FALSE;
}
- thumb_proxy = dbus_g_proxy_new_for_name (connection,
- THUMBNAILER_SERVICE,
- THUMBNAILER_PATH,
- THUMBNAILER_INTERFACE);
-
- thumbm_proxy = dbus_g_proxy_new_for_name (connection,
- THUMBNAILER_SERVICE,
- THUMBMAN_PATH,
- THUMBMAN_INTERFACE);
return TRUE;
}
Modified: trunk/src/tracker-indexer/tracker-indexer.c
==============================================================================
--- trunk/src/tracker-indexer/tracker-indexer.c (original)
+++ trunk/src/tracker-indexer/tracker-indexer.c Tue Nov 25 14:42:26 2008
@@ -63,6 +63,7 @@
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-module-config.h>
#include <libtracker-common/tracker-utils.h>
+#include <libtracker-common/tracker-thumbnailer.h>
#include <libtracker-db/tracker-db-manager.h>
#include <libtracker-db/tracker-db-index-manager.h>
@@ -74,7 +75,6 @@
#include "tracker-indexer.h"
#include "tracker-indexer-module.h"
#include "tracker-marshal.h"
-#include "tracker-thumbnailer.h"
#define TRACKER_INDEXER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_INDEXER, TrackerIndexerPrivate))
Modified: trunk/src/tracker-indexer/tracker-main.c
==============================================================================
--- trunk/src/tracker-indexer/tracker-main.c (original)
+++ trunk/src/tracker-indexer/tracker-main.c Tue Nov 25 14:42:26 2008
@@ -37,6 +37,7 @@
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-module-config.h>
#include <libtracker-common/tracker-file-utils.h>
+#include <libtracker-common/tracker-thumbnailer.h>
#include <libtracker-db/tracker-db-manager.h>
#include <libtracker-db/tracker-db-index-manager.h>
@@ -45,7 +46,6 @@
#include "tracker-dbus.h"
#include "tracker-indexer.h"
-#include "tracker-thumbnailer.h"
#define ABOUT \
"Tracker " PACKAGE_VERSION "\n" \
Modified: trunk/src/tracker-indexer/tracker-metadata-utils.c
==============================================================================
--- trunk/src/tracker-indexer/tracker-metadata-utils.c (original)
+++ trunk/src/tracker-indexer/tracker-metadata-utils.c Tue Nov 25 14:42:26 2008
@@ -29,9 +29,9 @@
#include <libtracker-common/tracker-type-utils.h>
#include <libtracker-common/tracker-os-dependant.h>
#include <libtracker-common/tracker-ontology.h>
+#include <libtracker-common/tracker-thumbnailer.h>
#include "tracker-metadata-utils.h"
-#include "tracker-thumbnailer.h"
#define METADATA_FILE_NAME_DELIMITED "File:NameDelimited"
#define METADATA_FILE_EXT "File:Ext"
Modified: trunk/src/trackerd/Makefile.am
==============================================================================
--- trunk/src/trackerd/Makefile.am (original)
+++ trunk/src/trackerd/Makefile.am Tue Nov 25 14:42:26 2008
@@ -61,7 +61,9 @@
tracker-xesam-session.c \
tracker-xesam-session.h \
tracker-xesam-live-search.c \
- tracker-xesam-live-search.h
+ tracker-xesam-live-search.h \
+ tracker-cleanup.c \
+ tracker-cleanup.h
if OS_WIN32
trackerd_win_libs = -lws2_32 -lkernel32
Modified: trunk/src/trackerd/tracker-main.c
==============================================================================
--- trunk/src/trackerd/tracker-main.c (original)
+++ trunk/src/trackerd/tracker-main.c Tue Nov 25 14:42:26 2008
@@ -60,6 +60,7 @@
#include "tracker-processor.h"
#include "tracker-status.h"
#include "tracker-xesam-manager.h"
+#include "tracker-cleanup.h"
#ifdef G_OS_WIN32
#include <windows.h>
@@ -984,6 +985,7 @@
tracker_data_manager_init (config, language, file_index, email_index);
tracker_xesam_manager_init ();
+ tracker_cleanup_init ();
#ifdef HAVE_HAL
/* We set up the throttle and mount points here. For the mount
@@ -1071,6 +1073,7 @@
shutdown_directories ();
/* Shutdown major subsystems */
+ tracker_cleanup_shutdown ();
tracker_xesam_manager_shutdown ();
tracker_dbus_shutdown ();
tracker_db_manager_shutdown ();
Modified: trunk/tests/tracker-indexer/Makefile.am
==============================================================================
--- trunk/tests/tracker-indexer/Makefile.am (original)
+++ trunk/tests/tracker-indexer/Makefile.am Tue Nov 25 14:42:26 2008
@@ -34,9 +34,7 @@
tracker-module-file.c \
tracker-module-file.h \
tracker-module-iteratable.c \
- tracker-module-iteratable.h \
- tracker-thumbnailer.c \
- tracker-thumbnailer.h
+ tracker-module-iteratable.h
tracker_metadata_utils_LDADD = \
$(top_builddir)/src/libtracker-data/libtracker-data.la \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]