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);