From 72052bdc54fb3bf0051d617bd41f961907a7c208 Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Sun, 19 Aug 2012 12:51:17 +0000 Subject: 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 Acked-by: Manuel QuiƱones --- 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) -- cgit v0.9.1