[baobab] Chart: fix resetting root when changing model



commit e9b345b6cba77063f27682f8bc021eda47a89ff5
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Thu Jun 13 15:20:48 2013 +0200

    Chart: fix resetting root when changing model
    
    Also, avoid shadowing a variable

 src/baobab-chart.vala |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/baobab-chart.vala b/src/baobab-chart.vala
index b2ec662..c293e55 100644
--- a/src/baobab-chart.vala
+++ b/src/baobab-chart.vala
@@ -118,10 +118,10 @@ namespace Baobab {
                                             uint          info_column_,
                                             uint          percentage_column_,
                                             uint          valid_column_,
-                                            Gtk.TreePath? root_) {
+                                            Gtk.TreePath? r) {
             model = m;
-            if (root_ != null) {
-                root = root_;
+            if (r != null) {
+                root = r;
             }
 
             name_column = name_column_;
@@ -136,7 +136,7 @@ namespace Baobab {
             set {
                 if (root_ != null) {
                     var current_root = root_.get_path ();
-                    if (current_root != null && current_root.compare (value) == 0) {
+                    if (current_root != null && value != null && current_root.compare (value) == 0) {
                         return;
                     }
                 } else if (value == null) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]