[glib/portal] Avoid type name clash



commit 34c104924fe4f0ff372e915f1230daa3a9b20ac5
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jul 4 22:53:30 2016 -0400

    Avoid type name clash
    
    GIO should not install types whose names don't start with 'g'.
    This was causing the xdg-desktop-portal to crash, since it was
    also trying to register Xdp types.

 gio/Makefile.am             |    2 +-
 gio/gnetworkmonitorportal.c |   24 ++++++++++++------------
 gio/gproxyresolverportal.c  |   32 ++++++++++++++++----------------
 3 files changed, 29 insertions(+), 29 deletions(-)
---
diff --git a/gio/Makefile.am b/gio/Makefile.am
index 1c9daf3..d41988f 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -354,7 +354,7 @@ $(xdp_dbus_built_sources) : $(portal_interfaces)
                UNINSTALLED_GLIB_BUILDDIR=$(top_builddir)               \
                $(PYTHON) $(srcdir)/gdbus-2.0/codegen/gdbus-codegen.in  \
                --interface-prefix org.freedesktop.portal.              \
-               --c-namespace Xdp                                       \
+               --c-namespace GXdp                                      \
                --generate-c-code $(builddir)/xdp-dbus                  \
                $^
 
diff --git a/gio/gnetworkmonitorportal.c b/gio/gnetworkmonitorportal.c
index d56c7fb..610b3f2 100644
--- a/gio/gnetworkmonitorportal.c
+++ b/gio/gnetworkmonitorportal.c
@@ -39,7 +39,7 @@ enum
 
 struct _GNetworkMonitorPortalPrivate
 {
-  XdpNetworkMonitor *proxy;
+  GXdpNetworkMonitor *proxy;
   gboolean network_available;
 };
 
@@ -74,19 +74,19 @@ g_network_monitor_portal_get_property (GObject    *object,
     case PROP_NETWORK_AVAILABLE:
       g_value_set_boolean (value,
                            nm->priv->network_available &&
-                           xdp_network_monitor_get_available (nm->priv->proxy));
+                           gxdp_network_monitor_get_available (nm->priv->proxy));
       break;
 
     case PROP_NETWORK_METERED:
       g_value_set_boolean (value,
                            nm->priv->network_available &&
-                           xdp_network_monitor_get_metered (nm->priv->proxy));
+                           gxdp_network_monitor_get_metered (nm->priv->proxy));
       break;
 
     case PROP_CONNECTIVITY:
       g_value_set_enum (value,
                         nm->priv->network_available
-                        ? xdp_network_monitor_get_connectivity (nm->priv->proxy)
+                        ? gxdp_network_monitor_get_connectivity (nm->priv->proxy)
                         : G_NETWORK_CONNECTIVITY_LOCAL);
       break;
 
@@ -97,7 +97,7 @@ g_network_monitor_portal_get_property (GObject    *object,
 }
 
 static void
-proxy_changed (XdpNetworkMonitor     *proxy,
+proxy_changed (GXdpNetworkMonitor    *proxy,
                gboolean               available,
                GNetworkMonitorPortal *nm)
 {
@@ -111,7 +111,7 @@ g_network_monitor_portal_initable_init (GInitable     *initable,
                                         GError       **error)
 {
   GNetworkMonitorPortal *nm = G_NETWORK_MONITOR_PORTAL (initable);
-  XdpNetworkMonitor *proxy;
+  GXdpNetworkMonitor *proxy;
   gchar *name_owner = NULL;
 
   if (!glib_should_use_portal ())
@@ -120,12 +120,12 @@ g_network_monitor_portal_initable_init (GInitable     *initable,
       return FALSE;
     }
 
-  proxy = xdp_network_monitor_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
-                                         G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START
-                                         | G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES,
-                                         "org.freedesktop.portal.Desktop",
-                                         "/org/freedesktop/portal/desktop",
-                                         cancellable,
+  proxy = gxdp_network_monitor_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
+                                          G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START
+                                          | G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES,
+                                          "org.freedesktop.portal.Desktop",
+                                          "/org/freedesktop/portal/desktop",
+                                          cancellable,
                                          error);
   if (!proxy)
     return FALSE;
diff --git a/gio/gproxyresolverportal.c b/gio/gproxyresolverportal.c
index bfa74ea..d1a7c3d 100644
--- a/gio/gproxyresolverportal.c
+++ b/gio/gproxyresolverportal.c
@@ -27,7 +27,7 @@
 struct _GProxyResolverPortal {
   GObject parent_instance;
 
-  XdpProxyResolver *resolver;
+  GXdpProxyResolver *resolver;
   gboolean network_available;
 };
 
@@ -45,7 +45,7 @@ G_DEFINE_TYPE_WITH_CODE (GProxyResolverPortal, g_proxy_resolver_portal, G_TYPE_O
 static void
 g_proxy_resolver_portal_init (GProxyResolverPortal *resolver)
 {
-  resolver->resolver = xdp_proxy_resolver_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
+  resolver->resolver = gxdp_proxy_resolver_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
                                                                 G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
                                                                 "org.freedesktop.portal.Desktop",
                                                                 "/org/freedesktop/portal/desktop",
@@ -83,11 +83,11 @@ g_proxy_resolver_portal_lookup (GProxyResolver *proxy_resolver,
   GProxyResolverPortal *resolver = G_PROXY_RESOLVER_PORTAL (proxy_resolver);
   char **proxy = NULL;
 
-  if (!xdp_proxy_resolver_call_lookup_sync (resolver->resolver,
-                                            uri,
-                                            &proxy,
-                                            cancellable,
-                                            error))
+  if (!gxdp_proxy_resolver_call_lookup_sync (resolver->resolver,
+                                             uri,
+                                             &proxy,
+                                             cancellable,
+                                             error))
     return NULL;
 
   if (!resolver->network_available)
@@ -108,11 +108,11 @@ g_proxy_resolver_portal_lookup_async (GProxyResolver      *proxy_resolver,
 {
   GProxyResolverPortal *resolver = G_PROXY_RESOLVER_PORTAL (proxy_resolver);
 
-  xdp_proxy_resolver_call_lookup (resolver->resolver,
-                                  uri,
-                                  cancellable,
-                                  callback,
-                                  user_data);
+  gxdp_proxy_resolver_call_lookup (resolver->resolver,
+                                   uri,
+                                   cancellable,
+                                   callback,
+                                   user_data);
 }
 
 static gchar **
@@ -123,10 +123,10 @@ g_proxy_resolver_portal_lookup_finish (GProxyResolver  *proxy_resolver,
   GProxyResolverPortal *resolver = G_PROXY_RESOLVER_PORTAL (proxy_resolver);
   char **proxy = NULL;
 
-  if (!xdp_proxy_resolver_call_lookup_finish (resolver->resolver,
-                                              &proxy,
-                                              result,
-                                              error))
+  if (!gxdp_proxy_resolver_call_lookup_finish (resolver->resolver,
+                                               &proxy,
+                                               result,
+                                               error))
     return NULL;
 
   if (!resolver->network_available)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]