forked from qt-creator/qt-creator
DiffEditor: Fix double click inside commit editor
The bug was that if you double-click a file in the commit editor, then double-click another one, the diff remains with the first one. Change-Id: I1f49b549c9dfd3ebd4ec6950ed28dd8cbc7d0227 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -968,13 +968,18 @@ void GitClient::diff(const QString &workingDirectory,
|
||||
controller->setReloader(reloader);
|
||||
|
||||
reloader->setWorkingDirectory(workingDirectory);
|
||||
reloader->setDiffType(diffType);
|
||||
if (diffType == GitDiffEditorReloader::DiffFileList)
|
||||
reloader->setFileList(stagedFileNames, unstagedFileNames);
|
||||
else if (diffType == GitDiffEditorReloader::DiffProjectList)
|
||||
reloader->setProjectList(unstagedFileNames);
|
||||
}
|
||||
|
||||
DiffEditor::DiffEditorController *controller = diffEditorDocument->controller();
|
||||
GitDiffEditorReloader *reloader = static_cast<GitDiffEditorReloader *>(controller->reloader());
|
||||
reloader->setDiffType(diffType);
|
||||
// we force setFileList, since the lists can be different
|
||||
// e.g. when double click for the second time on different file inside commit editor
|
||||
if (diffType == GitDiffEditorReloader::DiffFileList)
|
||||
reloader->setFileList(stagedFileNames, unstagedFileNames);
|
||||
else if (diffType == GitDiffEditorReloader::DiffProjectList) // the same when unstaged file was clicked
|
||||
reloader->setProjectList(unstagedFileNames);
|
||||
|
||||
diffEditorDocument->controller()->requestReload();
|
||||
|
||||
EditorManager::activateEditorForDocument(diffEditorDocument);
|
||||
|
||||
Reference in New Issue
Block a user