From patchwork Thu Mar 29 00:30:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [bitbake-devel,6/6] lib/bb/ui/crumbs/hig: fix layers_changed test Date: Thu, 29 Mar 2012 00:30:27 -0000 From: Joshua Lock X-Patchwork-Id: 24779 Message-Id: <3c08dfa7077c07b126e8f0de887fc5a7f1a58bc7.1332980606.git.josh@linux.intel.com> To: bitbake-devel@lists.openembedded.org 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 --- 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 """