GTK3: user_data should be int in future, so no longer convert to str

svn: r20430
This commit is contained in:
Benny Malengier 2012-09-21 19:38:46 +00:00
parent 2aa5848247
commit ef6b254ba3

View File

@ -808,7 +808,7 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
iter.stamp = self.stamp iter.stamp = self.stamp
#user data should be an object, so we store the long as str #user data should be an object, so we store the long as str
iter.user_data = str(nodeid) iter.user_data = nodeid
return iter return iter
def get_iter(self, node): def get_iter(self, node):
@ -872,7 +872,7 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
""" """
See Gtk.TreeModel See Gtk.TreeModel
""" """
nodeid = long(iter.user_data) nodeid = iter.user_data
node = self.nodemap.node(nodeid) node = self.nodemap.node(nodeid)
if node.handle is None: if node.handle is None:
# Header rows dont get the foreground color set # Header rows dont get the foreground color set
@ -933,7 +933,7 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
def get_node_from_iter(self, iter): def get_node_from_iter(self, iter):
if iter and iter.user_data: if iter and iter.user_data:
return self.nodemap.node(long(iter.user_data)) return self.nodemap.node(iter.user_data)
else: else:
print ('Problem', iter, iter.user_data) print ('Problem', iter, iter.user_data)
raise NotImplementedError raise NotImplementedError
@ -972,7 +972,7 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel):
val = node.prev if self.__reverse else node.next val = node.prev if self.__reverse else node.next
if val: if val:
#user_data contains the nodeid #user_data contains the nodeid
iter.user_data = str(val) iter.user_data = val
return True return True
else: else:
return False return False