From 9c19df4215cc73bf82049f7527cb2e85fc15d881 Mon Sep 17 00:00:00 2001 From: John Smith Date: Tue, 18 Sep 2012 14:22:47 +0900 Subject: Fix for 818628 : DBUS Metadata for error domain warning when using File>New (bzr r11674) --- src/extension/dbus/application-interface.cpp | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'src/extension/dbus/application-interface.cpp') diff --git a/src/extension/dbus/application-interface.cpp b/src/extension/dbus/application-interface.cpp index a652b7c96..8ee7bd12f 100644 --- a/src/extension/dbus/application-interface.cpp +++ b/src/extension/dbus/application-interface.cpp @@ -39,6 +39,9 @@ application_interface_class_init (ApplicationInterfaceClass *klass) static void application_interface_init (ApplicationInterface *object) { + dbus_g_error_domain_register (INKSCAPE_ERROR, + NULL, + INKSCAPE_TYPE_ERROR); } @@ -48,6 +51,44 @@ application_interface_new (void) return (ApplicationInterface*)g_object_new (TYPE_APPLICATION_INTERFACE, NULL); } +/* + * Error stuff... + * + * To add a new error type, edit here and in the .h InkscapeError enum. + */ +GQuark +inkscape_error_quark (void) +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string ("inkscape_error"); + + return quark; +} + +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType inkscape_error_get_type(void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = + { + + ENUM_ENTRY(INKSCAPE_ERROR_SELECTION, "Incompatible_Selection"), + ENUM_ENTRY(INKSCAPE_ERROR_OBJECT, "Incompatible_Object"), + ENUM_ENTRY(INKSCAPE_ERROR_VERB, "Failed_Verb"), + ENUM_ENTRY(INKSCAPE_ERROR_OTHER, "Generic_Error"), + { 0, 0, 0 } + }; + + etype = g_enum_register_static("InkscapeError", values); + } + + return etype; +} + /**************************************************************************** DESKTOP FUNCTIONS ****************************************************************************/ -- cgit v1.2.3