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/D45ubuntu/disco
parent
cd29302e86
commit
b6d30257ca
@ -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);
|
Loading…
Reference in new issue