Editor creation question

Vladimir Prus ghost at cs.msu.su
Wed Aug 24 10:58:03 UTC 2005

I don't understand something in the code that creates the editor.
In file src/partcontroller.cpp, method PartController::editDocumentInternal
we have this:

	KTextEditor::Editor * editorpart = createEditorPart(activate);

			editorpart->openURL( url );

			QWidget* widget = editorpart->widget();
			if (!widget) {
				// We're being lazy about creating the view, but kmdi _needs_ a widget to
				// create a tab for it, so use a QWidgetStack subclass instead
				kdDebug() << k_lineinfo << "Creating Editor wrapper..." << endl;
				widget = new EditorWrapper(.....)

The if was added with this commit:

r308001 | rodda | 2004-05-02 16:49:17 +0400 (Sun, 02 May 2004) | 4 lines

Merging in fast_editor_branch. This delays text editor view creation at
startup, leading to significant project open speedups, especially when
your project has many files open.

However, in my testing, the "if" branch is never taken. This is with KDevelop 
3.5 branch built against 3.4 kdelibs.

Can anybody explain what's going on here?

- Volodya

More information about the KDevelop-devel mailing list