aboutsummaryrefslogtreecommitdiff
path: root/libsylph/folder.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-05-11 08:34:14 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-05-11 08:34:14 +0000
commit272a838e68d47ee269273c7b1e309279187e465b (patch)
tree36c62de34037601b04f7810baf632f2d4ef82653 /libsylph/folder.c
parentf55b0c5e30c04f7b6630f3d860e8ef2901a72b6c (diff)
qsearch_cond_type now persists between sessions.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1691 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/folder.c')
-rw-r--r--libsylph/folder.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libsylph/folder.c b/libsylph/folder.c
index 0837c17c..6527c848 100644
--- a/libsylph/folder.c
+++ b/libsylph/folder.c
@@ -1251,6 +1251,7 @@ static gboolean folder_build_tree(GNode *node, gpointer data)
threaded = TRUE, ac_apply_sub = FALSE;
FolderSortKey sort_key = SORT_BY_NONE;
FolderSortType sort_type = SORT_ASCENDING;
+ gboolean qsearch_cond_type = 0;
gint new = 0, unread = 0, total = 0;
time_t mtime = 0;
gboolean use_auto_to_on_reply = FALSE;
@@ -1346,6 +1347,21 @@ static gboolean folder_build_tree(GNode *node, gpointer data)
sort_type = SORT_ASCENDING;
else
sort_type = SORT_DESCENDING;
+ } else if (!strcmp(attr->name, "qsearch_cond")) {
+ if (!strcmp(attr->value, "all"))
+ qsearch_cond_type = 0;
+ else if (!strcmp(attr->value, "unread"))
+ qsearch_cond_type = 1;
+ else if (!strcmp(attr->value, "mark"))
+ qsearch_cond_type = 2;
+ else if (!strcmp(attr->value, "clabel"))
+ qsearch_cond_type = 3;
+ else if (!strcmp(attr->value, "mime"))
+ qsearch_cond_type = 4;
+ else if (!strcmp(attr->value, "w1day"))
+ qsearch_cond_type = 5;
+ else if (!strcmp(attr->value, "last5"))
+ qsearch_cond_type = 6;
} else if (!strcmp(attr->name, "account_id")) {
account = account_find_from_id(atoi(attr->value));
if (!account) g_warning("account_id: %s not found\n",
@@ -1405,6 +1421,7 @@ static gboolean folder_build_tree(GNode *node, gpointer data)
item->auto_replyto = auto_replyto;
item->trim_summary_subject = trim_summary_subject;
item->trim_compose_subject = trim_compose_subject;
+ item->qsearch_cond_type = qsearch_cond_type;
node->data = item;
xml_free_node(xmlnode);
@@ -1521,6 +1538,8 @@ static void folder_write_list_recursive(GNode *node, gpointer data)
"thread-date",
"from", "subject", "score", "label",
"mark", "unread", "mime", "to"};
+ static gchar *qsearch_cond_str[] = {"all", "unread", "mark", "clabel",
+ "mime", "w1day", "last5"};
g_return_if_fail(node != NULL);
g_return_if_fail(fp != NULL);
@@ -1578,6 +1597,11 @@ static void folder_write_list_recursive(GNode *node, gpointer data)
else
fprintf(fp, " sort_type=\"descending\"");
}
+ if (item->qsearch_cond_type > 0 &&
+ item->qsearch_cond_type < 7) {
+ fprintf(fp, " qsearch_cond=\"%s\"",
+ qsearch_cond_str[item->qsearch_cond_type]);
+ }
fprintf(fp,
" mtime=\"%lu\" new=\"%d\" unread=\"%d\" total=\"%d\"",