Anonymous avatar 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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.