From 741a3a9e646cf212626b30eecdc52d316b9afbd9 Mon Sep 17 00:00:00 2001 From: PASCALE NOYRET Date: Thu, 13 Jan 2022 11:18:19 +0100 Subject: [PATCH] correction de bug sur insertion en position1 --- InterfaceWeb/browser.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/InterfaceWeb/browser.py b/InterfaceWeb/browser.py index ea47eb66..8f443e49 100644 --- a/InterfaceWeb/browser.py +++ b/InterfaceWeb/browser.py @@ -241,7 +241,7 @@ class JDCNode(): ou en position intermediaire. Si pos vaut None, on le place a la position du catalogue. """ - #print ("************** appendChild ",self.item.getLabelText(), pos ) + print ("************** appendChild ",self.item.getLabelText(), pos ) #import traceback #traceback.print_stack() @@ -253,14 +253,11 @@ class JDCNode(): elif type(name) == object : index = self.item.getIndexChild(name.nom) else : index = self.item.getIndexChild(name) - # si on essaye d inserer a la racine - if (isinstance(self.treeParent,JDCTree) and index==0) : - verifiePosition=self.verifiePosition(name,'first',aLaRacine=True) - if not verifiePosition : return 0 - + print (self.children) obj = self.item.addItem(name,index) # emet le signal 'add' if obj is None : obj=0 + print (self.children) child=self.children[index] #try : # if len(obj) > 1 : self.buildChildren() @@ -268,7 +265,8 @@ class JDCNode(): print ("-------------- fin append child", child, child.item) - return True + if not obj : return None + return child.getIdUnique() def delete(self): #---------------- -- 2.39.2