summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-08-30 09:32:48 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-30 21:57:15 +0100
commitea33ddc6a4d38cc6c86ca5fba03fa155ef8a44d8 (patch)
tree4c8fd33e2925779b69a13f867890c68c5898ba6c /bitbake
parented15be3313681c6e4cd7185e285a77ec37dc8750 (diff)
downloadast2050-yocto-poky-ea33ddc6a4d38cc6c86ca5fba03fa155ef8a44d8.zip
ast2050-yocto-poky-ea33ddc6a4d38cc6c86ca5fba03fa155ef8a44d8.tar.gz
ui/crumbs/tasklistmodel: loop optimisation in include_item()
Rather than trying to iterate the model to find whether the item is already included and then iterate the model again to find the items path attempt to find the path first and if the path is found test whether the COL_INC of the row is set. (Bitbake rev: 82845569c37591f6b097b9db071484f8171a39ea) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/ui/crumbs/tasklistmodel.py20
1 files changed, 7 insertions, 13 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
index 790631f..518232d 100644
--- a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
@@ -417,18 +417,10 @@ class TaskListModel(gtk.ListStore):
it = self.contents.iter_next(it)
"""
- Check the self.contents gtk.TreeModel for an item
- where COL_NAME matches item_name
- Returns True if a match is found, False otherwise
+ Check whether the item at item_path is included or not
"""
- def contents_includes_name(self, item_name):
- it = self.contents.get_iter_first()
- while it:
- path = self.contents.get_path(it)
- if self.contents[path][self.COL_NAME] == item_name:
- return True
- it = self.contents.iter_next(it)
- return False
+ def contents_includes_path(self, item_path):
+ return self[item_path][self.COL_INC]
"""
Add this item, and any of its dependencies, to the image contents
@@ -452,13 +444,15 @@ class TaskListModel(gtk.ListStore):
self.selected_image = item_name
if item_deps:
- # add all of the deps and set their binb to this item
+ # Ensure all of the items deps are included and, where appropriate,
+ # add this item to their COL_BINB
for dep in item_deps.split(" "):
# If the contents model doesn't already contain dep, add it
- dep_included = self.contents_includes_name(dep)
dep_path = self.find_path_for_item(dep)
if not dep_path:
continue
+ dep_included = self.contents_includes_path(dep_path)
+
if dep_included and not dep in item_bin:
# don't set the COL_BINB to this item if the target is an
# item in our own COL_BINB
OpenPOWER on IntegriCloud