Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 9405751e authored by Kåre Särs's avatar Kåre Särs

S&R: Only highlight checked matches

+ Fix update timer not being singleShot.
parent 8e91fb63
......@@ -417,6 +417,7 @@ m_mainWindow (mainWin)
m_mainWindow->guiFactory()->addClient(this);
m_updateSumaryTimer.setInterval(1);
m_updateSumaryTimer.setSingleShot(true);
connect(&m_updateSumaryTimer, &QTimer::timeout, this, &KatePluginSearchView::updateResultsRootItem);
}
......@@ -509,6 +510,17 @@ void KatePluginSearchView::handleEsc(QEvent *e)
m_mainWindow->hideToolView(m_toolView);
}
}
Results *curResults = qobject_cast<Results *>(m_ui.resultTabWidget->currentWidget());
if (!curResults) {
qWarning() << "This is a bug";
return;
}
QTreeWidgetItemIterator it(curResults->tree);
while (*it) {
(*it)->setCheckState(0, Qt::Unchecked);
++it;
}
}
void KatePluginSearchView::setSearchString(const QString &pattern)
......@@ -864,6 +876,12 @@ void KatePluginSearchView::clearDocMarks(KTextEditor::Document* doc)
i++;
}
}
m_curResults = qobject_cast<Results *>(m_ui.resultTabWidget->currentWidget());
if (!m_curResults) {
qWarning() << "This is a bug";
return;
}
}
void KatePluginSearchView::startSearch()
......@@ -1456,13 +1474,16 @@ void KatePluginSearchView::docViewChanged()
}
}
if (fileItem) {
clearMarks();
clearDocMarks(doc);
if (m_isSearchAsYouType) {
fileItem = fileItem->parent();
}
for (int i=0; i<fileItem->childCount(); i++) {
if (fileItem->child(i)->checkState(0) == Qt::Unchecked) {
continue;
}
addMatchMark(doc, fileItem->child(i));
}
}
......@@ -1563,6 +1584,8 @@ void KatePluginSearchView::updateResultsRootItem()
checkedStr));
break;
}
docViewChanged();
}
void KatePluginSearchView::itemSelected(QTreeWidgetItem *item)
......
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