[POS-commit] r5324 - in kiwi/trunk: .

Johan Dahlin jdahlin at async.com.br
Thu Nov 2 21:30:33 BRT 2006


Author: jdahlin
Date: Thu Nov  2 21:30:32 2006
New Revision: 5324

Modified:
   kiwi/trunk/ChangeLog
   kiwi/trunk/kiwi/ui/objectlist.py

Log:
	(ObjectTree): kill ObjectTree, operate on instances inserted into
	the tree instead, to simplify the API



Modified: kiwi/trunk/ChangeLog
==============================================================================
--- kiwi/trunk/ChangeLog	(original)
+++ kiwi/trunk/ChangeLog	Thu Nov  2 21:30:32 2006
@@ -4,6 +4,8 @@
 	specify parents which are objects inserted in the tree.
 	(ObjectTree.collapse, ObjectTree.expand): New methods, suggested
 	by the incredible Ali
+	(ObjectTree): kill ObjectTree, operate on instances inserted into
+	the tree instead, to simplify the API
 
 2006-10-29  Johan Dahlin  <johan at gnome.org>
 

Modified: kiwi/trunk/kiwi/ui/objectlist.py
==============================================================================
--- kiwi/trunk/kiwi/ui/objectlist.py	(original)
+++ kiwi/trunk/kiwi/ui/objectlist.py	Thu Nov  2 21:30:32 2006
@@ -1599,10 +1599,6 @@
 
 type_register(ObjectList)
 
-class ObjectRow(object):
-    def __init__(self, iter):
-        self.iter = iter
-
 class ObjectTree(ObjectList):
     def __init__(self, columns=[], objects=None, mode=gtk.SELECTION_BROWSE,
                  sortable=False, model=None):
@@ -1613,9 +1609,7 @@
     def _append_internal(self, parent, instance, select, prepend):
         iters = self._iters
         parent_id = id(parent)
-        if isinstance(parent, ObjectRow):
-            parent_iter = parent.iter
-        elif parent_id in iters:
+        if parent_id in iters:
             parent_iter = iters[parent_id]
         elif parent is None:
             parent_iter = None
@@ -1639,21 +1633,23 @@
             self._select_and_focus_row(row_iter)
         self._treeview.thaw_notify()
 
-        return ObjectRow(row_iter)
+        return instance
 
     def append(self, parent, instance, select=False):
         """
-        @param parent: Object, ObjectRow or None, representing the parent
+        @param parent: Object or None, representing the parent
         @param instance: the instance to be added
         @param select: select the row
+        @returns: the appended object
         """
         return self._append_internal(parent, instance, select, prepend=False)
 
     def prepend(self, parent, instance, select=False):
         """
-        @param parent: Object, ObjectRow or None, representing the parent
+        @param parent: Object or None, representing the parent
         @param instance: the instance to be added
         @param select: select the row
+        @returns: the prepended object
         """
         return self._append_internal(parent, instance, select, prepend=True)
 


More information about the POS-commit mailing list