/*
- * Geeqie
- * (C) 2006 John Ellis
- * Copyright (C) 2008 - 2012 The Geeqie Team
+ * Copyright (C) 2006 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 "filefilter.h"
static FilterEntry *filter_entry_new(const gchar *key, const gchar *description,
- const gchar *extensions, FileFormatClass file_class,
+ const gchar *extensions, FileFormatClass file_class,
gboolean writable, gboolean allow_sidecar, gboolean enabled)
{
FilterEntry *fe;
{
if (fe->file_class == FORMAT_CLASS_UNKNOWN)
fe->file_class = file_class; /* for compatibility */
-
+
if (fe->writable && fe->allow_sidecar)
{
fe->writable = writable;
work = work->next;
name = gdk_pixbuf_format_get_name(format);
-
- if (strcmp(name, "Digital camera RAW") == 0)
+
+ if (strcmp(name, "Digital camera RAW") == 0)
{
DEBUG_1("Skipped '%s' from loader", name);
g_free(name);
continue;
}
-
+
desc = gdk_pixbuf_format_get_description(format);
extensions = gdk_pixbuf_format_get_extensions(format);
filter_add_if_missing("ico", "Icon file", ".ico;.cur", FORMAT_CLASS_IMAGE, TRUE, FALSE, FALSE);
filter_add_if_missing("ras", "Raster", ".ras", FORMAT_CLASS_IMAGE, TRUE, FALSE, FALSE);
filter_add_if_missing("svg", "Scalable Vector Graphics", ".svg", FORMAT_CLASS_IMAGE, TRUE, FALSE, FALSE);
-
+
/* special formats for stereo */
filter_add_if_missing("jps", "Stereo side-by-side jpeg", ".jps", FORMAT_CLASS_IMAGE, TRUE, FALSE, TRUE);
filter_add_if_missing("mpo", "Stereo multi-image jpeg", ".mpo", FORMAT_CLASS_IMAGE, FALSE, TRUE, TRUE);
-
+
/* non-image files that might be desirable to show */
filter_add_if_missing("xmp", "XMP sidecar", ".xmp", FORMAT_CLASS_META, TRUE, FALSE, TRUE);
filter_add_if_missing("gqv", GQ_APPNAME " image collection", GQ_COLLECTION_EXT, FORMAT_CLASS_META, FALSE, FALSE, TRUE);
p++;
l++;
}
-
+
ext = g_strndup(b, l);
-
+
if (g_ascii_strcasecmp(ext, "%image") == 0) file_class = FORMAT_CLASS_IMAGE;
else if (g_ascii_strcasecmp(ext, "%raw") == 0) file_class = FORMAT_CLASS_RAWIMAGE;
else if (g_ascii_strcasecmp(ext, "%meta") == 0) file_class = FORMAT_CLASS_META;
else if (g_ascii_strcasecmp(ext, "%unknown") == 0) file_class = FORMAT_CLASS_UNKNOWN;
-
- if (file_class == -1)
+
+ if (file_class == -1)
{
list = g_list_append(list, ext);
}
list = g_list_concat(list, string_list_copy(file_class_extension_list[file_class]));
g_free(ext);
}
-
+
if (*p == ';') p++;
}
{
gchar *sa = (gchar *)a;
gchar *sb = (gchar *)b;
-
+
gint len_a = strlen(sa);
gint len_b = strlen(sb);
-
+
if (len_a > len_b) return -1;
if (len_a < len_b) return 1;
return 0;
}
-
+
void filter_rebuild(void)
{
{
log_printf("WARNING: invalid file class %d\n", fe->file_class);
}
-
+
if (fe->writable)
{
ext = filter_to_list(fe->extensions);
ext = filter_to_list(fe->extensions);
if (ext) file_sidecar_list = g_list_concat(file_sidecar_list, ext);
}
-
+
}
}
log_printf("unknown attribute %s = %s\n", option, value);
}
if (fe.file_class >= FILE_FORMAT_CLASSES) fe.file_class = FORMAT_CLASS_UNKNOWN;
-
+
if (fe.key && fe.key[0] != 0)
{
old_fe = filter_get_by_key(fe.key);