Thu Oct 19 07:23:37 2006 John Ellis <johne@verizon.net>
authorJohn Ellis <johne@verizon.net>
Thu, 19 Oct 2006 11:34:52 +0000 (11:34 +0000)
committerJohn Ellis <johne@verizon.net>
Thu, 19 Oct 2006 11:34:52 +0000 (11:34 +0000)
        * cache_maint.c, thumb_standard.[ch]: Use .thumblocal when saving
        local thumbnails as per the freedesktop.org thumbnail spec.
        * filelist.c: Add .thumblocal to list of ignored folders (those we
        never show user).
        * main.c: Fix bug in recent command line parser changes, a single
        folder on the command line was not processed by parse_out_relatives().

ChangeLog
src/cache_maint.c
src/filelist.c
src/main.c
src/thumb_standard.c
src/thumb_standard.h

index f1fef5f..08680e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Thu Oct 19 07:23:37 2006  John Ellis  <johne@verizon.net>
+
+       * cache_maint.c, thumb_standard.[ch]: Use .thumblocal when saving
+       local thumbnails as per the freedesktop.org thumbnail spec.
+       * filelist.c: Add .thumblocal to list of ignored folders (those we
+       never show user).
+       * main.c: Fix bug in recent command line parser changes, a single
+       folder on the command line was not processed by parse_out_relatives().
+
 Sun Oct 15 12:36:06 2006  John Ellis  <johne@verizon.net>
 
        * pan-view.c: For now, also display the full size image under the
index 8a3d387..133bee4 100644 (file)
@@ -995,19 +995,19 @@ static void cache_manager_standard_clean_start_cb(GenericDialog *gd, gpointer da
 
        gtk_progress_bar_set_text(GTK_PROGRESS_BAR(cd->progress), _("running..."));
 
-       path = g_strconcat(homedir(), "/", THUMB_FOLDER, "/", THUMB_FOLDER_NORMAL, NULL);
+       path = g_strconcat(homedir(), "/", THUMB_FOLDER_GLOBAL, "/", THUMB_FOLDER_NORMAL, NULL);
        list = NULL;
        path_list(path, &list, NULL);
        cd->list = list;
        g_free(path);
 
-       path = g_strconcat(homedir(), "/", THUMB_FOLDER, "/", THUMB_FOLDER_LARGE, NULL);
+       path = g_strconcat(homedir(), "/", THUMB_FOLDER_GLOBAL, "/", THUMB_FOLDER_LARGE, NULL);
        list = NULL;
        path_list(path, &list, NULL);
        cd->list = g_list_concat(cd->list, list);
        g_free(path);
 
-       path = g_strconcat(homedir(), "/", THUMB_FOLDER, "/", THUMB_FOLDER_FAIL, NULL);
+       path = g_strconcat(homedir(), "/", THUMB_FOLDER_GLOBAL, "/", THUMB_FOLDER_FAIL, NULL);
        list = NULL;
        path_list(path, &list, NULL);
        cd->list = g_list_concat(cd->list, list);
@@ -1195,7 +1195,7 @@ void cache_manager_show(void)
 
        group = pref_group_new(gd->vbox, FALSE, _("Shared thumbnail cache"), GTK_ORIENTATION_VERTICAL);
 
-       buf = g_strconcat(_("Location:"), " ", homedir(), "/", THUMB_FOLDER, NULL);
+       buf = g_strconcat(_("Location:"), " ", homedir(), "/", THUMB_FOLDER_GLOBAL, NULL);
        label = pref_label_new(group, buf);
        gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
        g_free(buf);
index c3bb235..1aa1ecd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * GQview
- * (C) 2004 John Ellis
+ * (C) 2006 John Ellis
  *
  * Author: John Ellis
  *
@@ -15,6 +15,7 @@
 
 #include "cache.h"
 #include "rcfile.h"
+#include "thumb_standard.h"
 #include "ui_fileops.h"
 
 
@@ -707,7 +708,8 @@ gint filelist_read(const gchar *path, GList **files, GList **dirs)
                                        if ((dirs) &&
                                            !(name[0] == '.' && (name[1] == '\0' || (name[1] == '.' && name[2] == '\0'))) &&
                                            strcmp(name, GQVIEW_CACHE_LOCAL_THUMB) != 0 &&
-                                           strcmp(name, GQVIEW_CACHE_LOCAL_METADATA) != 0)
+                                           strcmp(name, GQVIEW_CACHE_LOCAL_METADATA) != 0 &&
+                                           strcmp(name, THUMB_FOLDER_LOCAL) != 0)
                                                {
                                                dlist = g_list_prepend(dlist, file_data_new(filepath, &ent_sbuf));
                                                }
index 40c0e52..5dff9d4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * GQview
- * (C) 2004 John Ellis
+ * (C) 2006 John Ellis
  *
  * Author: John Ellis
  *
@@ -1056,6 +1056,8 @@ static void parse_command_line(int argc, char *argv[], gchar **path, gchar **fil
                {
                *path = first_dir;
                first_dir = NULL;
+
+               parse_out_relatives(*path);
                }
        g_free(first_dir);
 
index 7add80e..4f7a8be 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * GQview
- * (C) 2005 John Ellis
+ * (C) 2006 John Ellis
  *
  * Author: John Ellis
  *
@@ -145,12 +145,12 @@ static gchar *thumb_std_cache_path(const gchar *path, const gchar *uri, gint loc
                gchar *base;
 
                base = remove_level_from_path(path);
-               cache_base = g_strconcat(base, "/", THUMB_FOLDER, "/", cache_subfolder, NULL);
+               cache_base = g_strconcat(base, "/", THUMB_FOLDER_LOCAL, "/", cache_subfolder, NULL);
                g_free(base);
                }
        else
                {
-               cache_base = g_strconcat(homedir(), "/", THUMB_FOLDER, "/", cache_subfolder, NULL);
+               cache_base = g_strconcat(homedir(), "/", THUMB_FOLDER_GLOBAL, "/", cache_subfolder, NULL);
                }
 
        md5_get_digest((guchar *)uri, strlen(uri), digest);
@@ -169,16 +169,7 @@ static gchar *thumb_std_cache_path(const gchar *path, const gchar *uri, gint loc
 
 static gchar *thumb_loader_std_cache_path(ThumbLoaderStd *tl, gint local, GdkPixbuf *pixbuf, gint fail)
 {
-#if 0
-       gchar *result = NULL;
-       gchar *cache_base;
-#endif
        const gchar *folder_size;
-#if 0
-       const gchar *uri;
-       gchar *md5_text;
-       guchar digest[16];
-#endif
        gint w, h;
 
        if (!tl->source_path || !tl->thumb_uri) return NULL;
@@ -210,35 +201,6 @@ static gchar *thumb_loader_std_cache_path(ThumbLoaderStd *tl, gint local, GdkPix
        return thumb_std_cache_path(tl->source_path,
                                    (local) ?  tl->local_uri : tl->thumb_uri,
                                    local, folder_size);
-
-#if 0
-       if (local)
-               {
-               gchar *base;
-
-               base = remove_level_from_path(tl->source_path);
-               cache_base = g_strconcat(base, "/", THUMB_FOLDER, "/", folder_size, NULL);
-               g_free(base);
-               }
-       else
-               {
-               cache_base = g_strconcat(homedir(), "/", THUMB_FOLDER, "/", folder_size, NULL);
-               }
-
-       uri = (local) ? tl->local_uri : tl->thumb_uri;
-       md5_get_digest(uri, strlen(uri), digest);
-       md5_text = md5_digest_to_text(digest);
-
-       if (cache_base && md5_text)
-               {
-               result = g_strconcat(cache_base, "/", md5_text, THUMB_NAME_EXTENSION, NULL);
-               }
-
-       g_free(cache_base);
-       g_free(md5_text);
-
-       return result;
-#endif
 }
 
 static gint thumb_loader_std_fail_check(ThumbLoaderStd *tl)
@@ -700,7 +662,7 @@ gint thumb_loader_std_start(ThumbLoaderStd *tl, const gchar *path)
        tl->source_size = st.st_size;
        tl->source_mode = st.st_mode;
 
-       if (!thumb_cache) thumb_cache = g_strconcat(homedir(), "/", THUMB_FOLDER, NULL);
+       if (!thumb_cache) thumb_cache = g_strconcat(homedir(), "/", THUMB_FOLDER_GLOBAL, NULL);
        if (strncmp(tl->source_path, thumb_cache, strlen(thumb_cache)) != 0)
                {
                gchar *pathl;
index 840e341..8f4953b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * GQview
- * (C) 2005 John Ellis
+ * (C) 2006 John Ellis
  *
  * Author: John Ellis
  *
@@ -14,7 +14,8 @@
 #define THUMB_STANDARD_H
 
 
-#define THUMB_FOLDER        ".thumbnails"
+#define THUMB_FOLDER_GLOBAL ".thumbnails"
+#define THUMB_FOLDER_LOCAL  ".thumblocal"
 #define THUMB_FOLDER_NORMAL "normal"
 #define THUMB_FOLDER_LARGE  "large"
 #define THUMB_FOLDER_FAIL   "fail/gqview-1.0"