Commit 58f98568 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

ensure queued connects for signals fired from different thread

parent 238c83a3
......@@ -448,13 +448,19 @@ KatePluginSearchView::KatePluginSearchView(KTextEditor::Plugin *plugin, KTextEdi
m_diskSearchDoneTimer.setInterval(10);
connect(&m_diskSearchDoneTimer, &QTimer::timeout, this, &KatePluginSearchView::searchDone);
connect(&m_folderFilesList, &FolderFilesList::fileListReady, this, &KatePluginSearchView::folderFileListChanged);
connect(&m_folderFilesList, &FolderFilesList::searching, this, [this](const QString &path) {
Results *res = qobject_cast<Results *>(m_ui.resultTabWidget->currentWidget());
if (res) {
res->matchModel.setFileListUpdate(path);
}
});
// queued connect to signals emitted outside of background thread
connect(&m_folderFilesList, &FolderFilesList::fileListReady, this, &KatePluginSearchView::folderFileListChanged, Qt::QueuedConnection);
connect(
&m_folderFilesList,
&FolderFilesList::searching,
this,
[this](const QString &path) {
Results *res = qobject_cast<Results *>(m_ui.resultTabWidget->currentWidget());
if (res) {
res->matchModel.setFileListUpdate(path);
}
},
Qt::QueuedConnection);
connect(m_kateApp, &KTextEditor::Application::documentWillBeDeleted, this, &KatePluginSearchView::clearDocMarksAndRanges);
connect(m_kateApp, &KTextEditor::Application::documentWillBeDeleted, &m_searchOpenFiles, &SearchOpenFiles::cancelSearch);
......
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