Fixed an issue in the toolbar manager where adding a toolbar a second time caused actions to be listed multiple times.

Fri, 07 Jan 2011 12:08:01 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 07 Jan 2011 12:08:01 +0100
changeset 824
360e007523bd
parent 821
4c4a4525e69a
child 825
9cdec3c5bc07

Fixed an issue in the toolbar manager where adding a toolbar a second time caused actions to be listed multiple times.

E5Gui/E5ToolBarManager.py file | annotate | diff | comparison | revisions
diff -r 4c4a4525e69a -r 360e007523bd E5Gui/E5ToolBarManager.py
--- a/E5Gui/E5ToolBarManager.py	Fri Jan 07 10:01:24 2011 +0100
+++ b/E5Gui/E5ToolBarManager.py	Fri Jan 07 12:08:01 2011 +0100
@@ -129,21 +129,21 @@
         """
         if toolBar is None:
             return
-        if toolBar in self.__toolBars:
-            return
         
         newActions = []
         newActionsWithSeparators = []
         actions = toolBar.actions()
         for action in actions:
+            actID = id(action)
             self.addAction(action, category)
-            if id(action) in self.__widgetActions:
-                self.__widgetActions[id(action)] = toolBar
+            if actID in self.__widgetActions:
+                self.__widgetActions[actID] = toolBar
             newActionsWithSeparators.append(action)
             if action.isSeparator():
                 action = None
             else:
-                self.__actionToToolBars[id(action)].append(toolBar)
+                if toolBar not in self.__actionToToolBars[actID]:
+                    self.__actionToToolBars[actID].append(toolBar)
             newActions.append(action)
         tbID = id(toolBar)
         self.__defaultToolBars[tbID] = newActions
@@ -383,7 +383,7 @@
             return
         if action.isSeparator():
             return
-        if action in self.__allActions:
+        if id(action) in self.__allActions:
             return
         
         if action.metaObject().className() == "QWidgetAction":

eric ide

mercurial