diff options
author | Joshua Lock <josh@linux.intel.com> | 2011-08-17 21:39:30 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-08-23 10:00:32 -0700 |
commit | b6009b295267cb991eb5efbe863ed4e4c99fb715 (patch) | |
tree | 32580ad4db926b469b81aebb8005c9309a307eec /bitbake/lib/bb/ui/crumbs/tasklistmodel.py | |
parent | d2f1ede68afa3a718bbf71b2739107667ecde37b (diff) | |
download | ast2050-yocto-poky-b6009b295267cb991eb5efbe863ed4e4c99fb715.zip ast2050-yocto-poky-b6009b295267cb991eb5efbe863ed4e4c99fb715.tar.gz |
bb/ui/crumbs/tasklistmodel: store all binb, not just the first
This makes it easier for the user to determine what the effects of a
removal may be, further it means we no longer need the find_alt_dependency
method which could be a fairly time-consuming method depending on the size
of the contents table.
Partially addresses [YOCTO #1365]
(Bitbake rev: 91d1f5f5a44c80e6702221509e2e9aadbe05bcc0)
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/tasklistmodel.py')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/tasklistmodel.py | 50 |
1 files changed, 17 insertions, 33 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py index b0f5d7a..d2f49d1 100644 --- a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py +++ b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py @@ -350,7 +350,7 @@ class TaskListModel(gtk.ListStore): inc = self[path][self.COL_INC] deps = self[path][self.COL_DEPS] - binb = self[path][self.COL_BINB] + binb = self[path][self.COL_BINB].split(', ') itype = self[path][self.COL_TYPE] itname = self[path][self.COL_NAME] @@ -362,7 +362,7 @@ class TaskListModel(gtk.ListStore): # we should keep it and its dependencies, the easiest way to do so # is to save its name and re-mark it for inclusion once dependency # processing is complete - if binb == "User Selected": + if "User Selected" in binb: usersel[itname] = self[path][self.COL_IMG] # If the iterated item is included and depends on the removed @@ -376,8 +376,8 @@ class TaskListModel(gtk.ListStore): # If the iterated item was brought in by the removed (passed) item # try and find an alternative dependee and update the binb column if inc and marked_name in binb: - bib = self.find_alt_dependency(itname) - self[path][self.COL_BINB] = bib + binb.remove(marked_name) + self[path][self.COL_BINB] = ', '.join(binb).lstrip(', ') # Re-add any removed user selected items for u in usersel: @@ -415,25 +415,6 @@ class TaskListModel(gtk.ListStore): it = self.contents.iter_next(it) """ - Find the name of an item in the image contents which depends on the item - name. - Returns either an item name (str) or None - """ - def find_alt_dependency(self, name): - it = self.contents.get_iter_first() - while it: - # 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 name in deps: - # if this item depends on the item, return this items name - return itname - it = self.contents.iter_next(it) - return "" - - """ Check the self.contents gtk.TreeModel for an item where COL_NAME matches item_name Returns True if a match is found, False otherwise @@ -456,7 +437,10 @@ class TaskListModel(gtk.ListStore): cur_inc = self[item_path][self.COL_INC] if not cur_inc: self[item_path][self.COL_INC] = True - self[item_path][self.COL_BINB] = binb + + bin = self[item_path][self.COL_BINB].split(', ') + bin.append(binb) + self[item_path][self.COL_BINB] = ', '.join(bin).lstrip(', ') # We want to do some magic with things which are brought in by the # base image so tag them as so @@ -469,16 +453,16 @@ class TaskListModel(gtk.ListStore): # add all of the deps and set their binb to this item for dep in deps.split(" "): # If the contents model doesn't already contain dep, add it - # We only care to show things which will end up in the - # resultant image, so filter cross and native recipes dep_included = self.contents_includes_name(dep) path = self.find_path_for_item(dep) - if not dep_included and path: - self.include_item(path, name, image_contents) - # Set brought in by for any no longer orphan packages - elif dep_included and path: - if not self[path][self.COL_BINB]: - self[path][self.COL_BINB] = name + if not path: + continue + if dep_included: + bin = self[path][self.COL_BINB].split(', ') + bin.append(name) + self[path][self.COL_BINB] = ', '.join(bin).lstrip(', ') + else: + self.include_item(path, binb=name, image_contents=image_contents) """ Find the model path for the item_name @@ -535,7 +519,7 @@ class TaskListModel(gtk.ListStore): it = self.contents.get_iter_first() while it: - sel = self.contents.get_value(it, self.COL_BINB) == "User Selected" + sel = "User Selected" in self.contents.get_value(it, self.COL_BINB) name = self.contents.get_value(it, self.COL_NAME) allpkgs.append(name) if sel: |