Commit afea017c authored by jkobus's avatar jkobus Committed by Jarek Kobus

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's avatarOrgad Shaneh <orgads@gmail.com>
parent d03927f3
......@@ -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);
......
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