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,12 +968,17 @@ void GitClient::diff(const QString &workingDirectory,
|
|||||||
controller->setReloader(reloader);
|
controller->setReloader(reloader);
|
||||||
|
|
||||||
reloader->setWorkingDirectory(workingDirectory);
|
reloader->setWorkingDirectory(workingDirectory);
|
||||||
|
}
|
||||||
|
|
||||||
|
DiffEditor::DiffEditorController *controller = diffEditorDocument->controller();
|
||||||
|
GitDiffEditorReloader *reloader = static_cast<GitDiffEditorReloader *>(controller->reloader());
|
||||||
reloader->setDiffType(diffType);
|
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)
|
if (diffType == GitDiffEditorReloader::DiffFileList)
|
||||||
reloader->setFileList(stagedFileNames, unstagedFileNames);
|
reloader->setFileList(stagedFileNames, unstagedFileNames);
|
||||||
else if (diffType == GitDiffEditorReloader::DiffProjectList)
|
else if (diffType == GitDiffEditorReloader::DiffProjectList) // the same when unstaged file was clicked
|
||||||
reloader->setProjectList(unstagedFileNames);
|
reloader->setProjectList(unstagedFileNames);
|
||||||
}
|
|
||||||
|
|
||||||
diffEditorDocument->controller()->requestReload();
|
diffEditorDocument->controller()->requestReload();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user