Merge branch 'wip/smcv/cups-dbus-error' into 'main'

printing: Treat any G_DBUS_ERROR contacting Avahi as non-problematic

See merge request GNOME/gtk!7835
This commit is contained in:
Matthias Clasen 2024-10-15 15:50:32 +00:00
commit 68d74b380f

View File

@ -3545,10 +3545,12 @@ avahi_service_browser_new_cb (GObject *source_object,
{
/*
* The creation of ServiceBrowser fails with G_IO_ERROR_DBUS_ERROR
* if Avahi is disabled.
* or a GDBusError such as G_DBUS_ERROR_SERVICE_UNKNOWN if Avahi is disabled.
*/
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_DBUS_ERROR) &&
!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_DBUS_ERROR) ||
error->domain == G_DBUS_ERROR)
g_debug ("%s #%d: %s", g_quark_to_string (error->domain), error->code, error->message);
else if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("%s", error->message);
g_error_free (error);
}