diff --git a/src/plugins/diffeditor/diffeditorcontroller.h b/src/plugins/diffeditor/diffeditorcontroller.h index 7a712f10798..db1812fc2aa 100644 --- a/src/plugins/diffeditor/diffeditorcontroller.h +++ b/src/plugins/diffeditor/diffeditorcontroller.h @@ -76,7 +76,7 @@ protected: // inside reload() (for synchronous reload) // or later (for asynchronous reload) virtual void reload() = 0; - void reloadFinished(bool success); + virtual void reloadFinished(bool success); void setDiffFiles(const QList &diffFileList, const QString &baseDirectory = QString()); diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index ae65ec49b38..948a233bbb0 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -355,6 +355,7 @@ public: void reload() override; void processOutput(const QString &output) override; + void reloadFinished(bool success) override; private: const QString m_id; @@ -376,16 +377,26 @@ void ShowController::processOutput(const QString &output) QTC_ASSERT(m_state != Idle, return); if (m_state == GettingDescription) { setDescription(gitClient()->extendedShowDescription(m_directory, output)); + } else if (m_state == GettingDiff) { + processDiff(output); + } +} +void ShowController::reloadFinished(bool success) +{ + QTC_ASSERT(m_state != Idle, return); + + if (m_state == GettingDescription && success) { QStringList args; args << QLatin1String("show") << QLatin1String("--format=format:") // omit header, already generated << QLatin1String(noColorOption) << QLatin1String(decorateOption) << m_id; m_state = GettingDiff; runCommand(QList() << addConfigurationArguments(args)); - } else if (m_state == GettingDiff) { - m_state = Idle; - processDiff(output); + return; } + + m_state = Idle; + BaseController::reloadFinished(success); } ///////////////////////////////