Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
58f98568
Commit
58f98568
authored
Feb 03, 2021
by
Christoph Cullmann
🐮
Browse files
ensure queued connects for signals fired from different thread
parent
238c83a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/search/plugin_search.cpp
View file @
58f98568
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment