Remove IEditorFactor::open implementation with a warning

Looks very much like the current IDocumentFactory / IEditorFactory
set up does not make much sense. Should be cleaned up in a follow-up
commit.

Change-Id: I000b68fe6b6d75add713866818711545b41dfe23
Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
Eike Ziller
2013-05-31 16:25:26 +02:00
parent 37c22861dc
commit 97ce8e4098
2 changed files with 7 additions and 6 deletions

View File

@@ -29,11 +29,12 @@
#include "ieditorfactory.h" #include "ieditorfactory.h"
#include "ieditor.h" #include <utils/qtcassert.h>
#include "editormanager.h"
Core::IDocument *Core::IEditorFactory::open(const QString &fileName) Core::IDocument *Core::IEditorFactory::open(const QString &)
{ {
Core::IEditor *iface = Core::EditorManager::openEditor(fileName, id()); qWarning("This should never be called, use IEditorFactor::createEditor, "
return iface ? iface->document() : 0; "or EditorManager::openEditor instead!");
QTC_CHECK(false);
return 0;
} }

View File

@@ -44,7 +44,7 @@ public:
IEditorFactory(QObject *parent = 0) : IDocumentFactory(parent) {} IEditorFactory(QObject *parent = 0) : IDocumentFactory(parent) {}
virtual IEditor *createEditor(QWidget *parent) = 0; virtual IEditor *createEditor(QWidget *parent) = 0;
virtual IDocument *open(const QString &fileName); virtual IDocument *open(const QString &);
}; };
} // namespace Core } // namespace Core