diff options
author | Stefano Karapetsas <[email protected]> | 2012-11-02 11:24:01 +0100 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-11-02 11:24:01 +0100 |
commit | fcede97471263b7f145ceeb988f569d4aa9129b8 (patch) | |
tree | feee7c7aecd9e7a6f2f31bc7177926c8e87f55ee | |
parent | a620d6cdacb44dd52b6453fbe6576ae6cded71b4 (diff) | |
download | mate-desktop-fcede97471263b7f145ceeb988f569d4aa9129b8.tar.bz2 mate-desktop-fcede97471263b7f145ceeb988f569d4aa9129b8.tar.xz |
fix thumbnails with glib >= 2.34
-rw-r--r-- | libmate-desktop/mate-desktop-thumbnail.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/libmate-desktop/mate-desktop-thumbnail.c b/libmate-desktop/mate-desktop-thumbnail.c index 8b45bab..83a6cec 100644 --- a/libmate-desktop/mate-desktop-thumbnail.c +++ b/libmate-desktop/mate-desktop-thumbnail.c @@ -525,8 +525,13 @@ mate_desktop_thumbnail_factory_lookup (MateDesktopThumbnailFactory *factory, file = g_strconcat (g_checksum_get_string (checksum), ".png", NULL); +#if GLIB_CHECK_VERSION (2, 34, 0) + path = g_build_filename (g_get_user_cache_dir (), + "thumbnails", +#else path = g_build_filename (g_get_home_dir (), ".thumbnails", +#endif (priv->size == MATE_DESKTOP_THUMBNAIL_SIZE_NORMAL)?"normal":"large", file, NULL); @@ -586,8 +591,13 @@ mate_desktop_thumbnail_factory_has_valid_failed_thumbnail (MateDesktopThumbnailF file = g_strconcat (g_checksum_get_string (checksum), ".png", NULL); +#if GLIB_CHECK_VERSION (2, 34, 0) + path = g_build_filename (g_get_user_cache_dir (), + "thumbnails/fail", +#else path = g_build_filename (g_get_home_dir (), ".thumbnails/fail", +#endif appname, file, NULL); @@ -924,12 +934,17 @@ make_thumbnail_dirs (MateDesktopThumbnailFactory *factory) res = FALSE; +#if GLIB_CHECK_VERSION (2, 34, 0) + thumbnail_dir = g_build_filename (g_get_user_cache_dir (), + "thumbnails", +#else thumbnail_dir = g_build_filename (g_get_home_dir (), ".thumbnails", +#endif NULL); if (!g_file_test (thumbnail_dir, G_FILE_TEST_IS_DIR)) { - g_mkdir (thumbnail_dir, 0700); + g_mkdir_with_parents (thumbnail_dir, 0700); res = TRUE; } @@ -958,12 +973,17 @@ make_thumbnail_fail_dirs (MateDesktopThumbnailFactory *factory) res = FALSE; +#if GLIB_CHECK_VERSION (2, 34, 0) + thumbnail_dir = g_build_filename (g_get_user_cache_dir (), + "thumbnails", +#else thumbnail_dir = g_build_filename (g_get_home_dir (), ".thumbnails", +#endif NULL); if (!g_file_test (thumbnail_dir, G_FILE_TEST_IS_DIR)) { - g_mkdir (thumbnail_dir, 0700); + g_mkdir_with_parents (thumbnail_dir, 0700); res = TRUE; } @@ -1032,8 +1052,13 @@ mate_desktop_thumbnail_factory_save_thumbnail (MateDesktopThumbnailFactory *fact file = g_strconcat (g_checksum_get_string (checksum), ".png", NULL); +#if GLIB_CHECK_VERSION (2, 34, 0) + path = g_build_filename (g_get_user_cache_dir (), + "thumbnails", +#else path = g_build_filename (g_get_home_dir (), ".thumbnails", +#endif (priv->size == MATE_DESKTOP_THUMBNAIL_SIZE_NORMAL)?"normal":"large", file, NULL); @@ -1136,8 +1161,13 @@ mate_desktop_thumbnail_factory_create_failed_thumbnail (MateDesktopThumbnailFact file = g_strconcat (g_checksum_get_string (checksum), ".png", NULL); +#if GLIB_CHECK_VERSION (2, 34, 0) + path = g_build_filename (g_get_user_cache_dir (), + "thumbnails/fail", +#else path = g_build_filename (g_get_home_dir (), ".thumbnails/fail", +#endif appname, file, NULL); @@ -1228,8 +1258,13 @@ mate_desktop_thumbnail_path_for_uri (const char *uri, file = g_strconcat (md5, ".png", NULL); g_free (md5); +#if GLIB_CHECK_VERSION (2, 34, 0) + path = g_build_filename (g_get_user_cache_dir (), + "thumbnails", +#else path = g_build_filename (g_get_home_dir (), ".thumbnails", +#endif (size == MATE_DESKTOP_THUMBNAIL_SIZE_NORMAL)?"normal":"large", file, NULL); |