1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-31 12:49:46 +00:00

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>
This commit is contained in:
Joshua Lock
2011-08-17 21:39:30 -07:00
committed by Richard Purdie
parent d2f1ede68a
commit b6009b2952
+17 -33
View File
@@ -350,7 +350,7 @@ class TaskListModel(gtk.ListStore):
inc = self[path][self.COL_INC] inc = self[path][self.COL_INC]
deps = self[path][self.COL_DEPS] 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] itype = self[path][self.COL_TYPE]
itname = self[path][self.COL_NAME] 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 # 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 # is to save its name and re-mark it for inclusion once dependency
# processing is complete # processing is complete
if binb == "User Selected": if "User Selected" in binb:
usersel[itname] = self[path][self.COL_IMG] usersel[itname] = self[path][self.COL_IMG]
# If the iterated item is included and depends on the removed # 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 # If the iterated item was brought in by the removed (passed) item
# try and find an alternative dependee and update the binb column # try and find an alternative dependee and update the binb column
if inc and marked_name in binb: if inc and marked_name in binb:
bib = self.find_alt_dependency(itname) binb.remove(marked_name)
self[path][self.COL_BINB] = bib self[path][self.COL_BINB] = ', '.join(binb).lstrip(', ')
# Re-add any removed user selected items # Re-add any removed user selected items
for u in usersel: for u in usersel:
@@ -414,25 +414,6 @@ class TaskListModel(gtk.ListStore):
else: else:
it = self.contents.iter_next(it) 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 Check the self.contents gtk.TreeModel for an item
where COL_NAME matches item_name where COL_NAME matches item_name
@@ -456,7 +437,10 @@ class TaskListModel(gtk.ListStore):
cur_inc = self[item_path][self.COL_INC] cur_inc = self[item_path][self.COL_INC]
if not cur_inc: if not cur_inc:
self[item_path][self.COL_INC] = True 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 # We want to do some magic with things which are brought in by the
# base image so tag them as so # 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 # add all of the deps and set their binb to this item
for dep in deps.split(" "): for dep in deps.split(" "):
# If the contents model doesn't already contain dep, add it # 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) dep_included = self.contents_includes_name(dep)
path = self.find_path_for_item(dep) path = self.find_path_for_item(dep)
if not dep_included and path: if not path:
self.include_item(path, name, image_contents) continue
# Set brought in by for any no longer orphan packages if dep_included:
elif dep_included and path: bin = self[path][self.COL_BINB].split(', ')
if not self[path][self.COL_BINB]: bin.append(name)
self[path][self.COL_BINB] = 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 Find the model path for the item_name
@@ -535,7 +519,7 @@ class TaskListModel(gtk.ListStore):
it = self.contents.get_iter_first() it = self.contents.get_iter_first()
while it: 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) name = self.contents.get_value(it, self.COL_NAME)
allpkgs.append(name) allpkgs.append(name)
if sel: if sel: