From 97ce8e4098fbfcfaac26e50a6ed3a9fc0eaa3e76 Mon Sep 17 00:00:00 2001
From: Eike Ziller <eike.ziller@digia.com>
Date: Fri, 31 May 2013 16:25:26 +0200
Subject: [PATCH] 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>
---
 .../coreplugin/editormanager/ieditorfactory.cpp       | 11 ++++++-----
 src/plugins/coreplugin/editormanager/ieditorfactory.h |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp
index f501289f926..fdceef33b92 100644
--- a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp
+++ b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp
@@ -29,11 +29,12 @@
 
 #include "ieditorfactory.h"
 
-#include "ieditor.h"
-#include "editormanager.h"
+#include <utils/qtcassert.h>
 
-Core::IDocument *Core::IEditorFactory::open(const QString &fileName)
+Core::IDocument *Core::IEditorFactory::open(const QString &)
 {
-    Core::IEditor *iface = Core::EditorManager::openEditor(fileName, id());
-    return iface ? iface->document() : 0;
+    qWarning("This should never be called, use IEditorFactor::createEditor, "
+             "or EditorManager::openEditor instead!");
+    QTC_CHECK(false);
+    return 0;
 }
diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory.h b/src/plugins/coreplugin/editormanager/ieditorfactory.h
index 5d59ab0e310..029554af0d8 100644
--- a/src/plugins/coreplugin/editormanager/ieditorfactory.h
+++ b/src/plugins/coreplugin/editormanager/ieditorfactory.h
@@ -44,7 +44,7 @@ public:
     IEditorFactory(QObject *parent = 0) : IDocumentFactory(parent) {}
 
     virtual IEditor *createEditor(QWidget *parent) = 0;
-    virtual IDocument *open(const QString &fileName);
+    virtual IDocument *open(const QString &);
 };
 
 } // namespace Core
-- 
GitLab