Add DiffEditorManager, refactoring.

GitDiffSwitcher operates now on IDocument.
GitDiffHandler operates now on DiffEditorController.
"source" property now attached to editor's document (VcsBasePlugin).

Change-Id: Ie2570a597b8b992ac1dc33b9179eca459c8a751a
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
This commit is contained in:
jkobus
2014-02-11 13:00:35 +01:00
committed by Jarek Kobus
parent 84e8a79c81
commit 73cf43f323
19 changed files with 445 additions and 266 deletions

View File

@@ -238,11 +238,7 @@ void StateListener::slotStateChanged()
} else {
state.currentFile = currentDocument->filePath();
if (state.currentFile.isEmpty()) {
const QList<Core::IEditor *> editors =
Core::EditorManager::documentModel()->editorsForDocument(currentDocument);
if (!editors.isEmpty()) {
state.currentFile = VcsBasePlugin::source(editors.first());
}
state.currentFile = VcsBasePlugin::source(currentDocument);
}
}
QScopedPointer<QFileInfo> currentFileInfo; // Instantiate QFileInfo only once if required.
@@ -750,12 +746,12 @@ bool VcsBasePlugin::isSshPromptConfigured()
static const char SOURCE_PROPERTY[] = "qtcreator_source";
void VcsBasePlugin::setSource(Core::IEditor *editor, const QString &source)
void VcsBasePlugin::setSource(Core::IDocument *editor, const QString &source)
{
editor->setProperty(SOURCE_PROPERTY, source);
}
QString VcsBasePlugin::source(Core::IEditor *editor)
QString VcsBasePlugin::source(Core::IDocument *editor)
{
return editor->property(SOURCE_PROPERTY).toString();
}