Commit 09268240 authored by David Edmundson's avatar David Edmundson Committed by Milian Wolff
Browse files

grepview: Guard model access in job completion

OutputsModel's are managed by GrepGrepOutputView, being deleted
if there are more than 5 or up to the lifespan of GrepOutputView.

The job has the lifespan of however long it takes to search for items.
As  such it could outlive the model.

BUG: 397556
parent a2155773
Pipeline #192571 passed with stage
in 17 minutes and 26 seconds
......@@ -153,9 +153,10 @@ void GrepJob::slotFindFinished()
m_regExp.setPatternSyntax(QRegExp::Wildcard);
}
m_outputModel->setRegExp(m_regExp);
m_outputModel->setReplacementTemplate(m_settings.replacementTemplate);
if (m_outputModel) {
m_outputModel->setRegExp(m_regExp);
m_outputModel->setReplacementTemplate(m_settings.replacementTemplate);
}
emit showMessage(this, i18np("Searching for <b>%2</b> in one file",
"Searching for <b>%2</b> in %1 files",
......
......@@ -97,7 +97,7 @@ private:
QRegExp m_regExp;
QString m_regExpSimple;
GrepOutputModel *m_outputModel;
QPointer<GrepOutputModel> m_outputModel;
enum {
WorkCollectFiles,
......
Supports Markdown
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