From b6d30257ca4541325b3fae53029c56162342cb3a Mon Sep 17 00:00:00 2001 From: Dan Simmons Date: Mon, 10 Dec 2018 16:15:01 -0600 Subject: [PATCH] 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 --- debian/changelog | 6 ++++ .../patches/fix-launching-desktop-files.patch | 29 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 36 insertions(+) create mode 100644 debian/patches/fix-launching-desktop-files.patch diff --git a/debian/changelog b/debian/changelog index 73d995a..bd8d2ce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libfm-qt (0.13.1-5ubuntu8) disco; urgency=medium + + * Fix launching desktop files. + + -- Dan Simmons 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. diff --git a/debian/patches/fix-launching-desktop-files.patch b/debian/patches/fix-launching-desktop-files.patch new file mode 100644 index 0000000..7239b66 --- /dev/null +++ b/debian/patches/fix-launching-desktop-files.patch @@ -0,0 +1,29 @@ +Description: Fix launching desktop files +Author: Tsu Jan +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(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); diff --git a/debian/patches/series b/debian/patches/series index 39d7048..8c26d1a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -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