Added default implementation for IEditorFactory::open().

This change allows to avoid massive code duplication along editors.

Change-Id: Ifdc6ae4b44ab399d34193ab8dddfa1f76d65ad11
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Konstantin Tokarev
2012-04-18 12:31:08 +04:00
committed by Eike Ziller
parent 6630857deb
commit ec38c829a7
25 changed files with 45 additions and 99 deletions

View File

@@ -77,17 +77,6 @@ QString QmlJSEditorFactory::displayName() const
return tr(C_QMLJSEDITOR_DISPLAY_NAME);
}
Core::IDocument *QmlJSEditorFactory::open(const QString &fileName)
{
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, id());
if (!iface) {
qWarning() << "QmlEditorFactory::open: openEditor failed for " << fileName;
return 0;
}
return iface->document();
}
Core::IEditor *QmlJSEditorFactory::createEditor(QWidget *parent)
{
QmlJSEditor::QmlJSTextEditorWidget *rc = new QmlJSEditor::QmlJSTextEditorWidget(parent);