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
e52367fa
Commit
e52367fa
authored
Feb 09, 2021
by
Aleix Pol Gonzalez
🐧
Committed by
Aleix Pol Gonzalez
Feb 09, 2021
Browse files
pk: Make sure we execute absolute paths
CCBUG: 432683
(cherry picked from commit
72aee3c9
)
parent
b83f0f40
Changes
1
Hide whitespace changes
Inline
Side-by-side
libdiscover/backends/PackageKitBackend/LocalFilePKResource.cpp
View file @
e52367fa
...
...
@@ -62,10 +62,16 @@ void LocalFilePKResource::fetchDetails()
connect
(
transaction2
,
&
PackageKit
::
Transaction
::
errorCode
,
this
,
&
PackageKitResource
::
failedFetchingDetails
);
connect
(
transaction2
,
&
PackageKit
::
Transaction
::
files
,
this
,
[
this
]
(
const
QString
&
/*pkgid*/
,
const
QStringList
&
files
)
{
const
auto
execIdx
=
kIndexOf
(
files
,
[](
const
QString
&
file
)
{
return
file
.
endsWith
(
QLatin1String
(
".desktop"
))
&&
file
.
contains
(
QLatin1String
(
"usr/share/applications"
));
});
if
(
execIdx
>=
0
)
if
(
execIdx
>=
0
)
{
m_exec
=
files
[
execIdx
];
else
// sometimes aptcc provides paths like usr/share/applications/steam.desktop
if
(
!
m_exec
.
startsWith
(
QLatin1Char
(
'/'
)))
{
m_exec
.
prepend
(
QLatin1Char
(
'/'
));
}
}
else
{
qWarning
()
<<
"could not find an executable desktop file for"
<<
m_path
<<
"among"
<<
files
;
}
});
connect
(
transaction2
,
&
PackageKit
::
Transaction
::
finished
,
this
,
[]
{
qCDebug
(
LIBDISCOVER_BACKEND_LOG
)
<<
"."
;
});
}
...
...
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