[neon/backports-focal/xdg-desktop-portal/Neon/unstable] src: open-uri: Use correct app ID to determine whether it exists

Simon McVittie null at kde.org
Wed Jan 13 06:32:43 GMT 2021


Git commit f09baf8c51d391bf19051ad7ccb4f92b39369764 by Simon McVittie.
Committed on 07/09/2020 at 13:20.
Pushed by ash into branch 'Neon/unstable'.

open-uri: Use correct app ID to determine whether it exists

x-d-p represents apps by their app ID *without* the .desktop suffix,
but GDesktopAppInfo represents them by the app ID *with* the .desktop
suffix.

Fixes: 69205f12 "open-uri: Show app chooser when default app does not exist"
Resolves: #524
Signed-off-by: Simon McVittie <smcv at collabora.com>

M  +3    -1    src/open-uri.c

https://invent.kde.org/neon/backports-focal/xdg-desktop-portal/commit/f09baf8c51d391bf19051ad7ccb4f92b39369764

diff --git a/src/open-uri.c b/src/open-uri.c
index c5b8705..7eb7804 100644
--- a/src/open-uri.c
+++ b/src/open-uri.c
@@ -554,10 +554,12 @@ static gboolean
 app_exists (const char *app_id)
 {
   g_autoptr(GDesktopAppInfo) info = NULL;
+  g_autofree gchar *with_desktop = NULL;
 
   g_return_val_if_fail (app_id != NULL, FALSE);
 
-  info = g_desktop_app_info_new (app_id);
+  with_desktop = g_strconcat (app_id, ".desktop", NULL);
+  info = g_desktop_app_info_new (with_desktop);
   return (info != NULL);
 }
 



More information about the Neon-commits mailing list