Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Discover
Commits
4f95009b
Commit
4f95009b
authored
Oct 02, 2020
by
Aleix Pol Gonzalez
🐧
Browse files
flatpak: take into account alternative names when searching
CCBUG: 427243
parent
71664080
Changes
1
Hide whitespace changes
Inline
Side-by-side
libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
View file @
4f95009b
...
...
@@ -1194,9 +1194,18 @@ QVector<AbstractResource *> FlatpakBackend::resourcesByAppstreamName(const QStri
{
QVector
<
AbstractResource
*>
resources
;
const
QString
nameWithDesktop
=
name
+
QLatin1String
(
".desktop"
);
for
each
(
FlatpakResource
*
res
,
m_resources
)
{
for
(
FlatpakResource
*
res
:
m_resources
)
{
if
(
QString
::
compare
(
res
->
appstreamId
(),
name
,
Qt
::
CaseInsensitive
)
==
0
||
QString
::
compare
(
res
->
appstreamId
(),
nameWithDesktop
,
Qt
::
CaseInsensitive
)
==
0
)
resources
<<
res
;
else
{
const
auto
alts
=
res
->
alternativeAppstreamIds
();
for
(
const
auto
&
alt
:
alts
)
{
if
(
QString
::
compare
(
alt
,
name
,
Qt
::
CaseInsensitive
)
==
0
||
QString
::
compare
(
alt
,
nameWithDesktop
,
Qt
::
CaseInsensitive
)
==
0
)
{
resources
<<
res
;
break
;
}
}
}
}
auto
f
=
[
this
](
AbstractResource
*
l
,
AbstractResource
*
r
)
{
return
flatpakResourceLessThan
(
l
,
r
);
};
std
::
sort
(
resources
.
begin
(),
resources
.
end
(),
f
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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