diff options
| author | Jeremy Whiting <jpwhiting@kde.org> | 2014-08-06 15:26:36 -0600 |
|---|---|---|
| committer | Harald Judt <h.judt@gmx.at> | 2015-02-23 20:19:27 +0100 |
| commit | 69122ab380c7f4fc5cf69d5b1d597f588ea39bc4 (patch) | |
| tree | 795c8ea9dc05e3ff7aeade6b13e5504479252350 | |
| parent | 8786320590a1880f4d8b176d06ea535c9dc3f3b9 (diff) | |
| download | tumbler-69122ab380c7f4fc5cf69d5b1d597f588ea39bc4.tar.gz | |
Use $XDG_CACHE_HOME/thumbnails as per spec change Bug #10613
| -rw-r--r-- | plugins/xdg-cache/xdg-cache-cache.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/xdg-cache/xdg-cache-cache.c b/plugins/xdg-cache/xdg-cache-cache.c index 6c85523..3afe316 100644 --- a/plugins/xdg-cache/xdg-cache-cache.c +++ b/plugins/xdg-cache/xdg-cache-cache.c @@ -507,7 +507,7 @@ xdg_cache_cache_is_thumbnail (TumblerCache *cache, const gchar *uri) { XDGCacheCache *xdg_cache = XDG_CACHE_CACHE (cache); - const gchar *home; + const gchar *cachedir; const gchar *dirname; gboolean is_thumbnail = FALSE; GList *iter; @@ -520,9 +520,9 @@ xdg_cache_cache_is_thumbnail (TumblerCache *cache, for (iter = xdg_cache->flavors; !is_thumbnail && iter != NULL; iter = iter->next) { - home = xdg_cache_cache_get_home (); + cachedir = g_get_user_cache_dir (); dirname = tumbler_thumbnail_flavor_get_name (iter->data); - path = g_build_filename (home, ".thumbnails", dirname, NULL); + path = g_build_filename (cachedir, "thumbnails", dirname, NULL); flavor_dir = g_file_new_for_path (path); file = g_file_new_for_uri (uri); @@ -570,7 +570,7 @@ GFile * xdg_cache_cache_get_file (const gchar *uri, TumblerThumbnailFlavor *flavor) { - const gchar *home; + const gchar *cachedir; const gchar *dirname; GFile *file; gchar *filename; @@ -580,12 +580,12 @@ xdg_cache_cache_get_file (const gchar *uri, g_return_val_if_fail (uri != NULL && *uri != '\0', NULL); g_return_val_if_fail (TUMBLER_IS_THUMBNAIL_FLAVOR (flavor), NULL); - home = xdg_cache_cache_get_home (); + cachedir = g_get_user_cache_dir (); dirname = tumbler_thumbnail_flavor_get_name (flavor); md5_hash = g_compute_checksum_for_string (G_CHECKSUM_MD5, uri, -1); filename = g_strdup_printf ("%s.png", md5_hash); - path = g_build_filename (home, ".thumbnails", dirname, filename, NULL); + path = g_build_filename (cachedir, "thumbnails", dirname, filename, NULL); file = g_file_new_for_path (path); @@ -602,7 +602,7 @@ GFile * xdg_cache_cache_get_temp_file (const gchar *uri, TumblerThumbnailFlavor *flavor) { - const gchar *home; + const gchar *cachedir; const gchar *dirname; GTimeVal current_time = { 0, 0 }; GFile *file; @@ -613,7 +613,7 @@ xdg_cache_cache_get_temp_file (const gchar *uri, g_return_val_if_fail (uri != NULL && *uri != '\0', NULL); g_return_val_if_fail (TUMBLER_IS_THUMBNAIL_FLAVOR (flavor), NULL); - home = xdg_cache_cache_get_home (); + cachedir = g_get_user_cache_dir (); dirname = tumbler_thumbnail_flavor_get_name (flavor); g_get_current_time (¤t_time); @@ -621,7 +621,7 @@ xdg_cache_cache_get_temp_file (const gchar *uri, md5_hash = g_compute_checksum_for_string (G_CHECKSUM_MD5, uri, -1); filename = g_strdup_printf ("%s-%ld-%ld.png", md5_hash, current_time.tv_sec, current_time.tv_usec); - path = g_build_filename (home, ".thumbnails", dirname, filename, NULL); + path = g_build_filename (cachedir, "thumbnails", dirname, filename, NULL); file = g_file_new_for_path (path); |