changeset 370:1eaea84877ce

save file_class to config file
author nadvornik
date Tue, 15 Apr 2008 16:57:30 +0000
parents 959b6fcdaa17
children 7997b6704fdb
files src/filelist.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/filelist.c	Tue Apr 15 07:16:51 2008 +0000
+++ b/src/filelist.c	Tue Apr 15 16:57:30 2008 +0000
@@ -378,9 +378,9 @@
 		gchar *extensions = escquote_value(fe->extensions);
 		gchar *description = escquote_value(fe->description);
 
-		secure_fprintf(ssi, "file_filter.ext: \"%s%s\" %s %s\n",
+		secure_fprintf(ssi, "file_filter.ext: \"%s%s\" %s %s %d\n",
 			       (fe->enabled) ? "" : "#",
-			       fe->key, extensions, description);
+			       fe->key, extensions, description, fe->file_class);
 		g_free(extensions);
 		g_free(description);
 		}
@@ -393,6 +393,7 @@
 	gchar *ext;
 	gchar *desc;
 	gint enabled = TRUE;
+	gint file_class;
 
 	if (!text || text[0] != '"') return;
 
@@ -401,6 +402,10 @@
 
 	ext = quoted_value(p, &p);
 	desc = quoted_value(p, &p);
+	
+	file_class = strtol(p, NULL, 10);
+	
+	if (file_class < 0 || file_class >= FILE_FORMAT_CLASSES) file_class = FORMAT_CLASS_UNKNOWN;
 
 	if (key && key[0] == '#')
 		{
@@ -412,7 +417,7 @@
 		enabled = FALSE;
 		}
 
-	if (key && strlen(key) > 0 && ext) filter_add(key, desc, ext, FORMAT_CLASS_UNKNOWN, enabled);
+	if (key && strlen(key) > 0 && ext) filter_add(key, desc, ext, file_class, enabled);
 
 	g_free(key);
 	g_free(ext);