Fix launching desktop files

Summary: https://phab.lubuntu.me/T170 Fix launching desktop files patch

Test Plan: Launch terminal desktop files

Reviewers: wxl, tsimonq2

Reviewed By: wxl, tsimonq2

Differential Revision: https://phab.lubuntu.me/D45
ubuntu/disco
Dan Simmons 6 years ago committed by Simon Quigley
parent cd29302e86
commit b6d30257ca

6
debian/changelog vendored

@ -1,3 +1,9 @@
libfm-qt (0.13.1-5ubuntu8) disco; urgency=medium
* Fix launching desktop files.
-- Dan Simmons <monetaryabyss@protonmail.com> Wed, 21 Nov 2018 23:40:15 -0500
libfm-qt (0.13.1-5ubuntu7) cosmic; urgency=medium
* Check (and set) metadata::trusted instead of metadata::trust.

@ -0,0 +1,29 @@
Description: Fix launching desktop files
Author: Tsu Jan <tsujan2000@gmail.com>
Applied-Upstream: https://github.com/lxqt/libfm-qt/commit/9af480812bdef4a7cca7db7416b24d96b179ebf1
Last-Update: 2018-11-21
--- a/src/core/basicfilelauncher.cpp
+++ b/src/core/basicfilelauncher.cpp
@@ -250,7 +250,21 @@ bool BasicFileLauncher::launchDesktopEnt
it cannot be launched in fact */
if(app) {
- return launchWithApp(app, paths, ctx);
+ // don't call launchWithApp() because it calls g_app_info_launch_uris(),
+ // which uses the hard-coded terminal list of GLib -> gdesktopappinfo.c
+ GList* uris = nullptr;
+ for(auto& path : paths) {
+ auto uri = path.uri();
+ uris = g_list_prepend(uris, uri.release());
+ }
+ GErrorPtr err;
+ ret = bool(fm_app_info_launch(app, uris, ctx, &err));
+ g_list_foreach(uris, reinterpret_cast<GFunc>(g_free), nullptr);
+ g_list_free(uris);
+ if(!ret) {
+ // FIXME: show error for all files
+ showError(ctx, err, paths[0]);
+ }
}
else {
QString msg = QObject::tr("Invalid desktop entry file: '%1'").arg(desktopEntryName);

@ -4,3 +4,4 @@ fix-incorrect-file-info-handling-2.patch
fix-places-font-color.patch
move-in-file-dialog.patch
add-metadata-for-trusting-executables.patch
fix-launching-desktop-files.patch

Loading…
Cancel
Save