DiffEditor: Make DiffEditorDocument internal

Only expose Core::IDocument and keep DiffEditorDocument internal
to the DiffEditor plugin.

Change-Id: If39b82e2f20d40a65284503b4d4fd8dad919ad3a
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2015-01-30 14:33:39 +01:00
parent e7fb05e038
commit 956abd2803
9 changed files with 74 additions and 57 deletions

View File

@@ -47,6 +47,8 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h>
#include <utils/qtcassert.h>
namespace DiffEditor {
namespace Internal {
@@ -195,11 +197,12 @@ void DiffEditorPlugin::diff()
const QString documentId = QLatin1String("Diff ") + fileName1
+ QLatin1String(", ") + fileName2;
QString title = tr("Diff \"%1\", \"%2\"").arg(fileName1).arg(fileName2);
DiffEditorDocument * const document = DiffEditorManager::findOrCreate(documentId, title);
Core::IDocument *const document = DiffEditorManager::findOrCreate(documentId, title);
if (!document)
return;
DiffEditorController *controller = document->controller();
DiffEditorController *controller = DiffEditorManager::controller(document);
QTC_ASSERT(controller, return);
if (!controller->reloader()) {
SimpleDiffEditorReloader *reloader =
new SimpleDiffEditorReloader(fileName1, fileName2);
@@ -208,7 +211,7 @@ void DiffEditorPlugin::diff()
Core::EditorManager::activateEditorForDocument(document);
document->controller()->requestReload();
controller->requestReload();
}
} // namespace Internal