Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libportal for openSUSE:Factory 
checked in at 2021-05-20 19:24:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libportal (Old)
 and      /work/SRC/openSUSE:Factory/.libportal.new.2988 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libportal"

Thu May 20 19:24:30 2021 rev:2 rq:893963 version:0.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/libportal/libportal.changes      2019-12-28 
13:40:36.702935783 +0100
+++ /work/SRC/openSUSE:Factory/.libportal.new.2988/libportal.changes    
2021-05-20 19:24:46.966010802 +0200
@@ -1,0 +2,11 @@
+Fri May 14 22:34:50 UTC 2021 - Dominique Leuenberger <[email protected]>
+
+- Update to version 0.4:
+  + Make GTK4 support work with GTK 4.0
+  + Qt5 support
+  + OpenURI: Support write access
+  + Build fixes
+  + Add more tests
+  + Require GLib 2.58
+
+-------------------------------------------------------------------

Old:
----
  libportal-0.3.tar.xz

New:
----
  libportal-0.4.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libportal.spec ++++++
--- /var/tmp/diff_new_pack.TFCTyI/_old  2021-05-20 19:24:47.394009047 +0200
+++ /var/tmp/diff_new_pack.TFCTyI/_new  2021-05-20 19:24:47.398009031 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package libportal
 #
-# Copyright (c) 2019 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %define sover 0
 
 Name:           libportal
-Version:        0.3
+Version:        0.4
 Release:        0
 Summary:        A GIO-style async APIs for most Flatpak portals
 License:        LGPL-2.1-or-later

++++++ libportal-0.3.tar.xz -> libportal-0.4.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/NEWS new/libportal-0.4/NEWS
--- old/libportal-0.3/NEWS      2019-12-20 14:12:04.000000000 +0100
+++ new/libportal-0.4/NEWS      2021-04-05 18:36:06.755360800 +0200
@@ -1,3 +1,13 @@
+Changes in 0.4
+==============
+
+- Make GTK4 support work with GTK 4.0
+- Qt5 support
+- OpenURI: Support write access
+- Build fixes
+- Add more tests
+- Require GLib 2.58
+
 Changes in 0.3
 ==============
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/doc/libportal-sections.txt 
new/libportal-0.4/doc/libportal-sections.txt
--- old/libportal-0.3/doc/libportal-sections.txt        2019-12-20 
14:12:04.000000000 +0100
+++ new/libportal-0.4/doc/libportal-sections.txt        2021-04-05 
18:36:06.755360800 +0200
@@ -55,7 +55,7 @@
 <SECTION>
 <FILE>inhibit</FILE>
 XdpInhibitFlags
-XdpSessionState
+XdpLoginSessionState
 xdp_portal_session_inhibit
 xdp_portal_session_inhibit_finish
 xdp_portal_session_uninhibit
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/account.c 
new/libportal-0.4/libportal/account.c
--- old/libportal-0.3/libportal/account.c       2019-12-20 14:12:04.000000000 
+0100
+++ new/libportal-0.4/libportal/account.c       2021-04-05 18:36:06.757361000 
+0200
@@ -49,7 +49,7 @@
   g_debug ("freeing AccountCall");
   if (call->parent)
     {
-      call->parent->unexport (call->parent);
+      call->parent->parent_unexport (call->parent);
       _xdp_parent_free (call->parent);
     }
   g_free (call->parent_handle);
@@ -162,7 +162,7 @@
 
   if (call->parent_handle == NULL)
     {   
-      call->parent->export (call->parent, parent_exported, call);
+      call->parent->parent_export (call->parent, parent_exported, call);
       return;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/background.c 
new/libportal-0.4/libportal/background.c
--- old/libportal-0.3/libportal/background.c    2019-12-20 14:12:04.000000000 
+0100
+++ new/libportal-0.4/libportal/background.c    2021-04-05 18:36:06.757361000 
+0200
@@ -53,7 +53,7 @@
 {
   if (call->parent)
     {
-      call->parent->unexport (call->parent);
+      call->parent->parent_unexport (call->parent);
       _xdp_parent_free (call->parent);
     }
   g_free (call->parent_handle);
@@ -168,7 +168,7 @@
 
   if (call->parent_handle == NULL)
     {
-      call->parent->export (call->parent, parent_exported, call);
+      call->parent->parent_export (call->parent, parent_exported, call);
       return;
     }
 
@@ -199,7 +199,7 @@
   if (call->commandline)
     g_variant_builder_add (&options, "{sv}", "commandline", g_variant_new_strv 
((const char* const*)call->commandline->pdata, call->commandline->len));
 
-g_print ("calling background\n");
+  g_debug ("calling background");
   g_dbus_connection_call (call->portal->bus,
                           PORTAL_BUS_NAME,
                           PORTAL_OBJECT_PATH,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/email.c 
new/libportal-0.4/libportal/email.c
--- old/libportal-0.3/libportal/email.c 2019-12-20 14:12:04.000000000 +0100
+++ new/libportal-0.4/libportal/email.c 2021-04-05 18:36:06.758360900 +0200
@@ -67,7 +67,7 @@
 {
   if (call->parent)
     {
-      call->parent->unexport (call->parent);
+      call->parent->parent_unexport (call->parent);
       _xdp_parent_free (call->parent);
     }
   g_free (call->parent_handle);
@@ -192,7 +192,7 @@
 
   if (call->parent_handle == NULL)
     {
-      call->parent->export (call->parent, parent_exported, call);
+      call->parent->parent_export (call->parent, parent_exported, call);
       return;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/filechooser.c 
new/libportal-0.4/libportal/filechooser.c
--- old/libportal-0.3/libportal/filechooser.c   2019-12-20 14:12:04.000000000 
+0100
+++ new/libportal-0.4/libportal/filechooser.c   2021-04-05 18:36:06.758360900 
+0200
@@ -61,7 +61,7 @@
 {
   if (call->parent)
     {
-      call->parent->unexport (call->parent);
+      call->parent->parent_unexport (call->parent);
       _xdp_parent_free (call->parent);
     }
   g_free (call->parent_handle);
@@ -185,7 +185,7 @@
 
   if (call->parent_handle == NULL)
     {
-      call->parent->export (call->parent, parent_exported, call);
+      call->parent->parent_export (call->parent, parent_exported, call);
       return;
     }
 
@@ -221,9 +221,9 @@
   if (call->current_name)
     g_variant_builder_add (&options, "{sv}", "current_name", 
g_variant_new_string (call->current_name));
   if (call->current_folder)
-    g_variant_builder_add (&options, "{sv}", "current_folder", 
g_variant_new_string (call->current_folder));
+    g_variant_builder_add (&options, "{sv}", "current_folder", 
g_variant_new_bytestring (call->current_folder));
   if (call->current_file)
-    g_variant_builder_add (&options, "{sv}", "current_file", 
g_variant_new_string (call->current_file));
+    g_variant_builder_add (&options, "{sv}", "current_file", 
g_variant_new_bytestring (call->current_file));
 
   g_dbus_connection_call (call->portal->bus,
                           PORTAL_BUS_NAME,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/inhibit.c 
new/libportal-0.4/libportal/inhibit.c
--- old/libportal-0.3/libportal/inhibit.c       2019-12-20 14:12:04.000000000 
+0100
+++ new/libportal-0.4/libportal/inhibit.c       2021-04-05 18:36:06.758360900 
+0200
@@ -54,7 +54,7 @@
 {
   if (call->parent)
     {
-      call->parent->unexport (call->parent);
+      call->parent->parent_unexport (call->parent);
       _xdp_parent_free (call->parent);
     }
  g_free (call->parent_handle);
@@ -168,7 +168,7 @@
 
   if (call->parent_handle == NULL)
     {
-      call->parent->export (call->parent, inhibit_parent_exported, call);
+      call->parent->parent_export (call->parent, inhibit_parent_exported, 
call);
       return;
     }
 
@@ -346,7 +346,7 @@
 {
   if (call->parent)
     {
-      call->parent->unexport (call->parent);
+      call->parent->parent_unexport (call->parent);
       _xdp_parent_free (call->parent);
     }
   g_free (call->parent_handle);
@@ -512,7 +512,7 @@
 
   if (call->parent_handle == NULL)
     {
-      call->parent->export (call->parent, create_parent_exported, call);
+      call->parent->parent_export (call->parent, create_parent_exported, call);
       return;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/inhibit.h 
new/libportal-0.4/libportal/inhibit.h
--- old/libportal-0.3/libportal/inhibit.h       2019-12-20 14:12:04.000000000 
+0100
+++ new/libportal-0.4/libportal/inhibit.h       2021-04-05 18:36:06.759361000 
+0200
@@ -41,7 +41,7 @@
 void       xdp_portal_session_inhibit             (XdpPortal            
*portal,
                                                    XdpParent            
*parent,
                                                    const char           
*reason,
-                                                   XdpInhibitFlags       
inhibit,
+                                                   XdpInhibitFlags       flags,
                                                    GCancellable         
*cancellable,
                                                    GAsyncReadyCallback   
callback,
                                                    gpointer              data);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/location.c 
new/libportal-0.4/libportal/location.c
--- old/libportal-0.3/libportal/location.c      2019-12-20 14:12:04.000000000 
+0100
+++ new/libportal-0.4/libportal/location.c      2021-04-05 18:36:06.759361000 
+0200
@@ -50,7 +50,7 @@
 {
   if (call->parent)
     {
-      call->parent->unexport (call->parent);
+      call->parent->parent_unexport (call->parent);
       _xdp_parent_free (call->parent);
     }
  g_free (call->parent_handle);
@@ -276,7 +276,7 @@
 
   if (call->parent_handle == NULL)
     {
-      call->parent->export (call->parent, parent_exported, call);
+      call->parent->parent_export (call->parent, parent_exported, call);
       return;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/meson.build 
new/libportal-0.4/libportal/meson.build
--- old/libportal-0.3/libportal/meson.build     2019-12-20 14:12:04.000000000 
+0100
+++ new/libportal-0.4/libportal/meson.build     2021-04-05 18:36:06.759361000 
+0200
@@ -1,6 +1,7 @@
 headers = files('portal.h',
                 'portal-gtk3.h',
                 'portal-gtk4.h',
+                'portal-qt5.h',
                 'portal-helpers.h',
                 'account.h',
                 'background.h',
@@ -23,7 +24,7 @@
                              sources: headers,
                              c_template: 'portal-enums.c.template',
                              h_template: 'portal-enums.h.template',
-                             install_dir: join_paths (get_option('prefix'), 
'include', 'libportal'),
+                             install_dir: join_paths 
(get_option('includedir'), 'libportal'),
                              install_header: true)
 
 src = [
@@ -49,7 +50,7 @@
         portal_enums
 ]
 
-gio_dep = dependency('gio-2.0')
+gio_dep = dependency('gio-2.0', version: '>= 2.58')
 gio_unix_dep = dependency('gio-unix-2.0')
 
 install_headers(headers, subdir: 'libportal')
@@ -63,6 +64,12 @@
                     install: true,
                     dependencies: [gio_dep, gio_unix_dep])
 
+pkgconfig.generate(libportal,
+  description: 'Portal API wrappers',
+  name: 'libportal',
+  requires: [ gio_dep ],
+)
+
 libportal_dep = declare_dependency(sources: src,
                                    include_directories: top_inc,
                                    dependencies: [gio_dep, gio_unix_dep],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/openuri.c 
new/libportal-0.4/libportal/openuri.c
--- old/libportal-0.3/libportal/openuri.c       2019-12-20 14:12:04.000000000 
+0100
+++ new/libportal-0.4/libportal/openuri.c       2021-04-05 18:36:06.759361000 
+0200
@@ -61,7 +61,7 @@
 {
   if (call->parent)
     {
-      call->parent->unexport (call->parent);
+      call->parent->parent_unexport (call->parent);
       _xdp_parent_free (call->parent);
     }
   g_free (call->parent_handle);
@@ -177,7 +177,7 @@
 
   if (call->parent_handle == NULL)
     {
-      call->parent->export (call->parent, parent_exported, call);
+      call->parent->parent_export (call->parent, parent_exported, call);
       return;
     }
 
@@ -209,11 +209,16 @@
     {
       g_autoptr(GUnixFDList) fd_list = NULL;
       g_autofree char *path = NULL;
-      int fd, fd_in;
+      int fd, fd_in, flags;
 
       path = g_file_get_path (file);
 
-      fd = g_open (path, O_PATH | O_CLOEXEC);
+      if (call->writable)
+        flags = O_RDWR | O_CLOEXEC;
+      else
+        flags = O_RDONLY | O_CLOEXEC;
+
+      fd = g_open (path, flags);
       if (fd == -1)
         {
           g_task_return_new_error (call->task, G_IO_ERROR, G_IO_ERROR_FAILED, 
"Failed to open '%s'", call->uri);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/portal-enums.c.template 
new/libportal-0.4/libportal/portal-enums.c.template
--- old/libportal-0.3/libportal/portal-enums.c.template 2019-12-20 
14:12:04.000000000 +0100
+++ new/libportal-0.4/libportal/portal-enums.c.template 2021-04-05 
18:36:06.760361000 +0200
@@ -12,7 +12,7 @@
 GType
 @enum_name@_get_type (void)
 {
-  static volatile gsize g_define_type_id__volatile = 0;
+  static gsize g_define_type_id__volatile = 0;
 
   if (g_once_init_enter (&g_define_type_id__volatile))
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/portal-gtk3.h 
new/libportal-0.4/libportal/portal-gtk3.h
--- old/libportal-0.3/libportal/portal-gtk3.h   2019-12-20 14:12:04.000000000 
+0100
+++ new/libportal-0.4/libportal/portal-gtk3.h   2021-04-05 18:36:06.760361000 
+0200
@@ -91,8 +91,8 @@
 static inline XdpParent *xdp_parent_new_gtk (GtkWindow *window)
 {
   XdpParent *parent = g_new0 (XdpParent, 1);
-  parent->export = _xdp_parent_export_gtk;
-  parent->unexport = _xdp_parent_unexport_gtk;
+  parent->parent_export = _xdp_parent_export_gtk;
+  parent->parent_unexport = _xdp_parent_unexport_gtk;
   parent->object = (GObject *) g_object_ref (window);
   return parent;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/portal-gtk4.h 
new/libportal-0.4/libportal/portal-gtk4.h
--- old/libportal-0.3/libportal/portal-gtk4.h   2019-12-20 14:12:04.000000000 
+0100
+++ new/libportal-0.4/libportal/portal-gtk4.h   2021-04-05 18:36:06.760361000 
+0200
@@ -33,7 +33,7 @@
 
 G_BEGIN_DECLS
 
-static inline void _xdp_parent_exported_wayland (GdkSurface *surface,
+static inline void _xdp_parent_exported_wayland (GdkToplevel *toplevel,
                                                  const char *handle,
                                                  gpointer data)
 
@@ -63,7 +63,10 @@
       GdkSurface *surface = gtk_native_get_surface (GTK_NATIVE 
(parent->object));
       parent->callback = callback;
       parent->data = data;
-      return gdk_wayland_surface_export_handle (surface, 
_xdp_parent_exported_wayland, parent, NULL);
+      return gdk_wayland_toplevel_export_handle (GDK_TOPLEVEL (surface),
+                                                 _xdp_parent_exported_wayland,
+                                                 parent,
+                                                 NULL);
     }
 #endif
   g_warning ("Couldn't export handle, unsupported windowing system");
@@ -76,7 +79,7 @@
   if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET 
(parent->object))))
     {
       GdkSurface *surface = gtk_native_get_surface (GTK_NATIVE 
(parent->object));
-      gdk_wayland_surface_unexport_handle (surface);
+      gdk_wayland_toplevel_unexport_handle (GDK_TOPLEVEL (surface));
     }
 #endif
 }
@@ -91,8 +94,8 @@
 static inline XdpParent *xdp_parent_new_gtk (GtkWindow *window)
 {
   XdpParent *parent = g_new0 (XdpParent, 1);
-  parent->export = _xdp_parent_export_gtk;
-  parent->unexport = _xdp_parent_unexport_gtk;
+  parent->parent_export = _xdp_parent_export_gtk;
+  parent->parent_unexport = _xdp_parent_unexport_gtk;
   parent->object = (GObject *) g_object_ref (window);
   return parent;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/portal-helpers.h 
new/libportal-0.4/libportal/portal-helpers.h
--- old/libportal-0.3/libportal/portal-helpers.h        2019-12-20 
14:12:04.000000000 +0100
+++ new/libportal-0.4/libportal/portal-helpers.h        2021-04-05 
18:36:06.760361000 +0200
@@ -25,9 +25,11 @@
 
 G_DECLARE_FINAL_TYPE (XdpPortal, xdp_portal, XDP, PORTAL, GObject)
 
+#ifndef __GTK_DOC_IGNORE__
 #ifndef XDP_PUBLIC
 #define XDP_PUBLIC extern
 #endif
+#endif /* __GTK_DOC_IGNORE__ */
 
 XDP_PUBLIC
 GType      xdp_portal_get_type               (void) G_GNUC_CONST;
@@ -54,8 +56,8 @@
 
 struct _XdpParent {
   /*< private >*/
-  XdpParentExport export;
-  XdpParentUnexport unexport;
+  XdpParentExport parent_export;
+  XdpParentUnexport parent_unexport;
   GObject *object;
   XdpParentExported callback;
   gpointer data;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/portal-qt5.h 
new/libportal-0.4/libportal/portal-qt5.h
--- old/libportal-0.3/libportal/portal-qt5.h    1970-01-01 01:00:00.000000000 
+0100
+++ new/libportal-0.4/libportal/portal-qt5.h    2021-04-05 18:36:06.760361000 
+0200
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2020, Jan Grulich
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <libportal/portal.h>
+
+#include <QX11Info>
+#include <QWindow>
+
+static inline gboolean _xdp_parent_export_qt (XdpParent *parent,
+                                              XdpParentExported callback,
+                                              gpointer data)
+{
+  if (QX11Info::isPlatformX11 ())
+    {
+      QWindow *w = (QWindow *) parent->data;
+      if (w) {
+        guint32 xid = (guint32) w->winId ();
+        g_autofree char *handle = g_strdup_printf ("x11:%x", xid);
+        callback (parent, handle, data);
+        return TRUE;
+      }
+    }
+  else
+    {
+      /* TODO: QtWayland doesn't support xdg-foreign protocol yet
+       * Upstream bugs: https://bugreports.qt.io/browse/QTBUG-73801
+       *                https://bugreports.qt.io/browse/QTBUG-76983
+       */
+      g_warning ("QtWayland doesn't support xdg-foreign protocol yet");
+      g_autofree char *handle = g_strdup ("");
+      callback (parent, handle, data);
+      return TRUE;
+    }
+
+  g_warning ("Couldn't export handle, unsupported windowing system");
+  return FALSE;
+}
+
+static inline void _xdp_parent_unexport_qt (XdpParent *parent)
+{
+}
+
+static inline XdpParent *xdp_parent_new_qt (QWindow *window);
+
+static inline XdpParent *xdp_parent_new_qt (QWindow *window)
+{
+  XdpParent *parent = g_new0 (XdpParent, 1);
+  parent->parent_export = _xdp_parent_export_qt;
+  parent->parent_unexport = _xdp_parent_unexport_qt;
+  parent->data = (gpointer) window;
+  return parent;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/print.c 
new/libportal-0.4/libportal/print.c
--- old/libportal-0.3/libportal/print.c 2019-12-20 14:12:04.000000000 +0100
+++ new/libportal-0.4/libportal/print.c 2021-04-05 18:36:06.761361000 +0200
@@ -65,7 +65,7 @@
 {
   if (call->parent)
     {
-      call->parent->unexport (call->parent);
+      call->parent->parent_unexport (call->parent);
       _xdp_parent_free (call->parent);
     }
   g_free (call->parent_handle);
@@ -190,7 +190,7 @@
 
   if (call->parent_handle == NULL)
     {
-      call->parent->export (call->parent, parent_exported, call);
+      call->parent->parent_export (call->parent, parent_exported, call);
       return;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/remote.c 
new/libportal-0.4/libportal/remote.c
--- old/libportal-0.3/libportal/remote.c        2019-12-20 14:12:04.000000000 
+0100
+++ new/libportal-0.4/libportal/remote.c        2021-04-05 18:36:06.761361000 
+0200
@@ -485,7 +485,7 @@
 {
   if (call->parent)
     {
-      call->parent->unexport (call->parent);
+      call->parent->parent_unexport (call->parent);
       _xdp_parent_free (call->parent);
     }
   g_free (call->parent_handle);
@@ -582,7 +582,7 @@
 
   if (call->parent_handle == NULL)
     {
-      call->parent->export (call->parent, parent_exported, call);
+      call->parent->parent_export (call->parent, parent_exported, call);
       return;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/screenshot.c 
new/libportal-0.4/libportal/screenshot.c
--- old/libportal-0.3/libportal/screenshot.c    2019-12-20 14:12:04.000000000 
+0100
+++ new/libportal-0.4/libportal/screenshot.c    2021-04-05 18:36:06.761361000 
+0200
@@ -48,7 +48,7 @@
 {
   if (call->parent)
     {
-      call->parent->unexport (call->parent);
+      call->parent->parent_unexport (call->parent);
       _xdp_parent_free (call->parent);
     }
   g_free (call->parent_handle);
@@ -177,7 +177,7 @@
 
   if (call->parent_handle == NULL)
     {
-      call->parent->export (call->parent, parent_exported, call);
+      call->parent->parent_export (call->parent, parent_exported, call);
       return;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/updates.c 
new/libportal-0.4/libportal/updates.c
--- old/libportal-0.3/libportal/updates.c       2019-12-20 14:12:04.000000000 
+0100
+++ new/libportal-0.4/libportal/updates.c       2021-04-05 18:36:06.763361000 
+0200
@@ -108,7 +108,7 @@
       g_variant_lookup (info, "error", "&s", &error);
       g_variant_lookup (info, "error_message", "&s", &error_message);
     }
-g_print ("update progress received %u/%u %u%% %d\n", op, n_ops, progress, 
status);
+  g_debug ("update progress received %u/%u %u%% %d", op, n_ops, progress, 
status);
 
   g_signal_emit_by_name (portal, "update-progress",
                          n_ops,
@@ -317,7 +317,7 @@
 {
   if (call->parent)
     {
-      call->parent->unexport (call->parent);
+      call->parent->parent_unexport (call->parent);
       _xdp_parent_free (call->parent);
     }
   g_free (call->parent_handle);
@@ -373,7 +373,7 @@
 
   if (call->parent_handle == NULL)
     {
-      call->parent->export (call->parent, create_parent_exported, call);
+      call->parent->parent_export (call->parent, create_parent_exported, call);
       return;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/utils.c 
new/libportal-0.4/libportal/utils.c
--- old/libportal-0.3/libportal/utils.c 2019-12-20 14:12:04.000000000 +0100
+++ new/libportal-0.4/libportal/utils.c 2021-04-05 18:36:06.763361000 +0200
@@ -26,9 +26,10 @@
 
   parent = g_new0 (XdpParent, 1);
 
-  parent->export = source->export;
-  parent->unexport = source->unexport;
+  parent->parent_export = source->parent_export;
+  parent->parent_unexport = source->parent_unexport;
   g_set_object (&parent->object, source->object);
+  parent->data = source->data;
 
   return parent;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal/wallpaper.c 
new/libportal-0.4/libportal/wallpaper.c
--- old/libportal-0.3/libportal/wallpaper.c     2019-12-20 14:12:04.000000000 
+0100
+++ new/libportal-0.4/libportal/wallpaper.c     2021-04-05 18:36:06.763361000 
+0200
@@ -59,7 +59,7 @@
 {
   if (call->parent)
     {
-      call->parent->unexport (call->parent);
+      call->parent->parent_unexport (call->parent);
       _xdp_parent_free (call->parent);
     }
   g_free (call->parent_handle);
@@ -192,7 +192,7 @@
 
   if (call->parent_handle == NULL)
     {
-      call->parent->export (call->parent, parent_exported, call);
+      call->parent->parent_export (call->parent, parent_exported, call);
       return;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/libportal.pc.in 
new/libportal-0.4/libportal.pc.in
--- old/libportal-0.3/libportal.pc.in   2019-12-20 14:12:04.000000000 +0100
+++ new/libportal-0.4/libportal.pc.in   1970-01-01 01:00:00.000000000 +0100
@@ -1,10 +0,0 @@
-prefix=@prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: libportal
-Description: Portal API wrappers
-Version: @VERSION@
-Requires: gio-unix-2.0
-Libs: -L${libdir} -lportal
-Cflags: -I${includedir}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/meson.build 
new/libportal-0.4/meson.build
--- old/libportal-0.3/meson.build       2019-12-20 14:12:04.000000000 +0100
+++ new/libportal-0.4/meson.build       2021-04-05 18:36:06.764361000 +0200
@@ -1,10 +1,13 @@
 project('libportal','c',
-        version: '0.3',
+        version: '0.4',
         meson_version: '>= 0.46.0')
 
 cc = meson.get_compiler('c')
 
 gnome = import('gnome')
+pkgconfig = import('pkgconfig')
+
+qt = import('qt5')
 
 conf = configuration_data()
 conf.set_quoted('G_LOG_DOMAIN', 'libportal')
@@ -23,19 +26,14 @@
 top_inc = include_directories('.')
 libportal_inc = include_directories('libportal')
 
-pkg_conf = configuration_data()
-pkg_conf.set('VERSION', meson.project_version())
-pkg_conf.set('prefix', get_option('prefix'))
-pkg_conf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
-pkg_conf.set('includedir', '${prefix}/' + get_option('includedir'))
-
-configure_file(input: 'libportal.pc.in',
-               output: 'libportal.pc',
-               configuration: pkg_conf,
-               install_dir: join_paths(get_option('libdir'), 'pkgconfig'))
-
 subdir('libportal')
-subdir('doc')
+if get_option('gtk_doc')
+  subdir('doc')
+endif
 if get_option('build-portal-test')
   subdir('portal-test')
 endif
+
+if get_option('build-portal-test-qt')
+  subdir('portal-test-qt')
+endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/meson_options.txt 
new/libportal-0.4/meson_options.txt
--- old/libportal-0.3/meson_options.txt 2019-12-20 14:12:04.000000000 +0100
+++ new/libportal-0.4/meson_options.txt 2021-04-05 18:36:06.764361000 +0200
@@ -1,3 +1,6 @@
 option('build-portal-test', type: 'boolean', value: false,
   description : 'Build the portal-test application')
-
+option('build-portal-test-qt', type: 'boolean', value: false,
+  description: 'Build the portal-test-qt application')
+option('gtk_doc', type: 'boolean', value: true,
+  description : 'Build API reference with gtk-doc')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/portal-test/flatpak/build.sh 
new/libportal-0.4/portal-test/flatpak/build.sh
--- old/libportal-0.3/portal-test/flatpak/build.sh      2019-12-20 
14:12:04.000000000 +0100
+++ new/libportal-0.4/portal-test/flatpak/build.sh      2021-04-05 
18:36:06.764361000 +0200
@@ -1,3 +1,16 @@
 #!/bin/sh
 
-flatpak-builder --force-clean --ccache --repo=repo --install --user app 
org.gnome.PortalTest.json
+TOP_DIR=`dirname $0`/../..
+OLD_DIR=`pwd`
+
+cd "$TOP_DIR"
+JSON=portal-test/flatpak/org.gnome.PortalTest.json
+# Keep in sync with manifest
+MESON_ARGS="-Dbuild-portal-test=true -Dgtk_doc=false"
+
+rm -rf _flatpak_meson_build
+flatpak-builder --force-clean --ccache --repo=repo --install --user 
--stop-at=portal-test app $JSON
+flatpak build app meson --prefix=/app --libdir=lib $MESON_ARGS 
_flatpak_meson_build
+flatpak build app ninja -C _flatpak_meson_build install
+flatpak-builder --finish-only --repo=repo app $JSON
+cd "$OLD_DIR"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libportal-0.3/portal-test/flatpak/org.gnome.PortalTest.json 
new/libportal-0.4/portal-test/flatpak/org.gnome.PortalTest.json
--- old/libportal-0.3/portal-test/flatpak/org.gnome.PortalTest.json     
2019-12-20 14:12:04.000000000 +0100
+++ new/libportal-0.4/portal-test/flatpak/org.gnome.PortalTest.json     
2021-04-05 18:36:06.764361000 +0200
@@ -11,11 +11,32 @@
     ],
     "modules": [
         {
+            "name": "gtk3",
+            "disabled": true,
+            "buildsystem": "meson",
+            "builddir": true,
+            "build-options": {
+                "config-opts": [
+                    "-Dgtk_doc=false"
+                ]
+            },
+            "sources": [
+                {
+                    "type": "git",
+                    "url": "https://gitlab.gnome.org/GNOME/gtk.git";,
+                    "branch": "gtk-3-24"
+                }
+            ]
+        },
+        {
             "name": "portal-test",
             "buildsystem": "meson",
             "builddir": true,
             "build-options": {
-                "config-opts": [ "-Dbuild-portal-test=true" ]
+                "config-opts": [
+                  "-Dbuild-portal-test=true",
+                  "-Dgtk_doc=false"
+                ]
             },
             "sources": [
                 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/portal-test/meson.build 
new/libportal-0.4/portal-test/meson.build
--- old/libportal-0.3/portal-test/meson.build   2019-12-20 14:12:04.000000000 
+0100
+++ new/libportal-0.4/portal-test/meson.build   2021-04-05 18:36:06.764361000 
+0200
@@ -22,3 +22,8 @@
 install_data('test.txt', install_dir: 'share/org.gnome.PortalTest')
 install_data('org.gnome.PortalTest.desktop', install_dir: 'share/applications')
 install_data('org.gnome.PortalTest.service', install_dir: 
'share/dbus-1/services')
+
+executable('portal-linking-test',
+           [ 'portal-linking-test.c' ],
+           include_directories: [libportal_inc],
+           dependencies: [gtk_dep, libportal_dep])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/portal-test/portal-linking-test.c 
new/libportal-0.4/portal-test/portal-linking-test.c
--- old/libportal-0.3/portal-test/portal-linking-test.c 1970-01-01 
01:00:00.000000000 +0100
+++ new/libportal-0.4/portal-test/portal-linking-test.c 2021-04-05 
18:36:06.765361000 +0200
@@ -0,0 +1,12 @@
+#include <libportal/portal-gtk3.h>
+
+int
+main (int argc, char **argv)
+{
+  XdpPortal *portal;
+
+  portal = xdp_portal_new ();
+  (void) xdp_portal_is_camera_present (portal);
+
+  return 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/portal-test/portal-test-win.c 
new/libportal-0.4/portal-test/portal-test-win.c
--- old/libportal-0.3/portal-test/portal-test-win.c     2019-12-20 
14:12:04.000000000 +0100
+++ new/libportal-0.4/portal-test/portal-test-win.c     2021-04-05 
18:36:06.766361000 +0200
@@ -1162,7 +1162,7 @@
 {
   XdpParent *parent;
 //  const char *uri = 
"https://gitlab.gnome.org/GNOME/gtk/raw/master/demos/gtk-demo/portland-rose.jpg";;
-  const char *uri = "file:////var/home/mclasen/portland-rose.jpg";
+  const char *uri = "file:///usr/share/backgrounds/gnome/adwaita-morning.jpg";
 
   parent = xdp_parent_new_gtk (GTK_WINDOW (win));
   xdp_portal_set_wallpaper (win->portal,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/portal-test/portal-test-win.ui 
new/libportal-0.4/portal-test/portal-test-win.ui
--- old/libportal-0.3/portal-test/portal-test-win.ui    2019-12-20 
14:12:04.000000000 +0100
+++ new/libportal-0.4/portal-test/portal-test-win.ui    2021-04-05 
18:36:06.766361000 +0200
@@ -192,7 +192,7 @@
           <object class="GtkLabel">
             <property name="visible">1</property>
             <property name="halign">end</property>
-            <property name="label">Local</property>
+            <property name="label">Directory Chooser</property>
           </object>
           <packing>
             <property name="left-attach">0</property>
@@ -202,13 +202,36 @@
         <child>
           <object class="GtkFileChooserButton">
             <property name="visible">1</property>
+            <property name="title">Directory Chooser Portal</property>
+            <property name="action">select-folder</property>
+          </object>
+          <packing>
+            <property name="left-attach">1</property>
+            <property name="top-attach">2</property>
+          </packing>
+        </child>
+
+        <child>
+          <object class="GtkLabel">
+            <property name="visible">1</property>
+            <property name="halign">end</property>
+            <property name="label">Local</property>
+          </object>
+          <packing>
+            <property name="left-attach">0</property>
+            <property name="top-attach">3</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkFileChooserButton">
+            <property name="visible">1</property>
             <property name="title">Local File Chooser</property>
             <property name="action">open</property>
             <property name="dialog">filechooser</property>
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">2</property>
+            <property name="top-attach">3</property>
           </packing>
         </child>
 
@@ -220,7 +243,7 @@
           </object>
           <packing>
             <property name="left-attach">0</property>
-            <property name="top-attach">3</property>
+            <property name="top-attach">4</property>
           </packing>
         </child>
         <child>
@@ -231,7 +254,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">3</property>
+            <property name="top-attach">4</property>
           </packing>
         </child>
         <child>
@@ -253,7 +276,7 @@
           </object>
           <packing>
             <property name="left-attach">2</property>
-            <property name="top-attach">3</property>
+            <property name="top-attach">4</property>
           </packing>
         </child>
 
@@ -265,7 +288,7 @@
           </object>
           <packing>
             <property name="left-attach">0</property>
-            <property name="top-attach">4</property>
+            <property name="top-attach">5</property>
           </packing>
         </child>
         <child>
@@ -276,7 +299,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">4</property>
+            <property name="top-attach">5</property>
           </packing>
         </child>
 
@@ -288,7 +311,7 @@
           </object>
           <packing>
             <property name="left-attach">0</property>
-            <property name="top-attach">5</property>
+            <property name="top-attach">6</property>
           </packing>
         </child>
         <child>
@@ -314,7 +337,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">5</property>
+            <property name="top-attach">6</property>
          </packing>
         </child>
         <child>
@@ -325,7 +348,7 @@
           </object>
           <packing>
             <property name="left-attach">2</property>
-            <property name="top-attach">5</property>
+            <property name="top-attach">6</property>
           </packing>
         </child>
 
@@ -337,7 +360,7 @@
           </object>
           <packing>
             <property name="left-attach">0</property>
-            <property name="top-attach">6</property>
+            <property name="top-attach">7</property>
           </packing>
         </child>
         <child>
@@ -348,7 +371,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">6</property>
+            <property name="top-attach">7</property>
           </packing>
         </child>
         <child>
@@ -358,7 +381,7 @@
           </object>
           <packing>
             <property name="left-attach">2</property>
-            <property name="top-attach">6</property>
+            <property name="top-attach">7</property>
           </packing>
         </child>
 
@@ -370,7 +393,7 @@
           </object>
           <packing>
             <property name="left-attach">0</property>
-            <property name="top-attach">7</property>
+            <property name="top-attach">8</property>
           </packing>
         </child>
         <child>
@@ -380,7 +403,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">7</property>
+            <property name="top-attach">8</property>
           </packing>
         </child>
         <child>
@@ -390,7 +413,7 @@
           </object>
           <packing>
             <property name="left-attach">2</property>
-            <property name="top-attach">7</property>
+            <property name="top-attach">8</property>
             <property name="width">2</property>
           </packing>
         </child>
@@ -403,7 +426,7 @@
           </object>
           <packing>
             <property name="left-attach">0</property>
-            <property name="top-attach">8</property>
+            <property name="top-attach">9</property>
           </packing>
         </child>
         <child>
@@ -413,7 +436,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">8</property>
+            <property name="top-attach">9</property>
           </packing>
         </child>
         <child>
@@ -423,7 +446,7 @@
           </object>
           <packing>
             <property name="left-attach">2</property>
-            <property name="top-attach">8</property>
+            <property name="top-attach">9</property>
             <property name="width">2</property>
           </packing>
         </child>
@@ -436,7 +459,7 @@
           </object>
           <packing>
             <property name="left-attach">0</property>
-            <property name="top-attach">9</property>
+            <property name="top-attach">10</property>
           </packing>
         </child>
         <child>
@@ -448,7 +471,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">9</property>
+            <property name="top-attach">10</property>
           </packing>
         </child>
         <child>
@@ -460,7 +483,7 @@
           </object>
           <packing>
             <property name="left-attach">2</property>
-            <property name="top-attach">9</property>
+            <property name="top-attach">10</property>
           </packing>
         </child>
 
@@ -472,7 +495,7 @@
           </object>
           <packing>
             <property name="left-attach">0</property>
-            <property name="top-attach">10</property>
+            <property name="top-attach">11</property>
           </packing>
         </child>
         <child>
@@ -484,7 +507,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">10</property>
+            <property name="top-attach">11</property>
           </packing>
         </child>
 
@@ -496,7 +519,7 @@
           </object>
           <packing>
             <property name="left-attach">0</property>
-            <property name="top-attach">11</property>
+            <property name="top-attach">12</property>
           </packing>
         </child>
         <child>
@@ -537,7 +560,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">11</property>
+            <property name="top-attach">12</property>
             <property name="width">2</property>
           </packing>
         </child>
@@ -550,7 +573,7 @@
           </object>
           <packing>
             <property name="left-attach">0</property>
-            <property name="top-attach">12</property>
+            <property name="top-attach">13</property>
           </packing>
         </child>
         <child>
@@ -562,7 +585,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">12</property>
+            <property name="top-attach">13</property>
           </packing>
         </child>
 
@@ -574,7 +597,7 @@
           </object>
           <packing>
             <property name="left-attach">0</property>
-            <property name="top-attach">13</property>
+            <property name="top-attach">14</property>
           </packing>
         </child>
         <child>
@@ -586,7 +609,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">13</property>
+            <property name="top-attach">14</property>
           </packing>
         </child>
 
@@ -597,7 +620,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">14</property>
+            <property name="top-attach">15</property>
           </packing>
         </child>
         <child>
@@ -606,7 +629,7 @@
           </object>
           <packing>
             <property name="left-attach">2</property>
-            <property name="top-attach">13</property>
+            <property name="top-attach">14</property>
             <property name="height">2</property>
           </packing>
         </child>
@@ -618,7 +641,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">15</property>
+            <property name="top-attach">16</property>
           </packing>
         </child>
         <child>
@@ -629,7 +652,7 @@
           </object>
           <packing>
             <property name="left-attach">0</property>
-            <property name="top-attach">16</property>
+            <property name="top-attach">17</property>
           </packing>
         </child>
         <child>
@@ -641,7 +664,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">16</property>
+            <property name="top-attach">17</property>
           </packing>
         </child>
         <child>
@@ -652,7 +675,7 @@
           </object>
           <packing>
             <property name="left-attach">0</property>
-            <property name="top-attach">17</property>
+            <property name="top-attach">18</property>
           </packing>
         </child>
         <child>
@@ -664,7 +687,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">17</property>
+            <property name="top-attach">18</property>
           </packing>
         </child>
         <child>
@@ -675,7 +698,7 @@
           </object>
           <packing>
             <property name="left-attach">0</property>
-            <property name="top-attach">18</property>
+            <property name="top-attach">19</property>
           </packing>
         </child>
         <child>
@@ -687,7 +710,7 @@
           </object>
           <packing>
             <property name="left-attach">1</property>
-            <property name="top-attach">18</property>
+            <property name="top-attach">19</property>
           </packing>
         </child>
       </object>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/portal-test-qt/main.cpp 
new/libportal-0.4/portal-test-qt/main.cpp
--- old/libportal-0.3/portal-test-qt/main.cpp   1970-01-01 01:00:00.000000000 
+0100
+++ new/libportal-0.4/portal-test-qt/main.cpp   2021-04-05 18:36:06.764361000 
+0200
@@ -0,0 +1,14 @@
+
+#include <QApplication>
+
+#include "portal-test-qt.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+
+    PortalTestQt *portalTest = new PortalTestQt(nullptr);
+    portalTest->show();
+
+    return a.exec();
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/portal-test-qt/meson.build 
new/libportal-0.4/portal-test-qt/meson.build
--- old/libportal-0.3/portal-test-qt/meson.build        1970-01-01 
01:00:00.000000000 +0100
+++ new/libportal-0.4/portal-test-qt/meson.build        2021-04-05 
18:36:06.764361000 +0200
@@ -0,0 +1,20 @@
+
+add_languages('cpp', required : true)
+
+qt_dep = dependency('qt5', modules: ['Core', 'Gui', 'X11Extras', 'Widgets'])
+
+src = ['main.cpp',
+       'portal-test-qt.h',
+       'portal-test-qt.cpp']
+
+prep = qt.preprocess(moc_headers : 'portal-test-qt.h',
+                          moc_extra_arguments: 
['-DMAKES_MY_MOC_HEADER_COMPILE'],
+                          ui_files : 'portal-test-qt.ui',
+                          dependencies: qt_dep)
+
+executable('portal-test-qt',
+           [src, prep],
+           include_directories: [top_inc, libportal_inc],
+           dependencies: [qt_dep, libportal_dep],
+           cpp_args : '-std=c++11',
+           install : true)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/portal-test-qt/portal-test-qt.cpp 
new/libportal-0.4/portal-test-qt/portal-test-qt.cpp
--- old/libportal-0.3/portal-test-qt/portal-test-qt.cpp 1970-01-01 
01:00:00.000000000 +0100
+++ new/libportal-0.4/portal-test-qt/portal-test-qt.cpp 2021-04-05 
18:36:06.764361000 +0200
@@ -0,0 +1,58 @@
+
+#include "portal-test-qt.h"
+#include "ui_portal-test-qt.h"
+
+#include <QStringLiteral>
+
+PortalTestQt::PortalTestQt(QWidget *parent, Qt::WindowFlags f)
+    : QMainWindow(parent, f)
+    , m_mainWindow(new Ui_PortalTestQt)
+    , m_portal(xdp_portal_new())
+{
+    m_mainWindow->setupUi(this);
+
+    connect(m_mainWindow->openFileButton, &QPushButton::clicked, [=] (bool 
clicked) {
+        XdpParent *parent;
+        XdpOpenFileFlags flags = XDP_OPEN_FILE_FLAG_NONE;
+
+        parent = xdp_parent_new_qt(windowHandle());
+        xdp_portal_open_file (m_portal, parent, "Portal Test Qt", nullptr 
/*filters*/, nullptr /*current_filters*/,
+                              nullptr /*choices*/, flags, nullptr 
/*cancellable*/, openedFile, this);
+        xdp_parent_free (parent);
+    });
+}
+
+PortalTestQt::~PortalTestQt()
+{
+    delete m_mainWindow;
+    g_object_unref( m_portal);
+}
+
+void PortalTestQt::updateLastOpenedFile(const QString &file)
+{
+    if (!file.isEmpty()) {
+        m_mainWindow->openedFileLabel->setText(QStringLiteral("Opened file: 
%1").arg(file));
+    } else {
+        m_mainWindow->openedFileLabel->setText(QStringLiteral("Failed to open 
a file!!!"));
+    }
+}
+
+void PortalTestQt::openedFile(GObject *object, GAsyncResult *result, gpointer 
data)
+{
+    Q_UNUSED(data);
+    XdpPortal *portal = XDP_PORTAL (object);
+    PortalTestQt *win = static_cast<PortalTestQt*>(data);
+    g_autoptr(GError) error = nullptr;
+    g_autoptr(GVariant) ret = nullptr;
+
+    ret = xdp_portal_open_file_finish(portal, result, &error);
+
+    if (ret) {
+        const char **uris;
+        if (g_variant_lookup(ret, "uris", "^a&s", &uris)) {
+            win->updateLastOpenedFile(uris[0]);
+        }
+    } else {
+            win->updateLastOpenedFile(QString());
+    }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/portal-test-qt/portal-test-qt.h 
new/libportal-0.4/portal-test-qt/portal-test-qt.h
--- old/libportal-0.3/portal-test-qt/portal-test-qt.h   1970-01-01 
01:00:00.000000000 +0100
+++ new/libportal-0.4/portal-test-qt/portal-test-qt.h   2021-04-05 
18:36:06.764361000 +0200
@@ -0,0 +1,28 @@
+
+#ifndef PORTAL_TEST_QT_H
+#define PORTAL_TEST_QT_H
+
+#include <QMainWindow>
+
+#undef signals
+#include "libportal/portal-qt5.h"
+#define signals Q_SIGNALS
+
+class Ui_PortalTestQt;
+
+class PortalTestQt : public QMainWindow
+{
+    Q_OBJECT
+public:
+    PortalTestQt(QWidget *parent = nullptr, Qt::WindowFlags f = 
Qt::WindowFlags());
+    ~PortalTestQt();
+
+    void updateLastOpenedFile(const QString &file);
+private:
+    static void openedFile(GObject *object, GAsyncResult *result, gpointer 
data);
+
+    Ui_PortalTestQt *m_mainWindow;
+    XdpPortal *m_portal;
+};
+
+#endif // PORTAL_TEST_QT_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libportal-0.3/portal-test-qt/portal-test-qt.ui 
new/libportal-0.4/portal-test-qt/portal-test-qt.ui
--- old/libportal-0.3/portal-test-qt/portal-test-qt.ui  1970-01-01 
01:00:00.000000000 +0100
+++ new/libportal-0.4/portal-test-qt/portal-test-qt.ui  2021-04-05 
18:36:06.764361000 +0200
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PortalTestQt</class>
+ <widget class="QMainWindow" name="PortalTestQt">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>355</width>
+    <height>100</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Portal Test Qt</string>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <layout class="QGridLayout" name="gridLayout">
+    <item row="0" column="0">
+     <widget class="QPushButton" name="openFileButton">
+      <property name="text">
+       <string>Open File...</string>
+      </property>
+     </widget>
+    </item>
+    <item row="1" column="0">
+     <widget class="QLabel" name="openedFileLabel">
+      <property name="text">
+       <string>No file opened!!</string>
+      </property>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

Reply via email to