]> spindle.queued.net Git - midori/commitdiff
Use sokoke_build_thumbnail_path importing from JSON
authorPaweł Forysiuk <tuxator@o2.pl>
Sun, 3 Apr 2011 21:16:26 +0000 (23:16 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 3 Apr 2011 21:16:26 +0000 (23:16 +0200)
midori/main.c

index 1a97d02c66c731e3c6c9156d5a6061784dcf4959..74571c632ef0a348341b27630d245accaa53de75 100644 (file)
@@ -1536,8 +1536,6 @@ speeddial_new_from_file (const gchar* config,
                 gsize sz;
                 gint state = 0;
                 guint save = 0;
-                gchar* checksum;
-                gchar* filename;
                 gchar* thumb_dir;
                 gchar* thumb_path;
                 gsize base64_size = strlen (val);
@@ -1545,15 +1543,11 @@ speeddial_new_from_file (const gchar* config,
 
                 sz = g_base64_decode_step (g_strdup (val), base64_size,
                                            decoded, &state, &save);
-                checksum = g_compute_checksum_for_string (G_CHECKSUM_MD5, slot, -1);
-                filename  = g_strdup_printf ("%s%s", checksum, ".png");
-                g_free (checksum);
                 thumb_dir = g_build_path (G_DIR_SEPARATOR_S, g_get_user_cache_dir (),
                                           PACKAGE_NAME, "thumbnails", NULL);
                 if (!g_file_test (thumb_dir, G_FILE_TEST_EXISTS))
                     katze_mkdir_with_parents (thumb_dir, 0700);
-                thumb_path = g_build_filename (thumb_dir, filename, NULL);
-                g_free (filename);
+                thumb_path = sokoke_build_thumbnail_path (slot);
                 g_file_set_contents (thumb_path, (gchar*)decoded, sz, NULL);
 
                 g_free (decoded);