[gthumb] ignore XDG_CACHE_HOME/thumbnails when saving thumbnails
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] ignore XDG_CACHE_HOME/thumbnails when saving thumbnails
- Date: Thu, 2 Aug 2012 12:33:33 +0000 (UTC)
commit 7424a80fff13b0e11028aaa1bba18e511fbf34df
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat May 5 15:40:02 2012 +0200
ignore XDG_CACHE_HOME/thumbnails when saving thumbnails
gthumb/gth-thumb-loader.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/gthumb/gth-thumb-loader.c b/gthumb/gth-thumb-loader.c
index da291d9..aa7f0a3 100644
--- a/gthumb/gth-thumb-loader.c
+++ b/gthumb/gth-thumb-loader.c
@@ -462,13 +462,21 @@ cache_image_ready_cb (GObject *source_object,
static gboolean
is_a_cache_file (const char *uri)
{
- char *cache_base_uri;
+ char *filename;
+ char *cache_dir_1;
+ char *cache_dir_2;
gboolean result;
- cache_base_uri = g_strconcat (get_home_uri (), "/.thumbnails", NULL);
- result = _g_uri_parent_of_uri (cache_base_uri, uri);
+ filename = g_filename_from_uri (uri, NULL, NULL);
+ if (filename == NULL)
+ return FALSE;
+
+ cache_dir_1 = g_build_filename (g_get_home_dir (), ".thumbnails", NULL);
+ cache_dir_2 = g_build_filename (g_get_user_cache_dir (), "thumbnails", NULL);
+ result = _g_uri_parent_of_uri (cache_dir_1, filename) || _g_uri_parent_of_uri (cache_dir_2, filename);
- g_free (cache_base_uri);
+ g_free (cache_dir_1);
+ g_free (cache_dir_2);
return result;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]