[bitbake-devel] [PATCH 6/6] lib/bb/ui/crumbs/hig: fix layers_changed test

Joshua Lock josh at linux.intel.com
Thu Mar 29 00:30:27 UTC 2012


Because we sort the treeview to list specific layers at the top, and
therefore implicitly change the sorting of the underlying model, we can't
be certain that the original layer list will equal the new layer list
despite the included layers being the same.

To ensure we can do a simple equality test to determine whether the layers
have been modified first sort the lists to ensure we're comparing based on
contents alone.

Signed-off-by: Joshua Lock <josh at linux.intel.com>
---
 lib/bb/ui/crumbs/hig.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/lib/bb/ui/crumbs/hig.py b/lib/bb/ui/crumbs/hig.py
index 0ea5c0d..62a4e4e 100644
--- a/lib/bb/ui/crumbs/hig.py
+++ b/lib/bb/ui/crumbs/hig.py
@@ -952,7 +952,10 @@ class LayerSelectionDialog (CrumbsDialog):
             layers.append(model.get_value(it, 0))
             it = model.iter_next(it)
 
-        self.layers_changed = (self.layers != layers)
+        orig_layers = sorted(self.layers)
+        layers.sort()
+
+        self.layers_changed = (orig_layers != layers)
         self.layers = layers
 
     """
-- 
1.7.7.6





More information about the bitbake-devel mailing list