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
3b50ed40
Commit
3b50ed40
authored
Jan 13, 2021
by
Kåre Särs
Browse files
Re-Add sorting of the files in the result
parent
426ea782
Changes
2
Hide whitespace changes
Inline
Side-by-side
addons/search/MatchModel.cpp
View file @
3b50ed40
...
...
@@ -66,6 +66,14 @@ void MatchModel::setSearchState(MatchModel::SearchState searchState)
{
m_searchState
=
searchState
;
if
(
!
m_infoUpdateTimer
.
isActive
())
m_infoUpdateTimer
.
start
();
if
(
m_searchState
==
SearchDone
)
{
beginResetModel
();
std
::
sort
(
m_matchFiles
.
begin
(),
m_matchFiles
.
end
(),
[](
const
MatchFile
&
l
,
const
MatchFile
&
r
)
{
return
l
.
fileUrl
<
r
.
fileUrl
;
});
for
(
int
i
=
0
;
i
<
m_matchFiles
.
size
();
++
i
)
{
m_matchFileIndexHash
[
m_matchFiles
[
i
].
fileUrl
]
=
i
;
}
endResetModel
();
}
}
void
MatchModel
::
setBaseSearchPath
(
const
QString
&
baseSearchPath
)
...
...
addons/search/plugin_search.cpp
View file @
3b50ed40
...
...
@@ -1242,13 +1242,14 @@ void KatePluginSearchView::searchDone()
m_curResults
->
treeView
->
setColumnWidth
(
0
,
m_curResults
->
treeView
->
width
()
-
30
);
}
// Set search to done. This sorts the model and collapses all items in the view
m_curResults
->
matchModel
.
setSearchState
(
MatchModel
::
SearchDone
);
// expand the "header item " to display all files and all results if configured
expandResults
();
indicateMatch
(
m_curResults
->
matches
>
0
);
m_curResults
->
matchModel
.
setSearchState
(
MatchModel
::
SearchDone
);
m_curResults
=
nullptr
;
m_toolView
->
unsetCursor
();
...
...
@@ -1278,10 +1279,14 @@ void KatePluginSearchView::searchWhileTypingDone()
m_curResults
->
treeView
->
setColumnWidth
(
0
,
m_curResults
->
treeView
->
width
()
-
30
);
}
indicateMatch
(
m_curResults
->
matches
>
0
);
// Set search to done. This sorts the model and collapses all items in the view
m_curResults
->
matchModel
.
setSearchState
(
MatchModel
::
SearchDone
);
// expand the "header item " to display all files and all results if configured
expandResults
();
indicateMatch
(
m_curResults
->
matches
>
0
);
m_curResults
=
nullptr
;
if
(
popupVisible
)
{
...
...
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