From b2124617ab91acafa1078d1f42207db9489ef717 Mon Sep 17 00:00:00 2001 From: Joshua Lock Date: Thu, 7 Jul 2011 15:43:25 -0700 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/tasklistmodel.py | 20 ++++++++++++++++---- 1 file 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() -- cgit v1.2.3-54-g00ecf