[Xfce4-commits] <tumbler:jannis/specialized> Add gboolean tumbler_thumbnailer_supports_hash_key(...) function.
Jannis Pohlmann
noreply at xfce.org
Wed Nov 11 01:52:04 CET 2009
Updating branch refs/heads/jannis/specialized
to 7aa64ca08d6a6515477963975f6cb8d5c47b07e4 (commit)
from 5e44e44cfc4e51b14d03958fbebcbbe1c73be20c (commit)
commit 7aa64ca08d6a6515477963975f6cb8d5c47b07e4
Author: Jannis Pohlmann <jannis at xfce.org>
Date: Wed Nov 11 01:49:28 2009 +0100
Add gboolean tumbler_thumbnailer_supports_hash_key(...) function.
tumbler/tumbler-thumbnailer.c | 22 ++++++++++++++++++++++
tumbler/tumbler-thumbnailer.h | 30 ++++++++++++++++--------------
2 files changed, 38 insertions(+), 14 deletions(-)
diff --git a/tumbler/tumbler-thumbnailer.c b/tumbler/tumbler-thumbnailer.c
index 3ab45c3..d40c1b8 100644
--- a/tumbler/tumbler-thumbnailer.c
+++ b/tumbler/tumbler-thumbnailer.c
@@ -191,6 +191,28 @@ tumbler_thumbnailer_get_uri_schemes (TumblerThumbnailer *thumbnailer)
+gboolean
+tumbler_thumbnailer_supports_hash_key (TumblerThumbnailer *thumbnailer,
+ const gchar *hash_key)
+{
+ gboolean supported = FALSE;
+ GStrv hash_keys;
+ guint n;
+
+ g_return_val_if_fail (TUMBLER_IS_THUMBNAILER (thumbnailer), FALSE);
+ g_return_val_if_fail (hash_key != NULL && *hash_key != '\0', FALSE);
+
+ hash_keys = tumbler_thumbnailer_get_hash_keys (thumbnailer);
+
+ for (n = 0; !supported && hash_keys != NULL && hash_keys[n] != NULL; ++n)
+ if (g_strcmp0 (hash_keys[n], hash_key) == 0)
+ supported = TRUE;
+
+ return supported;
+}
+
+
+
TumblerThumbnailer **
tumbler_thumbnailer_array_copy (TumblerThumbnailer **thumbnailers,
guint length)
diff --git a/tumbler/tumbler-thumbnailer.h b/tumbler/tumbler-thumbnailer.h
index 9194fe4..36adf6d 100644
--- a/tumbler/tumbler-thumbnailer.h
+++ b/tumbler/tumbler-thumbnailer.h
@@ -54,25 +54,27 @@ struct _TumblerThumbnailerIface
void (*unregister) (TumblerThumbnailer *thumbnailer);
/* virtual methods */
- void (*create) (TumblerThumbnailer *thumbnailer,
- GCancellable *cancellable,
- TumblerFileInfo *info);
+ void (*create) (TumblerThumbnailer *thumbnailer,
+ GCancellable *cancellable,
+ TumblerFileInfo *info);
};
-GType tumbler_thumbnailer_get_type (void) G_GNUC_CONST;
+GType tumbler_thumbnailer_get_type (void) G_GNUC_CONST;
-void tumbler_thumbnailer_create (TumblerThumbnailer *thumbnailer,
- GCancellable *cancellable,
- TumblerFileInfo *info);
+void tumbler_thumbnailer_create (TumblerThumbnailer *thumbnailer,
+ GCancellable *cancellable,
+ TumblerFileInfo *info);
-GStrv tumbler_thumbnailer_get_hash_keys (TumblerThumbnailer *thumbnailer);
-GStrv tumbler_thumbnailer_get_mime_types (TumblerThumbnailer *thumbnailer);
-GStrv tumbler_thumbnailer_get_uri_schemes (TumblerThumbnailer *thumbnailer);
+GStrv tumbler_thumbnailer_get_hash_keys (TumblerThumbnailer *thumbnailer);
+GStrv tumbler_thumbnailer_get_mime_types (TumblerThumbnailer *thumbnailer);
+GStrv tumbler_thumbnailer_get_uri_schemes (TumblerThumbnailer *thumbnailer);
+gboolean tumbler_thumbnailer_supports_hash_key (TumblerThumbnailer *thumbnailer,
+ const gchar *hash_key);
-TumblerThumbnailer **tumbler_thumbnailer_array_copy (TumblerThumbnailer **thumbnailers,
- guint length);
-void tumbler_thumbnailer_array_free (TumblerThumbnailer **thumbnailers,
- guint length);
+TumblerThumbnailer **tumbler_thumbnailer_array_copy (TumblerThumbnailer **thumbnailers,
+ guint length);
+void tumbler_thumbnailer_array_free (TumblerThumbnailer **thumbnailers,
+ guint length);
G_END_DECLS
More information about the Xfce4-commits
mailing list