aboutsummaryrefslogtreecommitdiffstats
path: root/smime
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-12-11 16:38:46 +0800
committerMilan Crha <mcrha@redhat.com>2012-12-11 16:38:46 +0800
commitc18043684137440e5853d5c952f89751148b6c24 (patch)
treebc1a01c9631ade43a4185e786c59504f7707f2d2 /smime
parent0aa0eb22c1fad3984cff700653acee603376510f (diff)
downloadgsoc2013-evolution-c18043684137440e5853d5c952f89751148b6c24.tar
gsoc2013-evolution-c18043684137440e5853d5c952f89751148b6c24.tar.gz
gsoc2013-evolution-c18043684137440e5853d5c952f89751148b6c24.tar.bz2
gsoc2013-evolution-c18043684137440e5853d5c952f89751148b6c24.tar.lz
gsoc2013-evolution-c18043684137440e5853d5c952f89751148b6c24.tar.xz
gsoc2013-evolution-c18043684137440e5853d5c952f89751148b6c24.tar.zst
gsoc2013-evolution-c18043684137440e5853d5c952f89751148b6c24.zip
Do not restore certificate manager columns when all are hidden
If all columns are hidden, then header of a GtkTreeView is also hidden, thus there is no way to show columns again, which results in empty Certificate Preferences view.
Diffstat (limited to 'smime')
-rw-r--r--smime/gui/certificate-manager.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c
index a48442f50b..548c9c7d79 100644
--- a/smime/gui/certificate-manager.c
+++ b/smime/gui/certificate-manager.c
@@ -254,13 +254,19 @@ load_treeview_state (GtkTreeView *treeview)
list = g_key_file_get_integer_list (keyfile, tree_name, "columns", &length, NULL);
if (list) {
+ gboolean all_hidden = TRUE;
+
if (length != (gtk_tree_model_get_n_columns (model) - 1)) {
g_debug ("%s: Unexpected number of columns in config file", G_STRFUNC);
g_free (list);
goto exit;
}
- for (i = 0; i < length; i++) {
+ for (i = 0; all_hidden && i < length; i++) {
+ all_hidden = list[i] == 0;
+ }
+
+ for (i = 0; !all_hidden && i < length; i++) {
GtkTreeViewColumn *column = gtk_tree_view_get_column (treeview, i);
if (list[i]) {
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);