summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-07-07 15:43:25 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-08 17:32:40 +0100
commitb2124617ab91acafa1078d1f42207db9489ef717 (patch)
treebcb0d444b8a193fa12322d70b92dabcdf7c6f568
parentfb24f9b37ca2cd5ab53330cdbe6630f5c36e3744 (diff)
downloadpoky-b2124617ab91acafa1078d1f42207db9489ef717.tar.gz
poky-b2124617ab91acafa1078d1f42207db9489ef717.tar.bz2
poky-b2124617ab91acafa1078d1f42207db9489ef717.zip
ui/crumbs/tasklistmodel: fix reset method
The reset() method only touched the contents sub-model, which does not include the selected image(s). This patch ensures that reset correctly unsets any image selection when called. Further we re-initialise the COL_IMG column when resetting packages. (Bitbake rev: f3fbc97471961042e5eb8224dc07dcc04293efcf) 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.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
index d9829861bb..5e979b7e2f 100644
--- a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
@@ -429,12 +429,24 @@ class TaskListModel(gtk.ListStore):
Empty self.contents by setting the include of each entry to None
"""
def reset(self):
+ # Deselect images - slightly more complex logic so that we don't
+ # have to iterate all of the contents of the main model, instead
+ # just iterate the images model.
+ if self.selected_image:
+ iit = self.images.get_iter_first()
+ while iit:
+ pit = self.images.convert_iter_to_child_iter(iit)
+ self.set(pit, self.COL_INC, False)
+ iit = self.images.iter_next(iit)
+ self.selected_image = None
+
it = self.contents.get_iter_first()
while it:
- path = self.contents.get_path(it)
- opath = self.contents.convert_path_to_child_path(path)
- self[opath][self.COL_INC] = False
- self[opath][self.COL_BINB] = ""
+ oit = self.contents.convert_iter_to_child_iter(it)
+ self.set(oit,
+ self.COL_INC, False,
+ self.COL_BINB, "",
+ self.COL_IMG, False)
# As we've just removed the first item...
it = self.contents.get_iter_first()