Top |
gboolean | dbus_g_error_has_name () |
const char * | dbus_g_error_get_name () |
void | dbus_g_error_domain_register () |
gboolean dbus_g_error_has_name (GError *error
,const char *name
);
dbus_g_error_has_name
is deprecated and should not be used in newly-written code.
New code should use GDBus instead. The closest equivalent
is g_dbus_error_get_remote_error()
.
Determine whether D-BUS error name for a remote exception matches
the given name. This function is intended to be invoked on a
GError returned from an invocation of a remote method, e.g. via
dbus_g_proxy_end_call()
. It will silently return FALSE
for errors
which are not remote D-BUS exceptions (i.e. with a domain other
than DBUS_GERROR
or a code other than
DBUS_GERROR_REMOTE_EXCEPTION
).
const char *
dbus_g_error_get_name (GError *error
);
dbus_g_error_get_name
is deprecated and should not be used in newly-written code.
New code should use GDBus instead. The closest equivalent
is g_dbus_error_get_remote_error()
.
This function may only be invoked on a GError returned from an
invocation of a remote method, e.g. via dbus_g_proxy_end_call()
.
Moreover, you must ensure that the error's domain is DBUS_GERROR
,
and the code is DBUS_GERROR_REMOTE_EXCEPTION
.
void dbus_g_error_domain_register (GQuark domain
,const char *default_iface
,GType code_enum
);
dbus_g_error_domain_register
is deprecated and should not be used in newly-written code.
New code should use GDBus instead. The closest equivalent
is g_dbus_error_register_error_domain()
.
Register a GError domain and set of codes with D-Bus. When an object
raises a GError in the domain domain
from one of its D-Bus methods,
the D-Bus error name used will be default_iface
, followed by a dot,
followed by the GEnumValue.value_nick corresponding to the GError.code.
For D-Bus, it's conventional to use an error name (value_nick) that is
in CamelCase.
(For instance, if a D-Bus method com.example.MyObject.GetThings
can raise a GError with domain MY_ERROR
and code
MY_ERROR_NOT_HAPPY
, you could call
dbus_g_error_domain_register (MY_ERROR, "com.example.MyError",
MY_TYPE_ERROR)
, and set up the value_nick for
MY_ERROR_NOT_HAPPY
to be NotHappy
,
resulting in the D-Bus error string
com.example.MyError.NotHappy
.)
If default_iface
is NULL
, the D-Bus interface of the method that failed
will be used.
(For instance, if the above example had called
dbus_g_error_domain_register (MY_ERROR, NULL, MY_TYPE_ERROR)
instead, then the D-Bus error string would be
com.example.MyObject.NotHappy
.)
DBusGError
is deprecated and should not be used in newly-written code.
New code should use GDBus and its GDBusError enum instead.
A GError enumeration for the domain DBUS_GERROR
. The values' meanings
can be found by looking at the comments for the corresponding constants
in dbus-protocol.h.
#define DBUS_GERROR dbus_g_error_quark ()
DBUS_GERROR
is deprecated and should not be used in newly-written code.
New code should use GDBus and its GDBusError enum instead.
Expands to a function call returning the error domain quark for DBusGError, for use with GError.