Commit ae04ae91 authored by Anthony Fieroni's avatar Anthony Fieroni Committed by Christoph Cullmann

[kateproject] Gracefully exit when analyzer is not finished

Differential Revision: https://phabricator.kde.org/D17503Signed-off-by: Anthony Fieroni's avatarAnthony Fieroni <bvbfan@abv.bg>
parent 18be8b58
......@@ -37,7 +37,7 @@ KateProjectInfoViewCodeAnalysis::KateProjectInfoViewCodeAnalysis(KateProjectPlug
, m_project(project)
, m_messageWidget(nullptr)
, m_startStopAnalysis(new QPushButton(i18n("Start Analysis...")))
, m_treeView(new QTreeView())
, m_treeView(new QTreeView(this))
, m_model(new QStandardItemModel(m_treeView))
, m_analyzer(nullptr)
, m_analysisTool(nullptr)
......@@ -103,6 +103,7 @@ KateProjectInfoViewCodeAnalysis::KateProjectInfoViewCodeAnalysis(KateProjectPlug
KateProjectInfoViewCodeAnalysis::~KateProjectInfoViewCodeAnalysis()
{
delete m_analyzer;
}
void KateProjectInfoViewCodeAnalysis::slotToolSelectionChanged(int)
......@@ -129,7 +130,8 @@ void KateProjectInfoViewCodeAnalysis::slotStartStopClicked()
/**
* launch selected tool
*/
m_analyzer = new QProcess(this);
delete m_analyzer;
m_analyzer = new QProcess;
m_analyzer->setProcessChannelMode(QProcess::MergedChannels);
connect(m_analyzer, &QProcess::readyRead, this, &KateProjectInfoViewCodeAnalysis::slotReadyRead);
......@@ -144,7 +146,7 @@ void KateProjectInfoViewCodeAnalysis::slotStartStopClicked()
}
if (!m_analyzer->waitForStarted()) {
m_messageWidget = new KMessageWidget();
m_messageWidget = new KMessageWidget(this);
m_messageWidget->setCloseButtonVisible(true);
m_messageWidget->setMessageType(KMessageWidget::Warning);
m_messageWidget->setWordWrap(false);
......@@ -234,9 +236,8 @@ void KateProjectInfoViewCodeAnalysis::slotClicked(const QModelIndex &index)
void KateProjectInfoViewCodeAnalysis::finished(int exitCode, QProcess::ExitStatus)
{
m_startStopAnalysis->setEnabled(true);
m_messageWidget = new KMessageWidget();
m_startStopAnalysis->setEnabled(true);
m_messageWidget = new KMessageWidget(this);
m_messageWidget->setCloseButtonVisible(true);
m_messageWidget->setWordWrap(false);
......
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