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
49cf6dd0
Commit
49cf6dd0
authored
Jan 01, 2021
by
Christoph Cullmann
🐮
Browse files
avoid stall at end of search if not expand all set + show intermediate match count
parent
5c3388a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/search/plugin_search.cpp
View file @
49cf6dd0
...
...
@@ -1466,9 +1466,9 @@ void KatePluginSearchView::searching(const QString &file)
QTreeWidgetItem
*
root
=
m_curResults
->
tree
->
topLevelItem
(
0
);
if
(
root
)
{
if
(
file
.
size
()
>
70
)
{
root
->
setData
(
0
,
Qt
::
DisplayRole
,
i18n
(
"<b>Searching: ...%
1
</b>"
,
file
.
right
(
70
)));
root
->
setData
(
0
,
Qt
::
DisplayRole
,
i18n
(
"<b>Searching
(%1 matches)
: ...%
2
</b>"
,
m_curResults
->
matches
,
file
.
right
(
70
)));
}
else
{
root
->
setData
(
0
,
Qt
::
DisplayRole
,
i18n
(
"<b>Searching: %
1
</b>"
,
file
));
root
->
setData
(
0
,
Qt
::
DisplayRole
,
i18n
(
"<b>Searching
(%1 matches)
: %
2
</b>"
,
m_curResults
->
matches
,
file
));
}
}
}
...
...
@@ -1702,16 +1702,18 @@ void KatePluginSearchView::expandResults()
return
;
}
if
(
m_ui
.
expandResults
->
isChecked
())
{
QTreeWidgetItem
*
root
=
m_curResults
->
tree
->
topLevelItem
(
0
);
if
(
!
root
)
{
return
;
}
// we expand recursively if we either are told so or we have just one toplevel match item
if
(
m_ui
.
expandResults
->
isChecked
()
||
(
root
->
childCount
()
<=
1
))
{
m_curResults
->
tree
->
expandAll
();
}
else
{
QTreeWidgetItem
*
root
=
m_curResults
->
tree
->
topLevelItem
(
0
);
// first collapse all and the expand the root, much faster than collapsing all children manually
m_curResults
->
tree
->
collapseAll
();
m_curResults
->
tree
->
expandItem
(
root
);
if
(
root
&&
(
root
->
childCount
()
>
1
))
{
for
(
int
i
=
0
;
i
<
root
->
childCount
();
i
++
)
{
m_curResults
->
tree
->
collapseItem
(
root
->
child
(
i
));
}
}
}
}
...
...
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