Merge branch 'glib-2-58-309-codegen-punning' into 'glib-2-58'
codegen: Change pointer casting to remove type-punning warnings
See merge request GNOME/glib!318
diff --git a/gio-2.0.pc.in b/gio-2.0.pc.in
index 999e1c0..afd3a40 100644
--- a/gio-2.0.pc.in
+++ b/gio-2.0.pc.in
@@ -5,10 +5,11 @@
datadir=@datadir@
schemasdir=${datadir}/glib-2.0/schemas
+bindir=@bindir@
giomoduledir=@GIO_MODULE_DIR@
-glib_compile_schemas=glib-compile-schemas
-glib_compile_resources=glib-compile-resources
-gdbus_codegen=gdbus-codegen
+glib_compile_schemas=${bindir}/glib-compile-schemas
+glib_compile_resources=${bindir}/glib-compile-resources
+gdbus_codegen=${bindir}/gdbus-codegen
Name: GIO
Description: glib I/O library
diff --git a/gio/gicon.c b/gio/gicon.c
index 5f943f5..4f73d75 100644
--- a/gio/gicon.c
+++ b/gio/gicon.c
@@ -199,8 +199,8 @@
* native, the returned string is the result of g_file_get_uri()
* (such as `sftp://path/to/my%20icon.png`).
*
- * - If @icon is a #GThemedIcon with exactly one name, the encoding is
- * simply the name (such as `network-server`).
+ * - If @icon is a #GThemedIcon with exactly one name and no fallbacks,
+ * the encoding is simply the name (such as `network-server`).
*
* Virtual: to_tokens
* Returns: (nullable): An allocated NUL-terminated UTF8 string or
@@ -237,15 +237,23 @@
}
else if (G_IS_THEMED_ICON (icon))
{
- const char * const *names;
+ char **names = NULL;
+ gboolean use_default_fallbacks = FALSE;
- names = g_themed_icon_get_names (G_THEMED_ICON (icon));
+ g_object_get (G_OBJECT (icon),
+ "names", &names,
+ "use-default-fallbacks", &use_default_fallbacks,
+ NULL);
+ /* Themed icon initialized with a single name and no fallbacks. */
if (names != NULL &&
names[0] != NULL &&
names[0][0] != '.' && /* Allowing icons starting with dot would break G_ICON_SERIALIZATION_MAGIC0 */
g_utf8_validate (names[0], -1, NULL) && /* Only return utf8 strings */
- names[1] == NULL)
+ names[1] == NULL &&
+ ! use_default_fallbacks)
ret = g_strdup (names[0]);
+
+ g_strfreev (names);
}
if (ret == NULL)
diff --git a/gio/gnetworkmonitornetlink.c b/gio/gnetworkmonitornetlink.c
index b308b3b..3841e69 100644
--- a/gio/gnetworkmonitornetlink.c
+++ b/gio/gnetworkmonitornetlink.c
@@ -113,7 +113,7 @@
}
nl->priv->sock = g_socket_new_from_fd (sockfd, error);
- if (error)
+ if (!nl->priv->sock)
{
g_prefix_error (error, "%s", _("Could not create network monitor: "));
(void) g_close (sockfd, NULL);
@@ -435,12 +435,6 @@
{
GNetworkMonitorNetlink *nl = G_NETWORK_MONITOR_NETLINK (object);
- if (nl->priv->sock)
- {
- g_socket_close (nl->priv->sock, NULL);
- g_object_unref (nl->priv->sock);
- }
-
if (nl->priv->source)
{
g_source_destroy (nl->priv->source);
@@ -453,6 +447,12 @@
g_source_unref (nl->priv->dump_source);
}
+ if (nl->priv->sock)
+ {
+ g_socket_close (nl->priv->sock, NULL);
+ g_object_unref (nl->priv->sock);
+ }
+
g_clear_pointer (&nl->priv->context, g_main_context_unref);
g_clear_pointer (&nl->priv->dump_networks, g_ptr_array_unref);
diff --git a/gio/gnetworkmonitorportal.c b/gio/gnetworkmonitorportal.c
index 9a5820a..2c0eb8a 100644
--- a/gio/gnetworkmonitorportal.c
+++ b/gio/gnetworkmonitorportal.c
@@ -432,8 +432,7 @@
}
proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
- G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START
- | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
NULL,
"org.freedesktop.portal.Desktop",
"/org/freedesktop/portal/desktop",
diff --git a/gio/gproxyresolverportal.c b/gio/gproxyresolverportal.c
index d525800..2c28a03 100644
--- a/gio/gproxyresolverportal.c
+++ b/gio/gproxyresolverportal.c
@@ -52,7 +52,7 @@
return FALSE;
resolver->resolver = gxdp_proxy_resolver_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
- G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
+ G_DBUS_PROXY_FLAGS_NONE,
"org.freedesktop.portal.Desktop",
"/org/freedesktop/portal/desktop",
NULL,
diff --git a/gio/tests/g-icon.c b/gio/tests/g-icon.c
index 7f87e49..13985d6 100644
--- a/gio/tests/g-icon.c
+++ b/gio/tests/g-icon.c
@@ -119,7 +119,17 @@
icon = g_themed_icon_new ("network-server");
data = g_icon_to_string (icon);
- g_assert_cmpstr (data, ==, ". GThemedIcon network-server network-server-symbolic");
+ g_assert_cmpstr (data, ==, "network-server");
+ icon2 = g_icon_new_for_string (data, &error);
+ g_assert_no_error (error);
+ g_assert (g_icon_equal (icon, icon2));
+ g_free (data);
+ g_object_unref (icon);
+ g_object_unref (icon2);
+
+ icon = g_themed_icon_new_with_default_fallbacks ("network-server");
+ data = g_icon_to_string (icon);
+ g_assert_cmpstr (data, ==, ". GThemedIcon network-server network network-server-symbolic network-symbolic");
icon2 = g_icon_new_for_string (data, &error);
g_assert_no_error (error);
g_assert (g_icon_equal (icon, icon2));
diff --git a/glib-2.0.pc.in b/glib-2.0.pc.in
index 275fc01..3c5ea81 100644
--- a/glib-2.0.pc.in
+++ b/glib-2.0.pc.in
@@ -3,9 +3,10 @@
libdir=@libdir@
includedir=@includedir@
-glib_genmarshal=glib-genmarshal
-gobject_query=gobject-query
-glib_mkenums=glib-mkenums
+bindir=@bindir@
+glib_genmarshal=${bindir}/glib-genmarshal
+gobject_query=${bindir}/gobject-query
+glib_mkenums=${bindir}/glib-mkenums
Name: GLib
Description: C Utility Library
diff --git a/po/cs.po b/po/cs.po
index 92e742c..9b70c66 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -13,7 +13,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: glib\n"
+"Project-Id-Version: glib glib-2.58\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/glib/issues\n"
"POT-Creation-Date: 2018-08-25 12:34+0000\n"
"PO-Revision-Date: 2018-08-30 11:56+0200\n"