forked from qt-creator/qt-creator
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user