From cc3291a8dd7a458ec06a5ae74a63f500081cdf84 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Thu, 04 Jun 2009 08:58:16 +0000 Subject: Do not disconnect from None signals --- (limited to 'OficinaActivity.py') diff --git a/OficinaActivity.py b/OficinaActivity.py index 75e4791..6f8c104 100644 --- a/OficinaActivity.py +++ b/OficinaActivity.py @@ -120,11 +120,13 @@ class OficinaActivity(activity.Activity): def map_cp(widget): def size_allocate_cb(widget, allocation): - self.disconnect(self._setup_handle) - self._setup_handle = None + if self._setup_handle: + self.disconnect(self._setup_handle) + self._setup_handle = None self.area.setup(allocation.width, allocation.height) - self.disconnect(self._setup_handle) + if self._setup_handle: + self.disconnect(self._setup_handle) self.canvas.add_with_viewport(self.fixed) self._setup_handle = self.fixed.connect('size_allocate', size_allocate_cb) @@ -136,17 +138,17 @@ class OficinaActivity(activity.Activity): logging.debug('reading file %s', file_path) - if self._setup_handle: - self.disconnect(self._setup_handle) - pixbuf = gtk.gdk.pixbuf_new_from_file(file_path) def size_allocate_cb(widget, allocation): - self.disconnect(self._setup_handle) - self._setup_handle = None + if self._setup_handle: + self.disconnect(self._setup_handle) + self._setup_handle = None self.area.setup(pixbuf.get_width(), pixbuf.get_height()) self.area.loadImageFromJournal(pixbuf) + if self._setup_handle: + self.disconnect(self._setup_handle) self.canvas.add_with_viewport(self.fixed) self._setup_handle = self.fixed.connect('size_allocate', size_allocate_cb) -- cgit v0.9.1