Commit 6f262719 authored by Kåre Särs's avatar Kåre Särs
Browse files

Fix empty tree node on startup

+ fix variable naming
parent 01f5001f
......@@ -975,7 +975,7 @@ Qt::ItemFlags MatchModel::flags(const QModelIndex &index) const
int MatchModel::rowCount(const QModelIndex &parent) const
{
if (!parent.isValid()) {
return /*m_matchFiles.isEmpty() && m_searchState == SearchDone ? 0 :*/ 1;
return (m_matchFiles.isEmpty() && m_searchState == SearchDone) ? 0 : 1;
}
if (parent.internalId() == InfoItemId) {
......
......@@ -797,12 +797,12 @@ void KatePluginSearchView::updateSearchColors()
if (!lineNrBackgroundColor.isValid())
lineNrBackgroundColor = view->defaultStyleAttribute(KTextEditor::dsNormal)->background().color();
if (!resultAttr)
resultAttr = new KTextEditor::Attribute();
if (!m_resultAttr)
m_resultAttr = new KTextEditor::Attribute();
// reset colors at the start of search
resultAttr->clear();
resultAttr->setBackground(searchBackgroundColor);
resultAttr->setForeground(foregroundColor);
m_resultAttr->clear();
m_resultAttr->setBackground(searchBackgroundColor);
m_resultAttr->setForeground(foregroundColor);
if (m_curResults) {
auto* delegate = qobject_cast<SPHtmlDelegate*>(m_curResults->treeView->itemDelegate());
......@@ -1443,7 +1443,7 @@ void KatePluginSearchView::updateMatchMarks()
// Add match marks for all matches in the file
const QVector<KateSearchMatch> &fileMatches = res->matchModel.fileMatches(doc->url());
for (const KateSearchMatch &match: fileMatches) {
addRangeAndMark(doc, match, resultAttr, miface);
addRangeAndMark(doc, match, m_resultAttr, miface);
}
}
......
......@@ -201,7 +201,7 @@ private:
QTimer m_changeTimer;
QPointer<KTextEditor::Message> m_infoMessage;
QColor m_replaceHighlightColor;
KTextEditor::Attribute::Ptr resultAttr;
KTextEditor::Attribute::Ptr m_resultAttr;
/**
* current project plugin view, if any
......
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