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 e783f8b8 authored by Kåre Särs's avatar Kåre Särs

S&R: Add match marks only at the end of searching/replacing.

Since we now always add the match marks at the end of searching or
replacing we don't need to do that while searching or replacing.

(+ Fix Esc handling)
parent 9405751e
......@@ -370,8 +370,6 @@ m_mainWindow (mainWin)
connect(m_kateApp, &KTextEditor::Application::documentWillBeDeleted, this, &KatePluginSearchView::clearDocMarks);
connect(&m_replacer, &ReplaceMatches::matchReplaced, this, &KatePluginSearchView::addMatchMark);
connect(&m_replacer, &ReplaceMatches::replaceStatus, this, &KatePluginSearchView::replaceStatus);
// Hook into line edit context menus
......@@ -509,17 +507,18 @@ void KatePluginSearchView::handleEsc(QEvent *e)
else if (m_toolView->isVisible()) {
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;
// Remove check marks
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;
}
}
}
......@@ -830,16 +829,6 @@ void KatePluginSearchView::matchFound(const QString &url, const QString &fName,
item->setCheckState (0, Qt::Checked);
m_curResults->matches++;
// Add mark if the document is open
KTextEditor::Document* doc;
if (url.isEmpty()) {
doc = m_replacer.findNamed(fName);
}
else {
doc = m_kateApp->findUrl(QUrl::fromUserInput(url));
}
addMatchMark(doc, item);
}
void KatePluginSearchView::clearMarks()
......
......@@ -131,9 +131,6 @@ bool ReplaceMatches::replaceMatch(KTextEditor::Document *doc, QTreeWidgetItem *i
item->setData(0, ReplaceMatches::EndColumnRole, newEndColumn);
item->setData(0, ReplaceMatches::ReplacedTextRole, replaceText);
emit matchReplaced(doc, item);
// Convert replace text back to "html"
replaceText.replace(QLatin1Char('\n'), QStringLiteral("\\n"));
replaceText.replace(QLatin1Char('\t'), QStringLiteral("\\t"));
......
......@@ -65,7 +65,6 @@ private Q_SLOTS:
Q_SIGNALS:
void replaceNextMatch();
void matchReplaced(KTextEditor::Document* doc, QTreeWidgetItem *item);
void replaceStatus(const QUrl &url);
void replaceDone();
......
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