Commits

Anonymous committed 23bc696

Slight speed improvement - possible useless, as it only gives about 0.03s, while the imports seem to take over 0.5s.

Comments (0)

Files changed (1)

         # self.message_box = KMessageBox()
 
         # Also we need an editor for the items. Call it with self.editor.exec(item).
-        self.editor = ItemEditor(self)
+        # but we only initialize it when we really need it. 
+        self.editor = None # ItemEditor(self)
 
 
     def focusOutEvent(self, event):
         # Don't close when the dialog pops up
         self.die_on_focus_lost = False
         # add a new label.
+        # starttime optimization: Only initialize the editor, when we need it. 
+        if self.editor is None:
+            self.editor = ItemEditor(self)
 	item = self.editor.edit(label.icon, label.action)
 	#: the place where we're in the wheel. the new label should be at idx + 1
 	idx = self.circle.index(label)
         """Edit a label. A click on the center item promts for adding a new label."""
         # Don't close when the dialog pops up
         self.die_on_focus_lost = False
+        # starttime optimization: Only initialize the editor, when we need it. 
+        if self.editor is None:
+            self.editor = ItemEditor(self)
 	item = self.editor.edit(label.icon, label.action)
 	if item is None:
 	    return None # clicked cancel