Ref #559: Geeqie won't start if clutter fails to init
[geeqie.git] / src / cache.c
index 053d79f..fee9db9 100644 (file)
@@ -1,13 +1,22 @@
 /*
- * Geeqie
- * (C) 2004 John Ellis
- * Copyright (C) 2008 - 2012 The Geeqie Team
+ * Copyright (C) 2004 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
  *
  * Author: John Ellis
  *
- * This software is released under the GNU General Public License (GNU GPL).
- * Please read the included file COPYING for more information.
- * This software comes with no warranty of any kind, use at your own risk!
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include "main.h"
 
 #include "md5-util.h"
 #include "secure_save.h"
+#include "thumb_standard.h"
 #include "ui_fileops.h"
 
 #include <utime.h>
 #include <errno.h>
 
 
-/*
+/**
+ * @file
  *-------------------------------------------------------------------
  * Cache data file format:
  *-------------------------------------------------------------------
  *
- * SIMcache
- * #comment
- * Dimensions=[<width> x <height>]
- * Date=[<value in time_t format, or -1 if no embedded date>]
- * MD5sum=[<32 character ascii text digest>]
+ * SIMcache \n
+ * #comment \n
+ * Dimensions=[<width> x <height>] \n
+ * Date=[<value in time_t format, or -1 if no embedded date>] \n
+ * MD5sum=[<32 character ascii text digest>] \n
  * SimilarityGrid[32 x 32]=<3072 bytes of data (1024 pixels in RGB format, 1 pixel is 24bits)>
  *
- *
- * The first line (9 bytes) indicates it is a SIMcache format file. (new line char must exist)
- * Comment lines starting with a # are ignored up to a new line.
- * All data lines should end with a new line char.
- * Format is very strict, data must begin with the char immediately following '='.
- * Currently SimilarityGrid is always assumed to be 32 x 32 RGB.
+ * The first line (9 bytes) indicates it is a SIMcache format file. (new line char must exist) \n
+ * Comment lines starting with a # are ignored up to a new line. \n
+ * All data lines should end with a new line char. \n
+ * Format is very strict, data must begin with the char immediately following '='. \n
+ * Currently SimilarityGrid is always assumed to be 32 x 32 RGB. \n
  */
 
 
@@ -713,7 +723,8 @@ const gchar *get_thumbnails_cache_dir(void)
 
        if (USE_XDG)
                {
-               thumbnails_cache_dir = g_build_filename(xdg_cache_home_get(), GQ_APPNAME_LC, GQ_CACHE_THUMB, NULL);
+               thumbnails_cache_dir = g_build_filename(xdg_cache_home_get(),
+                                                               GQ_APPNAME_LC, GQ_CACHE_THUMB, NULL);
                }
        else
                {
@@ -723,6 +734,18 @@ const gchar *get_thumbnails_cache_dir(void)
        return thumbnails_cache_dir;
 }
 
+const gchar *get_thumbnails_standard_cache_dir(void)
+{
+       static gchar *thumbnails_standard_cache_dir = NULL;
+
+       if (thumbnails_standard_cache_dir) return thumbnails_standard_cache_dir;
+
+       thumbnails_standard_cache_dir = g_build_filename(xdg_cache_home_get(),
+                                                                               THUMB_FOLDER_GLOBAL, NULL);
+
+       return thumbnails_standard_cache_dir;
+}
+
 const gchar *get_metadata_cache_dir(void)
 {
        static gchar *metadata_cache_dir = NULL;