summaryrefslogtreecommitdiff
path: root/gi/overrides/Gtk.py
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2013-08-15 19:23:18 -0700
committerSimon Feltman <sfeltman@src.gnome.org>2013-11-12 04:05:59 -0800
commit2f2069c9efcd8f312ce9ffa572df371fbc08822d (patch)
treefadf5cf751d1d789f3f44abc617fa773b1d62e3c /gi/overrides/Gtk.py
parent86a37d67455dc5d435ade35f17b27c5de2b288f5 (diff)
downloadpygobject-2f2069c9efcd8f312ce9ffa572df371fbc08822d.tar.gz
Cleanup overzealous new and init implementations
Remove PyGObject initializer code attempting to set properties on GObjects that have already been created. There were a number of overridden __new__ and __init__ methods that stripped away arguments before calling the base class to work around attempted property sets and argument count errors (fixing the symptom not the problem). Use Gtk.ListStore/TreeStore.new with __new__ override instead of __init__ with set_column_types. https://bugzilla.gnome.org/show_bug.cgi?id=705810
Diffstat (limited to 'gi/overrides/Gtk.py')
-rw-r--r--gi/overrides/Gtk.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 58251ded..96802fbe 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -909,9 +909,8 @@ __all__.append('TreeModelSort')
class ListStore(Gtk.ListStore, TreeModel, TreeSortable):
- def __init__(self, *column_types):
- Gtk.ListStore.__init__(self)
- self.set_column_types(column_types)
+ def __new__(self, *column_types):
+ return Gtk.ListStore.new(column_types)
def _do_insert(self, position, row):
if row is not None:
@@ -1158,10 +1157,8 @@ __all__.append('TreePath')
class TreeStore(Gtk.TreeStore, TreeModel, TreeSortable):
-
- def __init__(self, *column_types):
- Gtk.TreeStore.__init__(self)
- self.set_column_types(column_types)
+ def __new__(self, *column_types):
+ return Gtk.TreeStore.new(column_types)
def _do_insert(self, parent, position, row):
if row is not None: