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