Commit e575a605 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Git: Do not re-use diff controller

When the controller is re-used, the file list is not refreshed.

This doesn't cause a leak, since DiffEditorDocument::setController
deletes the previous controller if already set.

Task-number: QTCREATORBUG-17815
Change-Id: Ic30ef15f9df4fa1cc196dcd175e2df44a88b2f89
Reviewed-by: default avatarAndré Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 13492fea
......@@ -722,16 +722,13 @@ void GitClient::requestReload(const QString &documentId, const QString &source,
IDocument *document = DiffEditorController::findOrCreateDocument(documentId, title);
QTC_ASSERT(document, return);
DiffEditorController *controller = DiffEditorController::controller(document);
if (!controller) {
controller = factory(document);
QTC_ASSERT(controller, return);
DiffEditorController *controller = factory(document);
QTC_ASSERT(controller, return);
connect(controller, &DiffEditorController::chunkActionsRequested,
this, &GitClient::slotChunkActionsRequested, Qt::DirectConnection);
connect(controller, &DiffEditorController::requestInformationForCommit,
this, &GitClient::branchesForCommit);
}
connect(controller, &DiffEditorController::chunkActionsRequested,
this, &GitClient::slotChunkActionsRequested, Qt::DirectConnection);
connect(controller, &DiffEditorController::requestInformationForCommit,
this, &GitClient::branchesForCommit);
VcsBasePlugin::setSource(document, sourceCopy);
EditorManager::activateEditorForDocument(document);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment