| 1 | /* |
| 2 | * Copyright © 2016 Red Hat, Inc |
| 3 | * |
| 4 | * SPDX-License-Identifier: LGPL-2.1-or-later |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Lesser General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2.1 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Lesser General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Lesser General Public |
| 17 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | * Authors: |
| 20 | * Matthias Clasen <[email protected]> |
| 21 | */ |
| 22 | |
| 23 | #include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 24 | |
| 25 | #include <locale.h> |
| 26 | #include <stdio.h> |
| 27 | #include <stdlib.h> |
| 28 | #include <string.h> |
| 29 | #include <errno.h> |
| 30 | |
| 31 | #include <sys/types.h> |
| 32 | #include <sys/stat.h> |
| 33 | #include <unistd.h> |
| 34 | #include <fcntl.h> |
| 35 | |
| 36 | #include <gio/gio.h> |
| 37 | #include <gio/gunixfdlist.h> |
| 38 | #include <gio/gdesktopappinfo.h> |
| 39 | |
| 40 | #include "open-uri.h"cxx . . $ `<file>/src/open-uri.h`/ |
| 41 | #include "xdp-request.h"cxx . . $ `<file>/src/xdp-request.h`/ |
| 42 | #include "xdp-dbus.h"cxx . . $ `<file>/build/src/xdp-dbus.h`/ |
| 43 | #include "xdp-impl-dbus.h"cxx . . $ `<file>/build/src/xdp-impl-dbus.h`/ |
| 44 | #include "xdp-utils.h"cxx . . $ `<file>/src/xdp-utils.h`/ |
| 45 | #include "xdp-permissions.h"cxx . . $ `<file>/src/xdp-permissions.h`/ |
| 46 | #include "xdp-app-launch-context.h"cxx . . $ `<file>/src/xdp-app-launch-context.h`/ |
| 47 | #include "xdp-documents.h"cxx . . $ `<file>/src/xdp-documents.h`/ |
| 48 | |
| 49 | #define FILE_MANAGER_DBUS_NAMEcxx . . $ `src/open-uri.c:49:9`! "org.freedesktop.FileManager1" |
| 50 | #define FILE_MANAGER_DBUS_IFACEcxx . . $ `src/open-uri.c:50:9`! "org.freedesktop.FileManager1" |
| 51 | #define FILE_MANAGER_DBUS_PATHcxx . . $ `src/open-uri.c:51:9`! "/org/freedesktop/FileManager1" |
| 52 | |
| 53 | #define FILE_MANAGER_SHOW_ITEMScxx . . $ `src/open-uri.c:53:9`! "ShowItems" |
| 54 | |
| 55 | #define PERMISSION_TABLEcxx . . $ `src/open-uri.c:55:9`! "desktop-used-apps" |
| 56 | |
| 57 | #define DEFAULT_THRESHOLDcxx . . $ `src/open-uri.c:57:9`! 3 |
| 58 | |
| 59 | typedef struct _OpenURIcxx . . $ _OpenURI# OpenURIcxx . . $ OpenURI#; |
| 60 | |
| 61 | typedef struct _OpenURIClasscxx . . $ _OpenURIClass# OpenURIClasscxx . . $ OpenURIClass#; |
| 62 | |
| 63 | struct _OpenURIcxx . . $ _OpenURI# |
| 64 | { |
| 65 | XdpDbusOpenURISkeletoncxx . . $ XdpDbusOpenURISkeleton# parent_instancecxx . . $ _OpenURI#parent_instance.; |
| 66 | }; |
| 67 | |
| 68 | struct _OpenURIClasscxx . . $ _OpenURIClass# |
| 69 | { |
| 70 | XdpDbusOpenURISkeletonClasscxx . . $ XdpDbusOpenURISkeletonClass# parent_classcxx . . $ _OpenURIClass#parent_class.; |
| 71 | }; |
| 72 | |
| 73 | enumcxx . . $ $anonymous_type_874128d4fb7c08db_0# { |
| 74 | PERM_APP_IDcxx . . $ PERM_APP_ID., |
| 75 | PERM_APP_COUNTcxx . . $ PERM_APP_COUNT., |
| 76 | PERM_APP_THRESHOLDcxx . . $ PERM_APP_THRESHOLD., |
| 77 | LAST_PERMcxx . . $ LAST_PERM. |
| 78 | }; |
| 79 | |
| 80 | static XdpDbusImplAppChoosercxx . . $ XdpDbusImplAppChooser# *implcxx . . $ impl.; |
| 81 | static OpenURIcxx . . $ OpenURI# *open_uricxx . . $ open_uri.; |
| 82 | static GAppInfoMonitorcxx . . $ GAppInfoMonitor# *monitorcxx . . $ monitor.; |
| 83 | static XdpDbusImplLockdowncxx . . $ XdpDbusImplLockdown# *lockdowncxx . . $ lockdown.; |
| 84 | |
| 85 | GTypecxx . . $ GType# open_uri_get_typecxx . . $ open_uri_get_type(f708dce9a8856c70). (void) G_GNUC_CONSTcxx . . $ `<external>/12741050725406041920/gmacros.h:640:9`!; |
| 86 | static void open_uri_iface_initcxx . . $ open_uri_iface_init(f49c09bbc3407075). (XdpDbusOpenURIIfacecxx . . $ XdpDbusOpenURIIface# *iface); |
| 87 | |
| 88 | G_DEFINE_TYPE_WITH_CODEcxx . . $ `<external>/9567554376676449156/gtype.h:1850:9`! (OpenURI, open_uri, XDP_DBUS_TYPE_OPEN_URI_SKELETONcxx . . $ `build/src/xdp-dbus.h:5255:9`!, |
| 89 | G_IMPLEMENT_INTERFACEcxx . . $ `<external>/9567554376676449156/gtype.h:2115:9`! (XDP_DBUS_TYPE_OPEN_URIcxx . . $ `build/src/xdp-dbus.h:4991:9`!, |
| 90 | open_uri_iface_init)); |
| 91 | |
| 92 | static void |
| 93 | parse_permissionscxx . . $ parse_permissions(661bf78b48a25826). (const char **permissions, |
| 94 | char **app_id, |
| 95 | gintcxx . . $ gint# *app_count, |
| 96 | gintcxx . . $ gint# *app_threshold) |
| 97 | { |
| 98 | char *perms_id = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 99 | gintcxx . . $ gint# perms_count = 0; |
| 100 | gintcxx . . $ gint# perms_threshold = DEFAULT_THRESHOLDcxx . . $ `src/open-uri.c:57:9`!; |
| 101 | |
| 102 | if ((permissions != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) && |
| 103 | (permissions[PERM_APP_IDcxx . . $ PERM_APP_ID.] != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) && |
| 104 | (permissions[PERM_APP_COUNTcxx . . $ PERM_APP_COUNT.] != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)) |
| 105 | { |
| 106 | perms_id = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (permissions[PERM_APP_ID]); |
| 107 | perms_count = atoicxx . . $ atoi(5c4306d8553b3696). (permissions[PERM_APP_COUNTcxx . . $ PERM_APP_COUNT.]); |
| 108 | if (permissions[PERM_APP_THRESHOLDcxx . . $ PERM_APP_THRESHOLD.] != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 109 | { |
| 110 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *threshold = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (permissions[PERM_APP_THRESHOLD]); |
| 111 | if (g_strstripcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:248:9`!(threshold)[0] != '\0') |
| 112 | perms_threshold = atoicxx . . $ atoi(5c4306d8553b3696). (permissions[PERM_APP_THRESHOLDcxx . . $ PERM_APP_THRESHOLD.]); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | *app_id = perms_id; |
| 117 | *app_count = perms_count; |
| 118 | *app_threshold = perms_threshold; |
| 119 | } |
| 120 | |
| 121 | static gbooleancxx . . $ gboolean# |
| 122 | get_latest_choice_infocxx . . $ get_latest_choice_info(7a91054e8df9575a). (const char *app_id, |
| 123 | const char *content_type, |
| 124 | gcharcxx . . $ gchar# **latest_id, |
| 125 | gintcxx . . $ gint# *latest_count, |
| 126 | gintcxx . . $ gint# *latest_threshold, |
| 127 | gbooleancxx . . $ gboolean# *always_ask) |
| 128 | { |
| 129 | char *choice_id = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 130 | int choice_count = 0; |
| 131 | int choice_threshold = DEFAULT_THRESHOLDcxx . . $ `src/open-uri.c:57:9`!; |
| 132 | gbooleancxx . . $ gboolean# ask = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 133 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 134 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) out_perms = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 135 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) out_data = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 136 | |
| 137 | if (!xdp_dbus_impl_permission_store_call_lookup_synccxx . . $ xdp_dbus_impl_permission_store_call_lookup_sync(b4ce393c2c779376). (xdp_get_permission_storecxx . . $ xdp_get_permission_store(ac6178aae3a00722). (), |
| 138 | PERMISSION_TABLEcxx . . $ `src/open-uri.c:55:9`!, |
| 139 | content_type, |
| 140 | &out_perms, |
| 141 | &out_data, |
| 142 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 143 | &error)) |
| 144 | { |
| 145 | g_dbus_error_strip_remote_errorcxx . . $ g_dbus_error_strip_remote_error(425e103a815b829). (error); |
| 146 | /* Not finding an entry for the content type in the permission store is perfectly ok */ |
| 147 | if (!g_error_matchescxx . . $ g_error_matches(604444fafc3e7b63). (error, XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:98:9`!, XDG_DESKTOP_PORTAL_ERROR_NOT_FOUNDcxx . . $ XDG_DESKTOP_PORTAL_ERROR_NOT_FOUND.)) |
| 148 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Unable to retrieve info for '%s' in the %s table of the permission store: %s", |
| 149 | content_type, PERMISSION_TABLEcxx . . $ `src/open-uri.c:55:9`!, error->message); |
| 150 | g_clear_errorcxx . . $ g_clear_error(19f343512d040fc2). (&error); |
| 151 | } |
| 152 | |
| 153 | if (out_data != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 154 | { |
| 155 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) data = g_variant_get_child_valuecxx . . $ g_variant_get_child_value(8aa5a571b04b0b30). (out_data, 0); |
| 156 | if (g_variant_is_of_typecxx . . $ g_variant_is_of_type(1b093e6d7a188be5). (data, G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!)) |
| 157 | g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (data, "always-ask", "b", &ask); |
| 158 | } |
| 159 | |
| 160 | if (out_perms != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 161 | { |
| 162 | GVariantItercxx . . $ GVariantIter# iter; |
| 163 | GVariantcxx . . $ GVariant# *child; |
| 164 | gbooleancxx . . $ gboolean# app_found = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 165 | |
| 166 | g_variant_iter_initcxx . . $ g_variant_iter_init(83d0c9c646e4f22c). (&iter, out_perms); |
| 167 | while (!app_found && (child = g_variant_iter_next_valuecxx . . $ g_variant_iter_next_value(45397e10577d0db). (&iter))) |
| 168 | { |
| 169 | const char *child_app_id; |
| 170 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! const char **permissions; |
| 171 | |
| 172 | g_variant_getcxx . . $ g_variant_get(671e9cd8f09cd612). (child, "{&s^a&s}", &child_app_id, &permissions); |
| 173 | if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (child_app_id, app_id) == 0) |
| 174 | { |
| 175 | parse_permissionscxx . . $ parse_permissions(661bf78b48a25826). (permissions, &choice_id, &choice_count, &choice_threshold); |
| 176 | app_found = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 177 | } |
| 178 | g_variant_unrefcxx . . $ g_variant_unref(86dbca581f53fd84). (child); |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | *latest_id = choice_id; |
| 183 | *latest_count = choice_count; |
| 184 | *latest_threshold = choice_threshold; |
| 185 | *always_ask = ask; |
| 186 | |
| 187 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Found in permission store: handler: %s, count: %d / %d, always ask: %d", |
| 188 | choice_id, choice_count, choice_threshold, ask); |
| 189 | |
| 190 | return (choice_id != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 191 | } |
| 192 | |
| 193 | static gbooleancxx . . $ gboolean# |
| 194 | is_sandboxedcxx . . $ is_sandboxed(a4c0fc30d3fa64a2). (GDesktopAppInfocxx . . $ GDesktopAppInfo# *info) |
| 195 | { |
| 196 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *flatpak = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 197 | |
| 198 | flatpak = g_desktop_app_info_get_stringcxx . . $ g_desktop_app_info_get_string(2aaba2c2b17e46e9). (G_DESKTOP_APP_INFOcxx . . $ `<external>/8681645713364988092/gdesktopappinfo.h:31:9`! (info), "X-Flatpak"); |
| 199 | |
| 200 | return flatpak != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 201 | } |
| 202 | |
| 203 | /* This returns the desktop file basename without extension. |
| 204 | * We cant' just use the flatpak ID, since flatpaks are allowed |
| 205 | * to export 'sub ids', like the org.libreoffice.LibreOffice |
| 206 | * flatpak exporting org.libreoffice.LibreOffice.Impress.desktop, |
| 207 | * and we need to track the actual handlers. |
| 208 | * |
| 209 | * We still strip the .desktop extension, since that is what |
| 210 | * the backends expect. |
| 211 | */ |
| 212 | static char * |
| 213 | get_app_idcxx . . $ get_app_id(8a7c9d8fd417e913). (GAppInfocxx . . $ GAppInfo# *info) |
| 214 | { |
| 215 | const char *desktop_id; |
| 216 | |
| 217 | desktop_id = g_app_info_get_idcxx . . $ g_app_info_get_id(946cbaa9210a41). (info); |
| 218 | |
| 219 | return xdp_get_app_id_from_desktop_idcxx . . $ xdp_get_app_id_from_desktop_id(a8b8e32347182212). (desktop_id); |
| 220 | } |
| 221 | |
| 222 | static gbooleancxx . . $ gboolean# |
| 223 | is_file_uricxx . . $ is_file_uri(5c4306d8553b3696). (const char *uri) |
| 224 | { |
| 225 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *scheme = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 226 | |
| 227 | scheme = g_uri_parse_schemecxx . . $ g_uri_parse_scheme(a8b8e32347182212). (uri); |
| 228 | |
| 229 | if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (scheme, "file") == 0) |
| 230 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 231 | |
| 232 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 233 | } |
| 234 | |
| 235 | static gbooleancxx . . $ gboolean# |
| 236 | launch_application_with_uricxx . . $ launch_application_with_uri(4d7e5581eb89311d). (const char *choice_id, |
| 237 | const char *uri, |
| 238 | const char *parent_window, |
| 239 | gbooleancxx . . $ gboolean# writable, |
| 240 | const char *activation_token, |
| 241 | GErrorcxx . . $ GError# **error) |
| 242 | { |
| 243 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *desktop_id = g_strconcatcxx . . $ g_strconcat(a849077ff1b8d812). (choice_id, ".desktop", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 244 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GDesktopAppInfo) info = g_desktop_app_info_newcxx . . $ g_desktop_app_info_new(eecce1e92d8304e9). (desktop_id); |
| 245 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpAppLaunchContext) xdp_context = xdp_app_launch_context_newcxx . . $ xdp_app_launch_context_new(76568252a1f361cc). (); |
| 246 | GAppLaunchContextcxx . . $ GAppLaunchContext# *context = G_APP_LAUNCH_CONTEXTcxx . . $ `<external>/6793221688627496808/gappinfo.h:40:9`! (xdp_context); |
| 247 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *ruri = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 248 | XdpDocumentFlagscxx . . $ XdpDocumentFlags# flags = XDP_DOCUMENT_FLAG_NONEcxx . . $ XDP_DOCUMENT_FLAG_NONE.; |
| 249 | GListcxx . . $ GList# uris; |
| 250 | |
| 251 | if (info == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 252 | { |
| 253 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Cannot launch %s because desktop file does not exist", desktop_id); |
| 254 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:98:9`!, XDG_DESKTOP_PORTAL_ERROR_NOT_FOUNDcxx . . $ XDG_DESKTOP_PORTAL_ERROR_NOT_FOUND., "Desktop file %s does not exist", desktop_id); |
| 255 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 256 | } |
| 257 | |
| 258 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Launching %s %s", choice_id, uri); |
| 259 | |
| 260 | if (is_sandboxedcxx . . $ is_sandboxed(a4c0fc30d3fa64a2). (info) && is_file_uricxx . . $ is_file_uri(5c4306d8553b3696). (uri)) |
| 261 | { |
| 262 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) local_error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 263 | |
| 264 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Registering %s for %s", uri, choice_id); |
| 265 | if (writable) |
| 266 | flags |= XDP_DOCUMENT_FLAG_WRITABLEcxx . . $ XDP_DOCUMENT_FLAG_WRITABLE.; |
| 267 | |
| 268 | ruri = xdp_register_documentcxx . . $ xdp_register_document(e16c043bff209580). (uri, choice_id, flags, &local_error); |
| 269 | if (ruri == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 270 | { |
| 271 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Error registering %s for %s: %s", uri, choice_id, local_error->message); |
| 272 | g_propagate_errorcxx . . $ g_propagate_error(902e08a176509aff). (error, g_steal_pointercxx . . $ `<external>/1123956534522462559/gmem.h:250:9`! (&local_error)); |
| 273 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 274 | } |
| 275 | } |
| 276 | else |
| 277 | ruri = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (uri); |
| 278 | |
| 279 | g_app_launch_context_setenvcxx . . $ g_app_launch_context_setenv(d7afcd4fa847190). (context, "PARENT_WINDOW_ID", parent_window); |
| 280 | |
| 281 | xdp_app_launch_context_set_activation_tokencxx . . $ xdp_app_launch_context_set_activation_token(e948952cc5d8af89). (xdp_context, activation_token); |
| 282 | |
| 283 | uris.datacxx . . $ _GList#data. = (gpointercxx . . $ gpointer#)ruri; |
| 284 | uris.nextcxx . . $ _GList#next. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 285 | |
| 286 | g_app_info_launch_uriscxx . . $ g_app_info_launch_uris(6cc48b63116ab7bf). (G_APP_INFOcxx . . $ `<external>/6793221688627496808/gappinfo.h:35:9`! (info), &uris, context, error); |
| 287 | |
| 288 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 289 | } |
| 290 | |
| 291 | static void |
| 292 | update_permissions_storecxx . . $ update_permissions_store(facfdab5246d4be7). (const char *app_id, |
| 293 | const char *content_type, |
| 294 | const char *chosen_id) |
| 295 | { |
| 296 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 297 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *latest_id = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 298 | gintcxx . . $ gint# latest_count; |
| 299 | gintcxx . . $ gint# latest_threshold; |
| 300 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GStrv) in_permissions = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 301 | gbooleancxx . . $ gboolean# ask; |
| 302 | |
| 303 | if (get_latest_choice_infocxx . . $ get_latest_choice_info(7a91054e8df9575a). (app_id, content_type, |
| 304 | &latest_id, &latest_count, &latest_threshold, &ask) && |
| 305 | (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (chosen_id, latest_id) == 0)) |
| 306 | { |
| 307 | /* same app chosen once again: update the counter */ |
| 308 | if (latest_count >= latest_threshold) |
| 309 | latest_count = latest_threshold; |
| 310 | else |
| 311 | latest_count++; |
| 312 | } |
| 313 | else |
| 314 | { |
| 315 | latest_id = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (chosen_id); |
| 316 | latest_count = 1; |
| 317 | } |
| 318 | |
| 319 | in_permissions = (GStrvcxx . . $ GStrv#) g_new0cxx . . $ `<external>/1123956534522462559/gmem.h:335:9`! (char *, LAST_PERM + 1); |
| 320 | in_permissions[PERM_APP_IDcxx . . $ PERM_APP_ID.] = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (latest_id); |
| 321 | in_permissions[PERM_APP_COUNTcxx . . $ PERM_APP_COUNT.] = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). ("%u", latest_count); |
| 322 | in_permissions[PERM_APP_THRESHOLDcxx . . $ PERM_APP_THRESHOLD.] = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). ("%u", latest_threshold); |
| 323 | |
| 324 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("updating permissions for %s: content-type %s, handler %s, count %s / %s", |
| 325 | app_id, |
| 326 | content_type, |
| 327 | in_permissions[PERM_APP_ID], |
| 328 | in_permissions[PERM_APP_COUNT], |
| 329 | in_permissions[PERM_APP_THRESHOLD]); |
| 330 | |
| 331 | |
| 332 | if (!xdp_dbus_impl_permission_store_call_set_permission_synccxx . . $ xdp_dbus_impl_permission_store_call_set_permission_sync(244a1218c71d5ad7). (xdp_get_permission_storecxx . . $ xdp_get_permission_store(ac6178aae3a00722). (), |
| 333 | PERMISSION_TABLEcxx . . $ `src/open-uri.c:55:9`!, |
| 334 | TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, |
| 335 | content_type, |
| 336 | app_id, |
| 337 | (const char * const*) in_permissions, |
| 338 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 339 | &error)) |
| 340 | { |
| 341 | g_dbus_error_strip_remote_errorcxx . . $ g_dbus_error_strip_remote_error(425e103a815b829). (error); |
| 342 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Error updating permission store: %s", error->message); |
| 343 | g_clear_errorcxx . . $ g_clear_error(19f343512d040fc2). (&error); |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | static void |
| 348 | send_response_in_thread_funccxx . . $ send_response_in_thread_func(4704ff26353eb8ae). (GTaskcxx . . $ GTask# *task, |
| 349 | gpointercxx . . $ gpointer# source_object, |
| 350 | gpointercxx . . $ gpointer# task_data, |
| 351 | GCancellablecxx . . $ GCancellable# *cancellable) |
| 352 | { |
| 353 | XdpRequestcxx . . $ XdpRequest# *request = XDP_REQUESTcxx . . $ XDP_REQUEST(e3ad50a9247c4f2e). (task_data); |
| 354 | guintcxx . . $ guint# response; |
| 355 | GVariantcxx . . $ GVariant# *options; |
| 356 | const char *choice; |
| 357 | |
| 358 | REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:103:9`! (request); |
| 359 | |
| 360 | response = GPOINTER_TO_INTcxx . . $ `<external>/10505296616216143549/glibconfig.h:103:9`! (g_object_get_data (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "response")); |
| 361 | options = (GVariantcxx . . $ GVariant# *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "options"); |
| 362 | |
| 363 | if (response != 0) |
| 364 | goto out; |
| 365 | |
| 366 | if (g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (options, "choice", "&s", &choice)) |
| 367 | { |
| 368 | const char *uri; |
| 369 | const char *parent_window; |
| 370 | gbooleancxx . . $ gboolean# writable; |
| 371 | const char *content_type; |
| 372 | const char *activation_token = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 373 | |
| 374 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Received choice %s", choice); |
| 375 | |
| 376 | uri = (const char *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "uri"); |
| 377 | parent_window = (const char *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "parent-window"); |
| 378 | writable = GPOINTER_TO_INTcxx . . $ `<external>/10505296616216143549/glibconfig.h:103:9`! (g_object_get_data (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "writable")); |
| 379 | content_type = (const char *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "content-type"); |
| 380 | |
| 381 | g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (options, "activation_token", "&s", &activation_token); |
| 382 | |
| 383 | if (launch_application_with_uricxx . . $ launch_application_with_uri(4d7e5581eb89311d). (choice, uri, parent_window, writable, activation_token, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)) |
| 384 | update_permissions_storecxx . . $ update_permissions_store(facfdab5246d4be7). (xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.), content_type, choice); |
| 385 | } |
| 386 | |
| 387 | out: |
| 388 | if (request->exportedcxx . . $ _XdpRequest#exported.) |
| 389 | { |
| 390 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) opt_builder = |
| 391 | G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!); |
| 392 | |
| 393 | xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6732:9`! (request), |
| 394 | response, |
| 395 | g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opt_builder)); |
| 396 | xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request); |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | static void |
| 401 | app_chooser_donecxx . . $ app_chooser_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source, |
| 402 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 403 | gpointercxx . . $ gpointer# data) |
| 404 | { |
| 405 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpRequest) request = data; |
| 406 | guintcxx . . $ guint# response = 2; |
| 407 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) options = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 408 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 409 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GTask) task = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 410 | |
| 411 | if (!xdp_dbus_impl_app_chooser_call_choose_application_finishcxx . . $ xdp_dbus_impl_app_chooser_call_choose_application_finish(ce661ef514505337). (XDP_DBUS_IMPL_APP_CHOOSERcxx . . $ `build/src/xdp-impl-dbus.h:390:9`! (source), |
| 412 | &response, |
| 413 | &options, |
| 414 | result, |
| 415 | &error)) |
| 416 | { |
| 417 | g_dbus_error_strip_remote_errorcxx . . $ g_dbus_error_strip_remote_error(425e103a815b829). (error); |
| 418 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Backend call failed: %s", error->message); |
| 419 | } |
| 420 | |
| 421 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "response", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (response)); |
| 422 | if (options) |
| 423 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "options", g_variant_refcxx . . $ g_variant_ref(3606eab35379b54a). (options), (GDestroyNotifycxx . . $ GDestroyNotify#)g_variant_unrefcxx . . $ g_variant_unref(86dbca581f53fd84).); |
| 424 | |
| 425 | task = g_task_newcxx . . $ g_task_new(292d224db8478659). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 426 | g_task_set_task_datacxx . . $ g_task_set_task_data(2e97a86ccb74176a). (task, g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request), g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).); |
| 427 | g_task_run_in_threadcxx . . $ g_task_run_in_thread(9210d4c97157796e). (task, send_response_in_thread_funccxx . . $ send_response_in_thread_func(4704ff26353eb8ae).); |
| 428 | } |
| 429 | |
| 430 | static void |
| 431 | resolve_scheme_and_content_typecxx . . $ resolve_scheme_and_content_type(8de4e710b16159e6). (const char *uri, |
| 432 | char **scheme, |
| 433 | char **content_type) |
| 434 | { |
| 435 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *uri_scheme = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 436 | |
| 437 | uri_scheme = g_uri_parse_schemecxx . . $ g_uri_parse_scheme(a8b8e32347182212). (uri); |
| 438 | if (uri_scheme && uri_scheme[0] != '\0') |
| 439 | *scheme = g_ascii_strdowncxx . . $ g_ascii_strdown(a8ddf37f112087c3). (uri_scheme, -1); |
| 440 | |
| 441 | if (*scheme == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 442 | return; |
| 443 | |
| 444 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88). (*scheme, "file") == 0) |
| 445 | { |
| 446 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Not handling file uri %s", uri); |
| 447 | return; |
| 448 | } |
| 449 | |
| 450 | *content_type = g_strconcatcxx . . $ g_strconcat(a849077ff1b8d812). ("x-scheme-handler/", *scheme, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 451 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Content type for %s uri %s: %s", uri, *scheme, *content_type); |
| 452 | } |
| 453 | |
| 454 | static void |
| 455 | get_content_type_for_filecxx . . $ get_content_type_for_file(4a08200150b6cca3). (const char *path, |
| 456 | char **content_type) |
| 457 | { |
| 458 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 459 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GFile) file = g_file_new_for_pathcxx . . $ g_file_new_for_path(ba1fd5950b7d7bd5). (path); |
| 460 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GFileInfo) info = g_file_query_infocxx . . $ g_file_query_info(ba301068419f3de0). (file, |
| 461 | G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPEcxx . . $ `<external>/10155032491143044340/gfileinfo.h:220:9`!, |
| 462 | 0, |
| 463 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 464 | &error); |
| 465 | |
| 466 | if (info != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 467 | { |
| 468 | *content_type = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (g_file_info_get_content_type (info)); |
| 469 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Content type for file %s: %s", path, *content_type); |
| 470 | } |
| 471 | else |
| 472 | { |
| 473 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Failed to fetch content type for file %s: %s", path, error->message); |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | static gbooleancxx . . $ gboolean# |
| 478 | should_use_default_appcxx . . $ should_use_default_app(5ae29d726ae57f88). (const char *scheme, |
| 479 | const char *content_type) |
| 480 | { |
| 481 | const char *skipped_schemes[] = { |
| 482 | "http", |
| 483 | "https", |
| 484 | "ftp", |
| 485 | "mailto", |
| 486 | "webcal", |
| 487 | "calendar", |
| 488 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! |
| 489 | }; |
| 490 | |
| 491 | /* We skip the app chooser for Internet URIs, to be open in the browser, |
| 492 | * mail client, or calendar, as well as for directories to be opened in |
| 493 | * the file manager */ |
| 494 | if (g_strv_containscxx . . $ g_strv_contains(c305579a79625c02). (skipped_schemes, scheme) || |
| 495 | g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (content_type, "inode/directory") == 0) |
| 496 | { |
| 497 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Can skip app chooser for %s", content_type); |
| 498 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 499 | } |
| 500 | |
| 501 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 502 | } |
| 503 | |
| 504 | static void |
| 505 | find_recommended_choicescxx . . $ find_recommended_choices(48682a4472cdb0f3). (const char *scheme, |
| 506 | const char *content_type, |
| 507 | char **default_app, |
| 508 | GStrvcxx . . $ GStrv# *choices, |
| 509 | guintcxx . . $ guint# *choices_len) |
| 510 | { |
| 511 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GAppInfo) info = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 512 | g_autolistcxx . . $ `<external>/12741050725406041920/gmacros.h:1425:9`!(GAppInfo) infos = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 513 | GListcxx . . $ GList# *l; |
| 514 | guintcxx . . $ guint# n_choices = 0; |
| 515 | GStrvcxx . . $ GStrv# result = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 516 | int i; |
| 517 | |
| 518 | info = g_app_info_get_default_for_typecxx . . $ g_app_info_get_default_for_type(9f5189d3a3bca4f7). (content_type, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 519 | |
| 520 | if (info != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 521 | { |
| 522 | *default_app = get_app_idcxx . . $ get_app_id(8a7c9d8fd417e913). (info); |
| 523 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Default handler %s for %s, %s", *default_app, scheme, content_type); |
| 524 | } |
| 525 | else |
| 526 | { |
| 527 | *default_app = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 528 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("No default handler for %s, %s", scheme, content_type); |
| 529 | } |
| 530 | |
| 531 | infos = g_app_info_get_recommended_for_typecxx . . $ g_app_info_get_recommended_for_type(39546108f7976f40). (content_type); |
| 532 | /* Use fallbacks if we have no recommended application for this type */ |
| 533 | if (!infos) |
| 534 | infos = g_app_info_get_all_for_typecxx . . $ g_app_info_get_all_for_type(39546108f7976f40). (content_type); |
| 535 | |
| 536 | n_choices = g_list_lengthcxx . . $ g_list_length(950b32bff6717769). (infos); |
| 537 | result = g_newcxx . . $ `<external>/1123956534522462559/gmem.h:318:9`! (char *, n_choices + 1); |
| 538 | for (l = infos, i = 0; l; l = l->nextcxx . . $ _GList#next.) |
| 539 | { |
| 540 | result[i++] = get_app_idcxx . . $ get_app_id(8a7c9d8fd417e913). (G_APP_INFOcxx . . $ `<external>/6793221688627496808/gappinfo.h:35:9`! (l->data)); |
| 541 | } |
| 542 | result[i] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 543 | |
| 544 | { |
| 545 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *a = g_strjoinvcxx . . $ g_strjoinv(3bdede71480c687a). (", ", result); |
| 546 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Recommended handlers for %s, %s: %s", scheme, content_type, a); |
| 547 | } |
| 548 | |
| 549 | *choices = result; |
| 550 | *choices_len = n_choices; |
| 551 | } |
| 552 | |
| 553 | static void |
| 554 | app_info_changedcxx . . $ app_info_changed(f347c97cd8e82819). (GAppInfoMonitorcxx . . $ GAppInfoMonitor# *monitor, |
| 555 | XdpRequestcxx . . $ XdpRequest# *request) |
| 556 | { |
| 557 | const char *scheme; |
| 558 | const char *content_type; |
| 559 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *default_app = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 560 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GStrv) choices = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 561 | guintcxx . . $ guint# n_choices; |
| 562 | |
| 563 | scheme = (const char *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "scheme"); |
| 564 | content_type = (const char *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "content-type"); |
| 565 | find_recommended_choicescxx . . $ find_recommended_choices(48682a4472cdb0f3). (scheme, content_type, &default_app, &choices, &n_choices); |
| 566 | |
| 567 | xdp_dbus_impl_app_chooser_call_update_choicescxx . . $ xdp_dbus_impl_app_chooser_call_update_choices(a9be7dd1ddcad475). (implcxx . . $ impl., |
| 568 | request->idcxx . . $ _XdpRequest#id., |
| 569 | (const char * const *)choices, |
| 570 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 571 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 572 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 573 | } |
| 574 | |
| 575 | static gbooleancxx . . $ gboolean# |
| 576 | app_existscxx . . $ app_exists(5c4306d8553b3696). (const char *app_id) |
| 577 | { |
| 578 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GDesktopAppInfo) info = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 579 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! gcharcxx . . $ gchar# *with_desktop = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 580 | |
| 581 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (app_id != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 582 | |
| 583 | with_desktop = g_strconcatcxx . . $ g_strconcat(a849077ff1b8d812). (app_id, ".desktop", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 584 | info = g_desktop_app_info_newcxx . . $ g_desktop_app_info_new(eecce1e92d8304e9). (with_desktop); |
| 585 | return (info != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 586 | } |
| 587 | |
| 588 | static void |
| 589 | handle_open_in_thread_funccxx . . $ handle_open_in_thread_func(4704ff26353eb8ae). (GTaskcxx . . $ GTask# *task, |
| 590 | gpointercxx . . $ gpointer# source_object, |
| 591 | gpointercxx . . $ gpointer# task_data, |
| 592 | GCancellablecxx . . $ GCancellable# *cancellable) |
| 593 | { |
| 594 | XdpRequestcxx . . $ XdpRequest# *request = XDP_REQUESTcxx . . $ XDP_REQUEST(e3ad50a9247c4f2e). (task_data); |
| 595 | const char *parent_window; |
| 596 | const char *app_id = xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.); |
| 597 | const char *activation_token; |
| 598 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *uri = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 599 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpDbusImplRequest) impl_request = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 600 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *default_app = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 601 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GStrv) choices = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 602 | guintcxx . . $ guint# n_choices; |
| 603 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *scheme = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 604 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *content_type = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 605 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *latest_id = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 606 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *basename = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 607 | gintcxx . . $ gint# latest_count; |
| 608 | gintcxx . . $ gint# latest_threshold; |
| 609 | gbooleancxx . . $ gboolean# ask_for_content_type; |
| 610 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) opts_builder = |
| 611 | G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!); |
| 612 | gbooleancxx . . $ gboolean# skip_app_chooser = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 613 | g_autofdcxx . . $ `<external>/6704587548159124736/gstdio.h:291:9`! int fd = -1; |
| 614 | gbooleancxx . . $ gboolean# writable = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 615 | gbooleancxx . . $ gboolean# ask = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 616 | gbooleancxx . . $ gboolean# open_dir = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 617 | gbooleancxx . . $ gboolean# use_default_app = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 618 | const char *reason; |
| 619 | |
| 620 | REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:103:9`! (request); |
| 621 | |
| 622 | parent_window = (const char *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "parent-window"); |
| 623 | uri = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! ((const char *)g_object_get_data (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "uri")); |
| 624 | fd = GPOINTER_TO_INTcxx . . $ `<external>/10505296616216143549/glibconfig.h:103:9`! (g_object_get_data (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "fd")); |
| 625 | writable = GPOINTER_TO_INTcxx . . $ `<external>/10505296616216143549/glibconfig.h:103:9`! (g_object_get_data (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "writable")); |
| 626 | ask = GPOINTER_TO_INTcxx . . $ `<external>/10505296616216143549/glibconfig.h:103:9`! (g_object_get_data (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "ask")); |
| 627 | open_dir = GPOINTER_TO_INTcxx . . $ `<external>/10505296616216143549/glibconfig.h:103:9`! (g_object_get_data (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "open-dir")); |
| 628 | activation_token = (const char *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "activation-token"); |
| 629 | |
| 630 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "fd", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (-1)); |
| 631 | |
| 632 | /* Verify that either uri or fd is set, not both */ |
| 633 | if (uri != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && fd != -1) |
| 634 | { |
| 635 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Rejecting invalid open-uri request (both URI and fd are set)"); |
| 636 | if (request->exportedcxx . . $ _XdpRequest#exported.) |
| 637 | { |
| 638 | xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6732:9`! (request), |
| 639 | XDG_DESKTOP_PORTAL_RESPONSE_OTHERcxx . . $ XDG_DESKTOP_PORTAL_RESPONSE_OTHER., |
| 640 | g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opts_builder)); |
| 641 | xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request); |
| 642 | } |
| 643 | return; |
| 644 | } |
| 645 | |
| 646 | if (uri) |
| 647 | { |
| 648 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`! (GError) local_error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 649 | |
| 650 | if (!g_uri_is_validcxx . . $ g_uri_is_valid(10ff756d9b897251). (uri, G_URI_FLAGS_NONEcxx . . $ G_URI_FLAGS_NONE., &local_error)) |
| 651 | { |
| 652 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Rejecting open request for invalid uri '%s': %s", uri, local_error->message); |
| 653 | |
| 654 | /* Reject the request */ |
| 655 | if (request->exportedcxx . . $ _XdpRequest#exported.) |
| 656 | { |
| 657 | xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6732:9`! (request), |
| 658 | XDG_DESKTOP_PORTAL_RESPONSE_OTHERcxx . . $ XDG_DESKTOP_PORTAL_RESPONSE_OTHER., |
| 659 | g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opts_builder)); |
| 660 | xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request); |
| 661 | } |
| 662 | return; |
| 663 | } |
| 664 | |
| 665 | resolve_scheme_and_content_typecxx . . $ resolve_scheme_and_content_type(8de4e710b16159e6). (uri, &scheme, &content_type); |
| 666 | if (content_type == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 667 | { |
| 668 | /* Reject the request */ |
| 669 | if (request->exportedcxx . . $ _XdpRequest#exported.) |
| 670 | { |
| 671 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Rejecting open request as content-type couldn't be fetched for '%s'", uri); |
| 672 | xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6732:9`! (request), |
| 673 | XDG_DESKTOP_PORTAL_RESPONSE_OTHERcxx . . $ XDG_DESKTOP_PORTAL_RESPONSE_OTHER., |
| 674 | g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opts_builder)); |
| 675 | xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request); |
| 676 | } |
| 677 | return; |
| 678 | } |
| 679 | } |
| 680 | else |
| 681 | { |
| 682 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *path = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 683 | gbooleancxx . . $ gboolean# fd_is_writable; |
| 684 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) local_error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 685 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *host_path = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 686 | |
| 687 | path = xdp_app_info_get_path_for_fdcxx . . $ xdp_app_info_get_path_for_fd(2620023ef1f997b4). (request->app_infocxx . . $ _XdpRequest#app_info., fd, 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &fd_is_writable, &local_error); |
| 688 | |
| 689 | if (path != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 690 | { |
| 691 | host_path = xdp_get_real_path_for_doc_pathcxx . . $ xdp_get_real_path_for_doc_path(87547275904bc700). (path, request->app_infocxx . . $ _XdpRequest#app_info.); |
| 692 | if (host_path) |
| 693 | { |
| 694 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("OpenFile: translating path value '%s' to host path '%s'", path, host_path); |
| 695 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&path, g_free); |
| 696 | path = g_steal_pointercxx . . $ `<external>/1123956534522462559/gmem.h:250:9`! (&host_path); |
| 697 | } |
| 698 | } |
| 699 | |
| 700 | if (path == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || |
| 701 | (writable && !fd_is_writable) || |
| 702 | (!xdp_app_info_is_hostcxx . . $ xdp_app_info_is_host(ac6b23a20a03546d). (request->app_infocxx . . $ _XdpRequest#app_info.) && !writable && fd_is_writable)) |
| 703 | { |
| 704 | /* Reject the request */ |
| 705 | if (path == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 706 | { |
| 707 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Rejecting open request: %s", local_error->message); |
| 708 | } |
| 709 | else |
| 710 | { |
| 711 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Rejecting open request for %s as opening %swritable but fd is %swritable", |
| 712 | path, writable ? "" : "not ", fd_is_writable ? "" : "not "); |
| 713 | } |
| 714 | |
| 715 | if (request->exportedcxx . . $ _XdpRequest#exported.) |
| 716 | { |
| 717 | xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6732:9`! (request), |
| 718 | XDG_DESKTOP_PORTAL_RESPONSE_OTHERcxx . . $ XDG_DESKTOP_PORTAL_RESPONSE_OTHER., |
| 719 | g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opts_builder)); |
| 720 | xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request); |
| 721 | } |
| 722 | return; |
| 723 | } |
| 724 | |
| 725 | if (open_dir) |
| 726 | { |
| 727 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *real_path = xdp_get_real_path_for_doc_pathcxx . . $ xdp_get_real_path_for_doc_path(87547275904bc700). (path, request->app_infocxx . . $ _XdpRequest#app_info.); |
| 728 | /* Try opening the directory via the file manager interface, then |
| 729 | fall back to a plain URI open */ |
| 730 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) local_error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 731 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) result = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 732 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariantBuilder) uris_builder = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 733 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char* item_uri = g_filename_to_uricxx . . $ g_filename_to_uri(aa426d2e062653f5). (real_path, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 734 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GDBusConnection) bus = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 735 | |
| 736 | bus = g_bus_get_synccxx . . $ g_bus_get_sync(193826227f1d0b52). (G_BUS_TYPE_SESSIONcxx . . $ G_BUS_TYPE_SESSION., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &local_error); |
| 737 | |
| 738 | uris_builder = g_variant_builder_newcxx . . $ g_variant_builder_new(a0b3f434545b5412). (G_VARIANT_TYPEcxx . . $ `<external>/14064154155447831270/gvarianttype.h:298:10`! ("as")); |
| 739 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (uris_builder, "s", item_uri); |
| 740 | |
| 741 | if (bus) |
| 742 | result = g_dbus_connection_call_synccxx . . $ g_dbus_connection_call_sync(a18d7fd6ea76844a). (bus, |
| 743 | FILE_MANAGER_DBUS_NAMEcxx . . $ `src/open-uri.c:49:9`!, |
| 744 | FILE_MANAGER_DBUS_PATHcxx . . $ `src/open-uri.c:51:9`!, |
| 745 | FILE_MANAGER_DBUS_IFACEcxx . . $ `src/open-uri.c:50:9`!, |
| 746 | FILE_MANAGER_SHOW_ITEMScxx . . $ `src/open-uri.c:53:9`!, |
| 747 | g_variant_newcxx . . $ g_variant_new(59b7d1999758b6d9). ("(ass)", uris_builder, activation_token ? activation_token : ""), |
| 748 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, /* ignore returned type */ |
| 749 | G_DBUS_CALL_FLAGS_NONEcxx . . $ G_DBUS_CALL_FLAGS_NONE., |
| 750 | -1, |
| 751 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 752 | &local_error); |
| 753 | |
| 754 | if (result == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 755 | { |
| 756 | if (g_error_matchescxx . . $ g_error_matches(604444fafc3e7b63). (local_error, G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 757 | G_DBUS_ERROR_NAME_HAS_NO_OWNERcxx . . $ G_DBUS_ERROR_NAME_HAS_NO_OWNER.) || |
| 758 | g_error_matchescxx . . $ g_error_matches(604444fafc3e7b63). (local_error, G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 759 | G_DBUS_ERROR_SERVICE_UNKNOWNcxx . . $ G_DBUS_ERROR_SERVICE_UNKNOWN.)) |
| 760 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("No " FILE_MANAGER_DBUS_NAMEcxx . . $ `src/open-uri.c:49:9`! " available"); |
| 761 | else |
| 762 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to call " FILE_MANAGER_SHOW_ITEMScxx . . $ `src/open-uri.c:53:9`! ": %s", |
| 763 | local_error->message); |
| 764 | } |
| 765 | else |
| 766 | { |
| 767 | xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6732:9`! (request), |
| 768 | XDG_DESKTOP_PORTAL_RESPONSE_SUCCESScxx . . $ XDG_DESKTOP_PORTAL_RESPONSE_SUCCESS., |
| 769 | g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opts_builder)); |
| 770 | xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request); |
| 771 | return; |
| 772 | } |
| 773 | |
| 774 | g_freecxx . . $ g_free(5d22bdacc48458e8). (path); |
| 775 | path = g_path_get_dirnamecxx . . $ g_path_get_dirname(a8b8e32347182212). (real_path); |
| 776 | } |
| 777 | |
| 778 | get_content_type_for_filecxx . . $ get_content_type_for_file(4a08200150b6cca3). (path, &content_type); |
| 779 | basename = g_path_get_basenamecxx . . $ g_path_get_basename(a8b8e32347182212). (path); |
| 780 | |
| 781 | scheme = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! ("file"); |
| 782 | uri = g_filename_to_uricxx . . $ g_filename_to_uri(aa426d2e062653f5). (path, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 783 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "uri", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (uri), g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 784 | } |
| 785 | |
| 786 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "scheme", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (scheme), g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 787 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "content-type", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (content_type), g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 788 | |
| 789 | /* collect all the information */ |
| 790 | find_recommended_choicescxx . . $ find_recommended_choices(48682a4472cdb0f3). (scheme, content_type, &default_app, &choices, &n_choices); |
| 791 | /* it's never NULL, but might be empty (only contain the NULL terminator) */ |
| 792 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (choices != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 793 | if (default_app != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && !app_existscxx . . $ app_exists(5c4306d8553b3696). (default_app)) |
| 794 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&default_app, g_free); |
| 795 | use_default_app = should_use_default_appcxx . . $ should_use_default_app(5ae29d726ae57f88). (scheme, content_type); |
| 796 | get_latest_choice_infocxx . . $ get_latest_choice_info(7a91054e8df9575a). (app_id, content_type, |
| 797 | &latest_id, &latest_count, &latest_threshold, |
| 798 | &ask_for_content_type); |
| 799 | if (latest_id != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && !app_existscxx . . $ app_exists(5c4306d8553b3696). (latest_id)) |
| 800 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&latest_id, g_free); |
| 801 | |
| 802 | skip_app_chooser = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 803 | reason = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 804 | |
| 805 | /* apply default handling: skip if the we have a default handler */ |
| 806 | if (default_app != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && use_default_app) |
| 807 | { |
| 808 | reason = "Allowing to skip app chooser: can use default"; |
| 809 | skip_app_chooser = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 810 | } |
| 811 | |
| 812 | if (n_choices == 1) |
| 813 | { |
| 814 | if (!skip_app_chooser) |
| 815 | reason = "Allowing to skip app chooser: no choice"; |
| 816 | skip_app_chooser = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 817 | } |
| 818 | |
| 819 | /* also skip if the user has made the same choice often enough */ |
| 820 | if (latest_id != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && latest_count >= latest_threshold) |
| 821 | { |
| 822 | if (!skip_app_chooser) |
| 823 | reason = "Allowing to skip app chooser: above threshold"; |
| 824 | skip_app_chooser = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 825 | } |
| 826 | |
| 827 | /* respect the app choices */ |
| 828 | if (ask) |
| 829 | { |
| 830 | if (skip_app_chooser) |
| 831 | reason = "Refusing to skip app chooser: app request"; |
| 832 | skip_app_chooser = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 833 | } |
| 834 | |
| 835 | /* respect the users choices: paranoid mode overrides everything else */ |
| 836 | if (ask_for_content_type || latest_threshold == G_MAXINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:39:9`!) |
| 837 | { |
| 838 | if (skip_app_chooser) |
| 839 | reason = "Refusing to skip app chooser: always-ask enabled"; |
| 840 | skip_app_chooser = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 841 | } |
| 842 | |
| 843 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("%s", reason); |
| 844 | |
| 845 | if (skip_app_chooser) |
| 846 | { |
| 847 | const char *app = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 848 | |
| 849 | if (default_app != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && use_default_app) |
| 850 | app = default_app; |
| 851 | else if (latest_id != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 852 | app = latest_id; |
| 853 | else if (default_app != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 854 | app = default_app; |
| 855 | else if (n_choices > 0 && app_existscxx . . $ app_exists(5c4306d8553b3696). (choices[0])) |
| 856 | app = choices[0]; |
| 857 | |
| 858 | if (app) |
| 859 | { |
| 860 | /* Launch the app directly */ |
| 861 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 862 | |
| 863 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Skipping app chooser"); |
| 864 | |
| 865 | gbooleancxx . . $ gboolean# result = launch_application_with_uricxx . . $ launch_application_with_uri(4d7e5581eb89311d). (app, uri, parent_window, writable, activation_token, &error); |
| 866 | if (request->exportedcxx . . $ _XdpRequest#exported.) |
| 867 | { |
| 868 | if (!result) |
| 869 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Open request for '%s' failed: %s", uri, error->message); |
| 870 | xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6732:9`! (request), |
| 871 | result ? XDG_DESKTOP_PORTAL_RESPONSE_SUCCESScxx . . $ XDG_DESKTOP_PORTAL_RESPONSE_SUCCESS. : XDG_DESKTOP_PORTAL_RESPONSE_OTHERcxx . . $ XDG_DESKTOP_PORTAL_RESPONSE_OTHER., |
| 872 | g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opts_builder)); |
| 873 | xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request); |
| 874 | } |
| 875 | |
| 876 | return; |
| 877 | } |
| 878 | } |
| 879 | |
| 880 | if (latest_id != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 881 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&opts_builder, "{sv}", "last_choice", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). (latest_id)); |
| 882 | else if (default_app != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 883 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&opts_builder, "{sv}", "last_choice", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). (default_app)); |
| 884 | |
| 885 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "content-type", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (content_type), g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 886 | |
| 887 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&opts_builder, "{sv}", "content_type", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). (content_type)); |
| 888 | if (basename) |
| 889 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&opts_builder, "{sv}", "filename", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). (basename)); |
| 890 | if (uri) |
| 891 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&opts_builder, "{sv}", "uri", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). (uri)); |
| 892 | if (activation_token) |
| 893 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&opts_builder, "{sv}", "activation_token", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). (activation_token)); |
| 894 | |
| 895 | impl_request = |
| 896 | xdp_dbus_impl_request_proxy_new_synccxx . . $ xdp_dbus_impl_request_proxy_new_sync(b36c38a372f8f089). (g_dbus_proxy_get_connectioncxx . . $ g_dbus_proxy_get_connection(fd0690ce15ac5ecf). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (impl)), |
| 897 | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIEScxx . . $ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES., |
| 898 | g_dbus_proxy_get_namecxx . . $ g_dbus_proxy_get_name(c2c3b8a4da378b0d). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (impl)), |
| 899 | request->idcxx . . $ _XdpRequest#id., |
| 900 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 901 | |
| 902 | xdp_request_set_impl_requestcxx . . $ xdp_request_set_impl_request(18bd0ab3b325ada4). (request, impl_request); |
| 903 | |
| 904 | g_signal_connect_objectcxx . . $ g_signal_connect_object(567cfbe0c886a38e). (monitorcxx . . $ monitor., "changed", G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (app_info_changed), request, 0); |
| 905 | |
| 906 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Opening app chooser"); |
| 907 | |
| 908 | xdp_dbus_impl_app_chooser_call_choose_applicationcxx . . $ xdp_dbus_impl_app_chooser_call_choose_application(ff0cb164ebac8965). (implcxx . . $ impl., |
| 909 | request->idcxx . . $ _XdpRequest#id., |
| 910 | app_id, |
| 911 | parent_window, |
| 912 | (const char * const *)choices, |
| 913 | g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opts_builder), |
| 914 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 915 | app_chooser_donecxx . . $ app_chooser_done(aa1d200d824d915d)., |
| 916 | g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request)); |
| 917 | } |
| 918 | |
| 919 | static gbooleancxx . . $ gboolean# |
| 920 | handle_scheme_supportedcxx . . $ handle_scheme_supported(f3cb790c41b26c4b). (XdpDbusOpenURIcxx . . $ XdpDbusOpenURI# *object, |
| 921 | GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation, |
| 922 | const gcharcxx . . $ gchar# *arg_scheme, |
| 923 | GVariantcxx . . $ GVariant# *arg_options) |
| 924 | { |
| 925 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GAppInfo) app_info = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 926 | |
| 927 | if (arg_scheme == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || *arg_scheme == '\0') |
| 928 | { |
| 929 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 930 | XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:98:9`!, |
| 931 | XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENTcxx . . $ XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENT., |
| 932 | "Scheme not specified"); |
| 933 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 934 | } |
| 935 | |
| 936 | app_info = g_app_info_get_default_for_uri_schemecxx . . $ g_app_info_get_default_for_uri_scheme(282f451903100788). (arg_scheme); |
| 937 | |
| 938 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Handler for scheme: %s%s found.", arg_scheme, app_info ? "" : " not"); |
| 939 | g_dbus_method_invocation_return_valuecxx . . $ g_dbus_method_invocation_return_value(dc2237947fc93dda). (invocation, g_variant_newcxx . . $ g_variant_new(59b7d1999758b6d9). ("(b)", app_info != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)); |
| 940 | |
| 941 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 942 | } |
| 943 | |
| 944 | static gbooleancxx . . $ gboolean# |
| 945 | handle_open_uricxx . . $ handle_open_uri(15b392a60de7ebcc). (XdpDbusOpenURIcxx . . $ XdpDbusOpenURI# *object, |
| 946 | GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation, |
| 947 | const gcharcxx . . $ gchar# *arg_parent_window, |
| 948 | const gcharcxx . . $ gchar# *arg_uri, |
| 949 | GVariantcxx . . $ GVariant# *arg_options) |
| 950 | { |
| 951 | XdpRequestcxx . . $ XdpRequest# *request = xdp_request_from_invocationcxx . . $ xdp_request_from_invocation(9583a51810815010). (invocation); |
| 952 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GTask) task = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 953 | gbooleancxx . . $ gboolean# writable; |
| 954 | gbooleancxx . . $ gboolean# ask; |
| 955 | const char *activation_token = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 956 | |
| 957 | if (xdp_dbus_impl_lockdown_get_disable_application_handlerscxx . . $ xdp_dbus_impl_lockdown_get_disable_application_handlers(611f976d47c30f42). (lockdowncxx . . $ lockdown.)) |
| 958 | { |
| 959 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Application handlers disabled"); |
| 960 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 961 | XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:98:9`!, |
| 962 | XDG_DESKTOP_PORTAL_ERROR_NOT_ALLOWEDcxx . . $ XDG_DESKTOP_PORTAL_ERROR_NOT_ALLOWED., |
| 963 | "Application handlers disabled"); |
| 964 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 965 | } |
| 966 | |
| 967 | if (!g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (arg_options, "writable", "b", &writable)) |
| 968 | writable = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 969 | |
| 970 | if (!g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (arg_options, "ask", "b", &ask)) |
| 971 | ask = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 972 | |
| 973 | g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (arg_options, "activation_token", "&s", &activation_token); |
| 974 | |
| 975 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "fd", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (-1)); |
| 976 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "uri", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (arg_uri), g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 977 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "parent-window", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (arg_parent_window), g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 978 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "writable", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (writable)); |
| 979 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "ask", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (ask)); |
| 980 | |
| 981 | if (activation_token) |
| 982 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "activation-token", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (activation_token), g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 983 | |
| 984 | xdp_request_exportcxx . . $ xdp_request_export(49d11f351a243e17). (request, g_dbus_method_invocation_get_connectioncxx . . $ g_dbus_method_invocation_get_connection(8c6afd006dd99032). (invocation)); |
| 985 | xdp_dbus_open_uri_complete_open_uricxx . . $ xdp_dbus_open_uri_complete_open_uri(73c2d4e78fa12a2e). (object, invocation, request->idcxx . . $ _XdpRequest#id.); |
| 986 | |
| 987 | task = g_task_newcxx . . $ g_task_new(292d224db8478659). (object, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 988 | g_task_set_task_datacxx . . $ g_task_set_task_data(2e97a86ccb74176a). (task, g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request), g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).); |
| 989 | g_task_run_in_threadcxx . . $ g_task_run_in_thread(9210d4c97157796e). (task, handle_open_in_thread_funccxx . . $ handle_open_in_thread_func(4704ff26353eb8ae).); |
| 990 | |
| 991 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 992 | } |
| 993 | |
| 994 | static gbooleancxx . . $ gboolean# |
| 995 | handle_open_filecxx . . $ handle_open_file(56a1e6e6cc901d93). (XdpDbusOpenURIcxx . . $ XdpDbusOpenURI# *object, |
| 996 | GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation, |
| 997 | GUnixFDListcxx . . $ GUnixFDList# *fd_list, |
| 998 | const gcharcxx . . $ gchar# *arg_parent_window, |
| 999 | GVariantcxx . . $ GVariant# *arg_fd, |
| 1000 | GVariantcxx . . $ GVariant# *arg_options) |
| 1001 | { |
| 1002 | XdpRequestcxx . . $ XdpRequest# *request = xdp_request_from_invocationcxx . . $ xdp_request_from_invocation(9583a51810815010). (invocation); |
| 1003 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GTask) task = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1004 | gbooleancxx . . $ gboolean# writable; |
| 1005 | gbooleancxx . . $ gboolean# ask; |
| 1006 | int fd_id, fd; |
| 1007 | const char *activation_token = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1008 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1009 | |
| 1010 | if (xdp_dbus_impl_lockdown_get_disable_application_handlerscxx . . $ xdp_dbus_impl_lockdown_get_disable_application_handlers(611f976d47c30f42). (lockdowncxx . . $ lockdown.)) |
| 1011 | { |
| 1012 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Application handlers disabled"); |
| 1013 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 1014 | XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:98:9`!, |
| 1015 | XDG_DESKTOP_PORTAL_ERROR_NOT_ALLOWEDcxx . . $ XDG_DESKTOP_PORTAL_ERROR_NOT_ALLOWED., |
| 1016 | "Application handlers disabled"); |
| 1017 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 1018 | } |
| 1019 | |
| 1020 | if (!g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (arg_options, "writable", "b", &writable)) |
| 1021 | writable = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 1022 | |
| 1023 | if (!g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (arg_options, "ask", "b", &ask)) |
| 1024 | ask = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 1025 | |
| 1026 | g_variant_getcxx . . $ g_variant_get(671e9cd8f09cd612). (arg_fd, "h", &fd_id); |
| 1027 | if (fd_id >= g_unix_fd_list_get_lengthcxx . . $ g_unix_fd_list_get_length(7ddaba1b89c413c0). (fd_list)) |
| 1028 | { |
| 1029 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 1030 | XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:98:9`!, |
| 1031 | XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENTcxx . . $ XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENT., |
| 1032 | "Bad file descriptor index"); |
| 1033 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 1034 | } |
| 1035 | |
| 1036 | fd = g_unix_fd_list_getcxx . . $ g_unix_fd_list_get(57b895fb290201ec). (fd_list, fd_id, &error); |
| 1037 | if (fd == -1) |
| 1038 | { |
| 1039 | g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error); |
| 1040 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 1041 | } |
| 1042 | |
| 1043 | g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (arg_options, "activation_token", "&s", &activation_token); |
| 1044 | |
| 1045 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "fd", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (fd)); |
| 1046 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "parent-window", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (arg_parent_window), g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 1047 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "writable", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (writable)); |
| 1048 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "ask", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (ask)); |
| 1049 | |
| 1050 | if (activation_token) |
| 1051 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "activation-token", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (activation_token), g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 1052 | |
| 1053 | xdp_request_exportcxx . . $ xdp_request_export(49d11f351a243e17). (request, g_dbus_method_invocation_get_connectioncxx . . $ g_dbus_method_invocation_get_connection(8c6afd006dd99032). (invocation)); |
| 1054 | xdp_dbus_open_uri_complete_open_filecxx . . $ xdp_dbus_open_uri_complete_open_file(8143baca4c5da55). (object, invocation, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, request->idcxx . . $ _XdpRequest#id.); |
| 1055 | |
| 1056 | task = g_task_newcxx . . $ g_task_new(292d224db8478659). (object, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1057 | g_task_set_task_datacxx . . $ g_task_set_task_data(2e97a86ccb74176a). (task, g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request), g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).); |
| 1058 | g_task_run_in_threadcxx . . $ g_task_run_in_thread(9210d4c97157796e). (task, handle_open_in_thread_funccxx . . $ handle_open_in_thread_func(4704ff26353eb8ae).); |
| 1059 | |
| 1060 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 1061 | } |
| 1062 | |
| 1063 | static gbooleancxx . . $ gboolean# |
| 1064 | handle_open_directorycxx . . $ handle_open_directory(56a1e6e6cc901d93). (XdpDbusOpenURIcxx . . $ XdpDbusOpenURI# *object, |
| 1065 | GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation, |
| 1066 | GUnixFDListcxx . . $ GUnixFDList# *fd_list, |
| 1067 | const gcharcxx . . $ gchar# *arg_parent_window, |
| 1068 | GVariantcxx . . $ GVariant# *arg_fd, |
| 1069 | GVariantcxx . . $ GVariant# *arg_options) |
| 1070 | { |
| 1071 | XdpRequestcxx . . $ XdpRequest# *request = xdp_request_from_invocationcxx . . $ xdp_request_from_invocation(9583a51810815010). (invocation); |
| 1072 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GTask) task = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1073 | int fd_id, fd; |
| 1074 | const char *activation_token = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1075 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1076 | |
| 1077 | if (xdp_dbus_impl_lockdown_get_disable_application_handlerscxx . . $ xdp_dbus_impl_lockdown_get_disable_application_handlers(611f976d47c30f42). (lockdowncxx . . $ lockdown.)) |
| 1078 | { |
| 1079 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Application handlers disabled"); |
| 1080 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 1081 | XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:98:9`!, |
| 1082 | XDG_DESKTOP_PORTAL_ERROR_NOT_ALLOWEDcxx . . $ XDG_DESKTOP_PORTAL_ERROR_NOT_ALLOWED., |
| 1083 | "Application handlers disabled"); |
| 1084 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 1085 | } |
| 1086 | |
| 1087 | g_variant_getcxx . . $ g_variant_get(671e9cd8f09cd612). (arg_fd, "h", &fd_id); |
| 1088 | if (fd_id >= g_unix_fd_list_get_lengthcxx . . $ g_unix_fd_list_get_length(7ddaba1b89c413c0). (fd_list)) |
| 1089 | { |
| 1090 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 1091 | XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:98:9`!, |
| 1092 | XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENTcxx . . $ XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENT., |
| 1093 | "Bad file descriptor index"); |
| 1094 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 1095 | } |
| 1096 | |
| 1097 | fd = g_unix_fd_list_getcxx . . $ g_unix_fd_list_get(57b895fb290201ec). (fd_list, fd_id, &error); |
| 1098 | if (fd == -1) |
| 1099 | { |
| 1100 | g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error); |
| 1101 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 1102 | } |
| 1103 | |
| 1104 | g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (arg_options, "activation_token", "&s", &activation_token); |
| 1105 | |
| 1106 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "fd", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (fd)); |
| 1107 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "parent-window", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (arg_parent_window), g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 1108 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "writable", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (0)); |
| 1109 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "ask", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (0)); |
| 1110 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "open-dir", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (1)); |
| 1111 | |
| 1112 | if (activation_token) |
| 1113 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "activation-token", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (activation_token), g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 1114 | |
| 1115 | xdp_request_exportcxx . . $ xdp_request_export(49d11f351a243e17). (request, g_dbus_method_invocation_get_connectioncxx . . $ g_dbus_method_invocation_get_connection(8c6afd006dd99032). (invocation)); |
| 1116 | xdp_dbus_open_uri_complete_open_directorycxx . . $ xdp_dbus_open_uri_complete_open_directory(8143baca4c5da55). (object, invocation, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, request->idcxx . . $ _XdpRequest#id.); |
| 1117 | |
| 1118 | task = g_task_newcxx . . $ g_task_new(292d224db8478659). (object, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1119 | g_task_set_task_datacxx . . $ g_task_set_task_data(2e97a86ccb74176a). (task, g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request), g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).); |
| 1120 | g_task_run_in_threadcxx . . $ g_task_run_in_thread(9210d4c97157796e). (task, handle_open_in_thread_funccxx . . $ handle_open_in_thread_func(4704ff26353eb8ae).); |
| 1121 | |
| 1122 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 1123 | } |
| 1124 | |
| 1125 | static void |
| 1126 | open_uri_iface_initcxx . . $ open_uri_iface_init(f49c09bbc3407075). (XdpDbusOpenURIIfacecxx . . $ XdpDbusOpenURIIface# *iface) |
| 1127 | { |
| 1128 | iface->handle_open_uricxx . . $ _XdpDbusOpenURIIface#handle_open_uri. = handle_open_uricxx . . $ handle_open_uri(15b392a60de7ebcc).; |
| 1129 | iface->handle_open_filecxx . . $ _XdpDbusOpenURIIface#handle_open_file. = handle_open_filecxx . . $ handle_open_file(56a1e6e6cc901d93).; |
| 1130 | iface->handle_open_directorycxx . . $ _XdpDbusOpenURIIface#handle_open_directory. = handle_open_directorycxx . . $ handle_open_directory(56a1e6e6cc901d93).; |
| 1131 | iface->handle_scheme_supportedcxx . . $ _XdpDbusOpenURIIface#handle_scheme_supported. = handle_scheme_supportedcxx . . $ handle_scheme_supported(f3cb790c41b26c4b).; |
| 1132 | } |
| 1133 | |
| 1134 | static void |
| 1135 | open_uri_initcxx . . $ open_uri_init(ff6c0d888fbd352f). (OpenURIcxx . . $ OpenURI# *openuri) |
| 1136 | { |
| 1137 | xdp_dbus_open_uri_set_versioncxx . . $ xdp_dbus_open_uri_set_version(3458b0183b03759). (XDP_DBUS_OPEN_URIcxx . . $ `build/src/xdp-dbus.h:4992:9`! (openuri), 5); |
| 1138 | } |
| 1139 | |
| 1140 | static void |
| 1141 | open_uri_class_initcxx . . $ open_uri_class_init(be45620aeb6b4688). (OpenURIClasscxx . . $ OpenURIClass# *klass) |
| 1142 | { |
| 1143 | } |
| 1144 | |
| 1145 | GDBusInterfaceSkeletoncxx . . $ GDBusInterfaceSkeleton# * |
| 1146 | open_uri_createcxx . . $ open_uri_create(fd6288b6d257d847). (GDBusConnectioncxx . . $ GDBusConnection# *connection, |
| 1147 | const char *dbus_name, |
| 1148 | gpointercxx . . $ gpointer# lockdown_proxy) |
| 1149 | { |
| 1150 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1151 | |
| 1152 | lockdowncxx . . $ lockdown. = lockdown_proxy; |
| 1153 | |
| 1154 | implcxx . . $ impl. = xdp_dbus_impl_app_chooser_proxy_new_synccxx . . $ xdp_dbus_impl_app_chooser_proxy_new_sync(75edbf6bba41c121). (connection, |
| 1155 | G_DBUS_PROXY_FLAGS_NONEcxx . . $ G_DBUS_PROXY_FLAGS_NONE., |
| 1156 | dbus_name, |
| 1157 | DESKTOP_PORTAL_OBJECT_PATHcxx . . $ `src/xdp-utils.h:37:9`!, |
| 1158 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error); |
| 1159 | if (implcxx . . $ impl. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1160 | { |
| 1161 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to create app chooser proxy: %s", error->message); |
| 1162 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1163 | } |
| 1164 | |
| 1165 | g_dbus_proxy_set_default_timeoutcxx . . $ g_dbus_proxy_set_default_timeout(c68bf28eca88e1d4). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (impl), G_MAXINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:39:9`!); |
| 1166 | |
| 1167 | open_uricxx . . $ open_uri. = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (open_uri_get_typecxx . . $ open_uri_get_type(f708dce9a8856c70). (), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1168 | |
| 1169 | monitorcxx . . $ monitor. = g_app_info_monitor_getcxx . . $ g_app_info_monitor_get(df10c266f4692c45). (); |
| 1170 | |
| 1171 | return G_DBUS_INTERFACE_SKELETONcxx . . $ `<external>/1991948168568871819/gdbusinterfaceskeleton.h:32:9`! (open_uri); |
| 1172 | } |
| 1173 |