# HG changeset patch # User nadvornik # Date 1208278650 0 # Node ID 1eaea84877cebcf93d6feb090d38d39a8ba0dd04 # Parent 959b6fcdaa17f40ea0700f57f3593c0ca00cb4c7 save file_class to config file diff -r 959b6fcdaa17 -r 1eaea84877ce src/filelist.c --- 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);