mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
gio: Add newer dbus UnknownXxxx and PropertyReadOnly errors
Add G_DBUS_ERROR codes for: * org.freedesktop.DBus.Error.UnknownObject * org.freedesktop.DBus.Error.UnknownInterface * org.freedesktop.DBus.Error.UnknownProperty * org.freedesktop.DBus.Error.PropertyReadOnly These were discussed on the dbus mailing list and introduced in the following libdbus commit: 2c34514620c4b79ea4ec71d1db583379138d01ac https://bugzilla.gnome.org/show_bug.cgi?id=727900
This commit is contained in:
parent
65f2669173
commit
76d6fd01de
@ -150,12 +150,16 @@ static const GDBusErrorEntry g_dbus_error_entries[] =
|
||||
{G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN, "org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown"},
|
||||
{G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN, "org.freedesktop.DBus.Error.AdtAuditDataUnknown"},
|
||||
{G_DBUS_ERROR_OBJECT_PATH_IN_USE, "org.freedesktop.DBus.Error.ObjectPathInUse"},
|
||||
{G_DBUS_ERROR_UNKNOWN_OBJECT, "org.freedesktop.DBus.Error.UnknownObject"},
|
||||
{G_DBUS_ERROR_UNKNOWN_INTERFACE, "org.freedesktop.DBus.Error.UnknownInterface"},
|
||||
{G_DBUS_ERROR_UNKNOWN_PROPERTY, "org.freedesktop.DBus.Error.UnknownProperty"},
|
||||
{G_DBUS_ERROR_PROPERTY_READ_ONLY, "org.freedesktop.DBus.Error.PropertyReadOnly"},
|
||||
};
|
||||
|
||||
GQuark
|
||||
g_dbus_error_quark (void)
|
||||
{
|
||||
G_STATIC_ASSERT (G_N_ELEMENTS (g_dbus_error_entries) - 1 == G_DBUS_ERROR_OBJECT_PATH_IN_USE);
|
||||
G_STATIC_ASSERT (G_N_ELEMENTS (g_dbus_error_entries) - 1 == G_DBUS_ERROR_PROPERTY_READ_ONLY);
|
||||
static volatile gsize quark_volatile = 0;
|
||||
g_dbus_error_register_error_domain ("g-dbus-error-quark",
|
||||
&quark_volatile,
|
||||
|
@ -1030,6 +1030,14 @@ typedef enum
|
||||
* Existing file and the operation you're using does not silently overwrite.
|
||||
* @G_DBUS_ERROR_UNKNOWN_METHOD:
|
||||
* Method name you invoked isn't known by the object you invoked it on.
|
||||
* @G_DBUS_ERROR_UNKNOWN_OBJECT:
|
||||
* Object you invoked a method on isn't known. Since 2.42
|
||||
* @G_DBUS_ERROR_UNKNOWN_INTERFACE:
|
||||
* Interface you invoked a method on isn't known by the object. Since 2.42
|
||||
* @G_DBUS_ERROR_UNKNOWN_PROPERTY:
|
||||
* Property you tried to access isn't known by the object. Since 2.42
|
||||
* @G_DBUS_ERROR_PROPERTY_READ_ONLY:
|
||||
* Property you tried to set is read-only. Since 2.42
|
||||
* @G_DBUS_ERROR_TIMED_OUT:
|
||||
* Certain timeout errors, e.g. while starting a service. Warning: this is
|
||||
* confusingly-named given that %G_DBUS_ERROR_TIMEOUT also exists. We
|
||||
@ -1122,7 +1130,11 @@ typedef enum
|
||||
G_DBUS_ERROR_INVALID_FILE_CONTENT, /* org.freedesktop.DBus.Error.InvalidFileContent */
|
||||
G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN, /* org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown */
|
||||
G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN, /* org.freedesktop.DBus.Error.AdtAuditDataUnknown */
|
||||
G_DBUS_ERROR_OBJECT_PATH_IN_USE /* org.freedesktop.DBus.Error.ObjectPathInUse */
|
||||
G_DBUS_ERROR_OBJECT_PATH_IN_USE, /* org.freedesktop.DBus.Error.ObjectPathInUse */
|
||||
G_DBUS_ERROR_UNKNOWN_OBJECT, /* org.freedesktop.DBus.Error.UnknownObject */
|
||||
G_DBUS_ERROR_UNKNOWN_INTERFACE, /* org.freedesktop.DBus.Error.UnknownInterface */
|
||||
G_DBUS_ERROR_UNKNOWN_PROPERTY, /* org.freedesktop.DBus.Error.UnknownProperty */
|
||||
G_DBUS_ERROR_PROPERTY_READ_ONLY, /* org.freedesktop.DBus.Error.PropertyReadOnly */
|
||||
} GDBusError;
|
||||
/* Remember to update g_dbus_error_quark() in gdbuserror.c if you extend this enumeration */
|
||||
|
||||
|
@ -73,6 +73,9 @@ test_registered_errors (void)
|
||||
check_registered_error ("org.freedesktop.DBus.Error.UnknownMethod",
|
||||
G_DBUS_ERROR,
|
||||
G_DBUS_ERROR_UNKNOWN_METHOD);
|
||||
check_registered_error ("org.freedesktop.DBus.Error.UnknownObject",
|
||||
G_DBUS_ERROR,
|
||||
G_DBUS_ERROR_UNKNOWN_OBJECT);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user