aboutsummaryrefslogtreecommitdiff
path: root/src/folderview.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-12-20 05:47:26 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-12-20 05:47:26 +0000
commit3e66a3c4823b6996d8b52ddd02d0b2d70fdd2d81 (patch)
tree1054dcebe1e77b9c9f5066208d4e95670cfed98f /src/folderview.c
parent540cd9762e9ab2e975559478e67a7a4facc0a138 (diff)
reflect display_folder_unread setting immediately.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@843 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/folderview.c')
-rw-r--r--src/folderview.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/folderview.c b/src/folderview.c
index 50b8ef10..52184244 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -120,6 +120,7 @@ static void folderview_append_folder (FolderView *folderview,
static void folderview_update_row (FolderView *folderview,
GtkTreeIter *iter);
+static void folderview_update_row_all (FolderView *folderview);
static gint folderview_folder_name_compare (GtkTreeModel *model,
GtkTreeIter *a,
@@ -496,6 +497,8 @@ FolderView *folderview_create(void)
folderview->news_popup = news_popup;
folderview->news_factory = news_factory;
+ folderview->display_folder_unread = prefs_common.display_folder_unread;
+
folderview_set_columns(folderview);
gtk_widget_show_all(scrolledwin);
@@ -523,6 +526,12 @@ void folderview_init(FolderView *folderview)
void folderview_reflect_prefs(FolderView *folderview)
{
folderview_set_columns(folderview);
+ if (folderview->display_folder_unread !=
+ prefs_common.display_folder_unread) {
+ folderview->display_folder_unread =
+ prefs_common.display_folder_unread;
+ folderview_update_row_all(folderview);
+ }
}
FolderView *folderview_get(void)
@@ -1227,13 +1236,13 @@ static void folderview_update_row(FolderView *folderview, GtkTreeIter *iter)
gtk_tree_path_free(path);
if (item->stype == F_QUEUE && item->total > 0 &&
- prefs_common.display_folder_unread) {
+ folderview->display_folder_unread) {
str = g_strdup_printf("%s (%d%s)", name, item->total,
add_unread_mark ? "+" : "");
g_free(name);
name = str;
} else if ((item->unread > 0 || add_unread_mark) &&
- prefs_common.display_folder_unread) {
+ folderview->display_folder_unread) {
if (item->unread > 0)
str = g_strdup_printf("%s (%d%s)", name, item->unread,
add_unread_mark ? "+" : "");
@@ -1294,6 +1303,20 @@ static void folderview_update_row(FolderView *folderview, GtkTreeIter *iter)
folderview_update_row(folderview, &parent);
}
+static void folderview_update_row_all(FolderView *folderview)
+{
+ GtkTreeModel *model = GTK_TREE_MODEL(folderview->store);
+ GtkTreeIter iter;
+ gboolean valid;
+
+ valid = gtk_tree_model_get_iter_first(model, &iter);
+
+ while (valid) {
+ folderview_update_row(folderview, &iter);
+ valid = gtkut_tree_model_next(model, &iter);
+ }
+}
+
void folderview_update_item(FolderItem *item, gboolean update_summary)
{
FolderView *folderview;