From 9cf5190679f372da212cbbbf85e27b9ea6a395f4 Mon Sep 17 00:00:00 2001 From: Joshua Lock Date: Fri, 22 Jul 2011 11:32:27 -0700 Subject: hob: only add new layer's to the UI If a user added the same layer more than once the underlying bblayers.conf file would not have multiple entries but the UI would show an entry for the layer for each time it was added. This patch changes the Configurator to return None values if the layer wasn't added to bblayers.conf and the LayerEditor to only update the UI if non-None values are returned. Fixes [YOCTO #1275] (Bitbake rev: 9c59baa4da3c863ebc412a56ffd8dbd7a8ffeb60) Signed-off-by: Joshua Lock Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/configurator.py | 4 +++- bitbake/lib/bb/ui/crumbs/layereditor.py | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'bitbake/lib/bb') diff --git a/bitbake/lib/bb/ui/crumbs/configurator.py b/bitbake/lib/bb/ui/crumbs/configurator.py index 551179950a..e7c524afce 100644 --- a/bitbake/lib/bb/ui/crumbs/configurator.py +++ b/bitbake/lib/bb/ui/crumbs/configurator.py @@ -139,7 +139,9 @@ class Configurator(gobject.GObject): name = self._getLayerName(layerpath) if name not in self.enabled_layers: self.addLayer(name, layerpath) - return name, layerpath + return name, layerpath + else: + return None, None def addLayer(self, name, path): self.enabled_layers[name] = path diff --git a/bitbake/lib/bb/ui/crumbs/layereditor.py b/bitbake/lib/bb/ui/crumbs/layereditor.py index 76a2eb536f..7c581d642f 100644 --- a/bitbake/lib/bb/ui/crumbs/layereditor.py +++ b/bitbake/lib/bb/ui/crumbs/layereditor.py @@ -132,5 +132,6 @@ class LayerEditor(gtk.Dialog): # FIXME: verify we've actually got a layer conf? if path.endswith(".conf"): name, layerpath = self.configurator.addLayerConf(path) - self.newly_added[name] = layerpath - self.layer_store.append([name, layerpath, True]) + if name: + self.newly_added[name] = layerpath + self.layer_store.append([name, layerpath, True]) -- cgit v1.2.3-54-g00ecf