[maemo-commits] [maemo-commits] r18358 - in projects/haf/trunk/hildon-thumbnail: . daemon

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed May 13 17:18:00 EEST 2009
Author: pvanhoof
Date: 2009-05-13 17:17:58 +0300 (Wed, 13 May 2009)
New Revision: 18358

Modified:
   projects/haf/trunk/hildon-thumbnail/ChangeLog
   projects/haf/trunk/hildon-thumbnail/daemon/albumart.c
Log:
2009-05-13  Philip Van Hoof  <pvanhoof at codeminded.be>

        * daemon/albumart.c: Making thumbnails for downloaded albumart.
        Possibly fixes Bug# 114559 (needs verification)



Modified: projects/haf/trunk/hildon-thumbnail/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-thumbnail/ChangeLog	2009-05-13 14:11:04 UTC (rev 18357)
+++ projects/haf/trunk/hildon-thumbnail/ChangeLog	2009-05-13 14:17:58 UTC (rev 18358)
@@ -1,3 +1,8 @@
+2009-05-13  Philip Van Hoof  <pvanhoof at codeminded.be>
+
+        * daemon/albumart.c: Making thumbnails for downloaded albumart.
+	Possibly fixes Bug# 114559 (needs verification)
+
 2009-05-13  Marius Vollmer  <marius.vollmer at nokia.com>
 
 	Relased 3.0.25

Modified: projects/haf/trunk/hildon-thumbnail/daemon/albumart.c
===================================================================
--- projects/haf/trunk/hildon-thumbnail/daemon/albumart.c	2009-05-13 14:11:04 UTC (rev 18357)
+++ projects/haf/trunk/hildon-thumbnail/daemon/albumart.c	2009-05-13 14:17:58 UTC (rev 18358)
@@ -39,6 +39,7 @@
 #include "albumart-glue.h"
 #include "dbus-utils.h"
 #include "utils.h"
+#include "thumbnailer.h"
 
 #define ALBUMART_ERROR_DOMAIN	"HildonAlbumart"
 #define ALBUMART_ERROR		g_quark_from_static_string (ALBUMART_ERROR_DOMAIN)
@@ -83,6 +84,32 @@
 } WorkTask;
 
 
+
+static DBusGProxy*
+get_thumber (void)
+{
+	static DBusGProxy *proxy = NULL;
+
+	if (!proxy) {
+		GError          *error = NULL;
+		DBusGConnection *connection;
+
+		connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
+
+		if (!error) {
+			proxy = dbus_g_proxy_new_for_name (connection,
+								  THUMBNAILER_SERVICE,
+								  THUMBNAILER_PATH,
+								  THUMBNAILER_INTERFACE);
+		} else {
+			g_error_free (error);
+		}
+	}
+
+	return proxy;
+}
+
+
 static gint 
 pool_sort_compare (gconstpointer a, gconstpointer b, gpointer user_data)
 {
@@ -214,8 +241,24 @@
 					       0, task->num, 1, error->message);
 				g_clear_error (&error);
 			} else {
-					g_signal_emit (task->object, signals[READY_SIGNAL], 
-					       0, artist, album, kind, path);
+				gchar **uris = (gchar **) g_malloc0 (sizeof (gchar*) * 2);
+				const gchar *mimes[2] = { "image/jpeg", NULL };
+
+				uris[0] = g_filename_to_uri (path, NULL, NULL);
+				uris[1] = NULL;
+				
+				dbus_g_proxy_call_no_reply (get_thumber (),
+							    "Queue",
+							    G_TYPE_STRV, uris,
+							    G_TYPE_STRV, mimes,
+							    G_TYPE_UINT, 0,
+							    G_TYPE_INVALID,
+							    G_TYPE_INVALID);
+
+				g_signal_emit (task->object, signals[READY_SIGNAL], 
+				       0, artist, album, kind, path);
+
+				g_strfreev (uris);
 				handled = TRUE;
 			}
 


More information about the maemo-commits mailing list