diff options
author | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-01-30 14:33:39 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-02-16 15:50:16 +0000 |
commit | 956abd28030b7c821e2d7cce32814dc01c9a597e (patch) | |
tree | 7827452280be3c9dceae46c440b72cdaf14a52ce /src/plugins/diffeditor/diffeditorplugin.cpp | |
parent | e7fb05e038c19866f85c1cd2e49105b2f81bea0f (diff) | |
download | qt-creator-956abd28030b7c821e2d7cce32814dc01c9a597e.tar.gz |
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>
Diffstat (limited to 'src/plugins/diffeditor/diffeditorplugin.cpp')
-rw-r--r-- | src/plugins/diffeditor/diffeditorplugin.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/diffeditor/diffeditorplugin.cpp b/src/plugins/diffeditor/diffeditorplugin.cpp index c53e1729d1..ba78bc8a06 100644 --- a/src/plugins/diffeditor/diffeditorplugin.cpp +++ b/src/plugins/diffeditor/diffeditorplugin.cpp @@ -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 |