summaryrefslogtreecommitdiff
path: root/tumbler/tumbler-abstract-thumbnailer.c
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis@xfce.org>2009-10-27 03:13:42 +0100
committerJannis Pohlmann <jannis@xfce.org>2009-10-27 03:13:42 +0100
commitae5d1fcdbd406efa945a9ff631991bc08b1fa31e (patch)
tree378f5aea375c541221a62fe6ed468c383d6c0dcc /tumbler/tumbler-abstract-thumbnailer.c
parent7a1e43d0806ec976eb2872209affb3d8a0dad7d0 (diff)
downloadtumbler-ae5d1fcdbd406efa945a9ff631991bc08b1fa31e.tar.gz
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.
Diffstat (limited to 'tumbler/tumbler-abstract-thumbnailer.c')
-rw-r--r--tumbler/tumbler-abstract-thumbnailer.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/tumbler/tumbler-abstract-thumbnailer.c b/tumbler/tumbler-abstract-thumbnailer.c
index 3497393..31a8f79 100644
--- a/tumbler/tumbler-abstract-thumbnailer.c
+++ b/tumbler/tumbler-abstract-thumbnailer.c
@@ -26,6 +26,7 @@
#include <glib-object.h>
#include <tumbler/tumbler-abstract-thumbnailer.h>
+#include <tumbler/tumbler-file-info.h>
#include <tumbler/tumbler-thumbnailer.h>
@@ -58,9 +59,7 @@ static void tumbler_abstract_thumbnailer_set_property (GObject
GParamSpec *pspec);
static void tumbler_abstract_thumbnailer_create (TumblerThumbnailer *thumbnailer,
GCancellable *cancellable,
- const gchar *uri,
- const gchar *mime_hint,
- const gchar *flavor);
+ TumblerFileInfo *info);
@@ -236,17 +235,12 @@ tumbler_abstract_thumbnailer_set_property (GObject *object,
static void
tumbler_abstract_thumbnailer_create (TumblerThumbnailer *thumbnailer,
GCancellable *cancellable,
- const gchar *uri,
- const gchar *mime_hint,
- const gchar *flavor)
+ TumblerFileInfo *info)
{
g_return_if_fail (TUMBLER_IS_ABSTRACT_THUMBNAILER (thumbnailer));
- g_return_if_fail (uri != NULL && *uri != '\0');
- g_return_if_fail (flavor != NULL && *flavor != '\0');
+ g_return_if_fail (TUMBLER_IS_FILE_INFO (info));
g_return_if_fail (TUMBLER_ABSTRACT_THUMBNAILER_GET_CLASS (thumbnailer)->create != NULL);
TUMBLER_ABSTRACT_THUMBNAILER_GET_CLASS (thumbnailer)->create (TUMBLER_ABSTRACT_THUMBNAILER (thumbnailer),
- cancellable, uri,
- mime_hint,
- flavor);
+ cancellable, info);
}