diff options
author | Gaël Bonithon <gael@xfce.org> | 2021-12-29 10:48:14 +0100 |
---|---|---|
committer | Gaël Bonithon <gael@xfce.org> | 2021-12-29 13:09:43 +0100 |
commit | 7fdab65f7a2144a7cae4d49bea13cea3644dfc3c (patch) | |
tree | 8bf0045d59c05be0f26d78ffb4756e4e9ddfa997 /tumbler/tumbler-util.c | |
parent | 270289b3a3f2f9ac7891f26135bae6d5e574c868 (diff) | |
download | tumbler-7fdab65f7a2144a7cae4d49bea13cea3644dfc3c.tar.gz |
desktop-thumbnailer: Allow to override configuration in desktop files
The "X-Tumbler Settings" group is searched in each desktop file with the
same keys as in `tumbler.rc`, where the default configuration is now.
Closes #52.
Diffstat (limited to 'tumbler/tumbler-util.c')
-rw-r--r-- | tumbler/tumbler-util.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tumbler/tumbler-util.c b/tumbler/tumbler-util.c index 4e8f718..453e131 100644 --- a/tumbler/tumbler-util.c +++ b/tumbler/tumbler-util.c @@ -35,6 +35,8 @@ #include <tumbler/tumbler-util.h> +#include <libxfce4util/libxfce4util.h> + /* Float block size used in the stat struct */ #define TUMBLER_STAT_BLKSIZE 512. @@ -222,6 +224,28 @@ tumbler_util_get_settings (void) +GSList * +tumbler_util_locations_from_strv (gchar **array) +{ + GSList *locations = NULL; + guint n; + gchar *path; + + if (array == NULL) + return NULL; + + for (n = 0; array[n] != NULL; n++) + { + path = xfce_expand_variables (array[n], NULL); + locations = g_slist_prepend (locations, g_file_new_for_commandline_arg (path)); + g_free (path); + } + + return locations; +} + + + GList * tumbler_util_get_thumbnailer_dirs (void) { @@ -374,3 +398,12 @@ tumbler_util_scale_pixbuf (GdkPixbuf *source, return gdk_pixbuf_scale_simple (source, MAX (dest_width, 1), MAX (dest_height, 1), GDK_INTERP_BILINEAR); } + + + +gpointer +tumbler_util_object_ref (gconstpointer src, + gpointer data) +{ + return g_object_ref ((gpointer) src); +} |