summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-07-25 19:44:57 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-26 20:15:48 +0100
commit30a2ac4882b214a6572c36e0369a4701e2aaeb84 (patch)
tree7960fd43a972a920c49187a91881dc528f564194
parentb169dadb5fbf823a31140e28242c7d542b46f753 (diff)
downloadast2050-yocto-poky-30a2ac4882b214a6572c36e0369a4701e2aaeb84.zip
ast2050-yocto-poky-30a2ac4882b214a6572c36e0369a4701e2aaeb84.tar.gz
ui/crumbs/tasklistmodel: don't iterate whole model in find_alt_dependency()
The method needs to find an included item anyway so rather than iterating the entire model and checking the included status of each entry iterate over the contents gtk.TreeFilter. (Bitbake rev: 79bdd501075ff5164a8ee673a6a2a0e402978ae5) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/ui/crumbs/tasklistmodel.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
index e6af74f..b9fde9d 100644
--- a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
@@ -369,22 +369,21 @@ class TaskListModel(gtk.ListStore):
"""
Find the name of an item in the image contents which depends on the item
- at contents_path returns either an item name (str) or None
- NOTE:
- contents_path must be a path in the self.contents gtk.TreeModel
+ name.
+ Returns either an item name (str) or None
"""
def find_alt_dependency(self, name):
- it = self.get_iter_first()
+ it = self.contents.get_iter_first()
while it:
- # iterate all items in the model
- path = self.get_path(it)
- deps = self[path][self.COL_DEPS]
- itname = self[path][self.COL_NAME]
- inc = self[path][self.COL_INC]
+ # iterate all items in the contents model
+ path = self.contents.get_path(it)
+ deps = self.contents[path][self.COL_DEPS]
+ itname = self.contents[path][self.COL_NAME]
+ inc = self.contents[path][self.COL_INC]
if itname != name and inc and deps.count(name) > 0:
# if this item depends on the item, return this items name
return itname
- it = self.iter_next(it)
+ it = self.contents.iter_next(it)
return ""
"""
OpenPOWER on IntegriCloud