Commit 1d23de64 authored by Nikita Baryshnikov's avatar Nikita Baryshnikov

GitClient: fix diff when committing

When a commit has several files, opening diff for the first file
works, but trying to open another diff without closing the previous
one doesn't refresh the diff editor.

Change-Id: Ia973cb70f2355a89b70787dd97042ef9f751d9d6
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarNikita Baryshnikov <nib952051@gmail.com>
parent 7da95de7
......@@ -48,7 +48,6 @@ DiffEditorController::DiffEditorController(Core::IDocument *document) :
m_chunkIndex(-1)
{
QTC_ASSERT(m_document, return);
QTC_CHECK(!m_document->controller());
m_document->setController(this);
}
......
......@@ -792,19 +792,15 @@ void GitClient::requestReload(const QString &documentId, const QString &source,
const QString &title,
std::function<DiffEditorController *(IDocument *)> factory) const
{
DiffEditorController *controller = 0;
IDocument *document = DiffEditorManager::findOrCreate(documentId, title);
QTC_ASSERT(document, return);
controller = DiffEditorManager::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, source);
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