Commit 88bc6df1 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Friedemann Kleint
Browse files

Gerrit: Make patch display behave like git diff



Change-Id: If6b0b449d29b43a2eb6a135504c12caaf6fcd43b
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent 2193915c
......@@ -39,7 +39,9 @@
#include <gitplugin.h>
#include <gitclient.h>
#include <gitversioncontrol.h>
#include <gitconstants.h>
#include <vcsbase/vcsbaseconstants.h>
#include <vcsbase/vcsbaseeditor.h>
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
......@@ -212,15 +214,23 @@ void FetchContext::processFinished(int exitCode, QProcess::ExitStatus es)
break;
case WritePatchFileState:
switch (m_fetchMode) {
case FetchDisplay:
case FetchDisplay: {
m_patchFileName = m_patchFile->fileName();
m_patchFile->close();
m_patchFile.reset();
m_state = DoneState;
m_progress.reportFinished();
Core::EditorManager::instance()->openEditor(m_patchFileName);
QString title = QString(QLatin1String("Gerrit patch %1/%2"))
.arg(m_change->number).arg(m_change->currentPatchSet.patchSetNumber);
Core::IEditor *editor = Core::EditorManager::instance()->openEditor(
m_patchFileName, Git::Constants::GIT_DIFF_EDITOR_ID);
VcsBase::VcsBaseEditorWidget *vcsEditor = VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(editor);
vcsEditor->setDiffBaseDirectory(m_repository);
vcsEditor->setForceReadOnly(true);
vcsEditor->setDisplayName(title);
deleteLater();
break;
}
default:
break;
}
......
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