diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2017-03-02 08:08:56 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2017-03-03 11:48:39 +0000 |
commit | e575a60508e11868fb40d586df2f166c1ff2af49 (patch) | |
tree | 845d00b19065feaa4e556ae0b7be05a1e391e751 | |
parent | 13492fea66499ab586b66cd4ef99cf7058979c49 (diff) | |
download | qt-creator-e575a60508e11868fb40d586df2f166c1ff2af49.tar.gz |
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: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
-rw-r--r-- | src/plugins/git/gitclient.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 3b1afc9195..3671a5054d 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -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); |