[neon/backports-focal/xdg-desktop-portal/Neon/unstable] src: open-uri: Print debug information when OpenFile/URI fails

Bastien Nocera null at kde.org
Wed Jan 13 06:32:42 GMT 2021


Git commit b4ac5b8045f070891dcca3d11a8e5c97c5ca9f0c by Bastien Nocera.
Committed on 17/04/2020 at 22:00.
Pushed by ash into branch 'Neon/unstable'.

open-uri: Print debug information when OpenFile/URI fails

M  +12   -0    src/open-uri.c

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

diff --git a/src/open-uri.c b/src/open-uri.c
index 21d3954..cbdf351 100644
--- a/src/open-uri.c
+++ b/src/open-uri.c
@@ -580,6 +580,7 @@ handle_open_in_thread_func (GTask *task,
           /* Reject the request */
           if (request->exported)
             {
+              g_debug ("Rejecting open request as content-type couldn't be fetched for '%s'", uri);
               g_variant_builder_init (&opts_builder, G_VARIANT_TYPE_VARDICT);
               xdp_request_emit_response (XDP_REQUEST (request),
                                          XDG_DESKTOP_PORTAL_RESPONSE_OTHER,
@@ -602,6 +603,15 @@ handle_open_in_thread_func (GTask *task,
           /* Reject the request */
           if (request->exported)
             {
+              if (path == NULL)
+                {
+                  g_debug ("Rejecting open request as fd has no path associated to it");
+                }
+              else
+                {
+                  g_debug ("Rejecting open request for %s as opening %swritable but fd is %swritable",
+                           path, writable ? "" : "not ", fd_is_writable ? "" : "not ");
+                }
               g_variant_builder_init (&opts_builder, G_VARIANT_TYPE_VARDICT);
               xdp_request_emit_response (XDP_REQUEST (request),
                                          XDG_DESKTOP_PORTAL_RESPONSE_OTHER,
@@ -701,6 +711,8 @@ handle_open_in_thread_func (GTask *task,
           gboolean result = launch_application_with_uri (app, uri, parent_window, writable, &error);
           if (request->exported)
             {
+              if (!result)
+                g_debug ("Open request for '%s' failed: %s", uri, error->message);
               g_variant_builder_init (&opts_builder, G_VARIANT_TYPE_VARDICT);
               xdp_request_emit_response (XDP_REQUEST (request),
                                          result ? XDG_DESKTOP_PORTAL_RESPONSE_SUCCESS : XDG_DESKTOP_PORTAL_RESPONSE_OTHER,



More information about the Neon-commits mailing list