diff options
author | monsta <[email protected]> | 2016-03-02 14:44:15 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-03-02 14:49:11 +0300 |
commit | e44f2e847ddb5db5b6944f6c2f993981adbd3ad4 (patch) | |
tree | 871df644b8dbd6d4861d42421e1b03790ff3c490 /src/procman.cpp | |
parent | 2e5e07b81f18fa4b3cfa8dfdbb08d716d58845ce (diff) | |
download | mate-system-monitor-e44f2e847ddb5db5b6944f6c2f993981adbd3ad4.tar.bz2 mate-system-monitor-e44f2e847ddb5db5b6944f6c2f993981adbd3ad4.tar.xz |
disks: implement saving and loading width and visibility of columns
adapted from
https://git.gnome.org/browse/gnome-system-monitor/commit/?id=f589439a966151b2589bca21a4d6b40455eb201a
with necessary changes from https://github.com/mate-desktop/mate-system-monitor/commit/eebc190a5aeb6ebaf5c3a868b68434679adddc74
Diffstat (limited to 'src/procman.cpp')
-rw-r--r-- | src/procman.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/procman.cpp b/src/procman.cpp index b9343eb..ea50cb2 100644 --- a/src/procman.cpp +++ b/src/procman.cpp @@ -399,7 +399,8 @@ procman_get_tree_state (GSettings *settings, GtkWidget *tree, const gchar *child columns = gtk_tree_view_get_columns (GTK_TREE_VIEW (tree)); - if(!g_strcmp0(child_schema, "proctree")) + if (g_strcmp0(child_schema, "proctree") == 0 || + g_strcmp0(child_schema, "disktreenew") == 0) { for (it = columns; it; it = it->next) { @@ -421,19 +422,17 @@ procman_get_tree_state (GSettings *settings, GtkWidget *tree, const gchar *child g_free (key); column = gtk_tree_view_get_column (GTK_TREE_VIEW (tree), id); - if(!column) continue; - gtk_tree_view_column_set_visible (column, visible); - if (visible) { - /* ensure column is really visible */ - width = MAX(width, 20); - gtk_tree_view_column_set_fixed_width(column, width); - } - } - } + if (column == NULL) + continue; + + gtk_tree_view_column_set_visible (column, visible); + if (visible) { + /* ensure column is really visible */ + width = MAX(width, 20); + gtk_tree_view_column_set_fixed_width(column, width); + } + } - if(!g_strcmp0(child_schema, "proctree") || - !g_strcmp0(child_schema, "disktreenew")) - { GVariant *value; GVariantIter iter; int sortIndex; |