From ae5d1fcdbd406efa945a9ff631991bc08b1fa31e Mon Sep 17 00:00:00 2001 From: Jannis Pohlmann Date: Tue, 27 Oct 2009 03:13:42 +0100 Subject: Massive refactoring to support flavors properly. Refactor the entire code to use TumblerFileInfo instead of separate URI/MIME/flavor arrays. We now support flavors which means that applications can request "normal" and "large" thumbnails and thus have more control over what is created. This simplifies the code in a lot of places. We now use a real GObject class called TumblerThumbnailFlavor instead of a fixed-size enum. Cache backends can return as many flavors as they want, each consisting of a name, a width and a height. As a consequence, we can also get rid of the configure flags to enable/disable normal, large and cropped thumbnails. The default cache plugin shipped with Tumbler only supports "normal" (128x128px) and "large" (256x256px). Optimize the code a little bit. We now load the TunarFileInfo and ThunarThumbnail only *once* for each URI instead of loading them once in the scheduler and again in thumbnailer plugins. This needs careful testing. I might have introduced a few memory leaks here and there, plus new bugs... you never know. --- tumblerd/tumbler-scheduler.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'tumblerd/tumbler-scheduler.h') diff --git a/tumblerd/tumbler-scheduler.h b/tumblerd/tumbler-scheduler.h index fca90b4..e9969e7 100644 --- a/tumblerd/tumbler-scheduler.h +++ b/tumblerd/tumbler-scheduler.h @@ -22,6 +22,7 @@ #define __TUMBLER_SCHEDULER_H__ #include + #include G_BEGIN_DECLS @@ -77,11 +78,9 @@ void tumbler_scheduler_emit_uri_error (TumblerSchedul TumblerSchedulerRequest *request, const gchar *uri, GError *error); -TumblerSchedulerRequest *tumbler_scheduler_request_new (const GStrv uris, - const GStrv mime_hints, +TumblerSchedulerRequest *tumbler_scheduler_request_new (TumblerFileInfo **infos, TumblerThumbnailer **thumbnailers, - gint length, - const gchar *flavor, + guint length, const gchar *origin); void tumbler_scheduler_request_free (TumblerSchedulerRequest *request); gint tumbler_scheduler_request_compare (gconstpointer a, @@ -94,14 +93,12 @@ struct _TumblerSchedulerRequest { TumblerThumbnailer **thumbnailers; TumblerScheduler *scheduler; + TumblerFileInfo **infos; + GCancellable **cancellables; gboolean dequeued; - GStrv mime_hints; - GStrv uris; guint handle; - gint length; - GCancellable **cancellables; gchar *origin; - gchar *flavor; + guint length; }; G_END_DECLS -- cgit v1.2.1