diff options
author | Simon Schampijer <simon@schampijer.de> | 2012-08-19 12:51:17 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2012-08-20 18:14:42 (GMT) |
commit | 72052bdc54fb3bf0051d617bd41f961907a7c208 (patch) | |
tree | 74af14764aaa4e8ed9977d505418e905224407eb | |
parent | 37df71836a9f3f91d1452794785a08dafbd91d78 (diff) |
SpreadLayout: do not remove items from the grid if there is none yet, SL #3814
A grid is added to the ViewContainer when the children
are allocated, we can not do it earlier because we need to
pass the allocation details. The allocation happens when
the children needs to be shown. Therefore if the container
and it's children have not been shown yet, removing the
child from the grid would fail.
This patch does check if a grid exists already before trying
to remove items from it.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel QuiƱones <manuq@laptop.org>
-rw-r--r-- | src/jarabe/desktop/favoriteslayout.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/jarabe/desktop/favoriteslayout.py b/src/jarabe/desktop/favoriteslayout.py index 0f63f95..e0ee80e 100644 --- a/src/jarabe/desktop/favoriteslayout.py +++ b/src/jarabe/desktop/favoriteslayout.py @@ -150,6 +150,11 @@ class SpreadLayout(ViewLayout): ViewLayout.__init__(self) def remove(self, child): + if self._grid is None: + # the Grid is created during allocation time, so it might not + # exist yet when this method is called, SL #3814 + return + if self._grid.is_in_grid(child): self._grid.remove(child) |