Code

DBUS. Patch for Bug #696062, dbus builds no more.
[inkscape.git] / src / extension / dbus / dbus-init.cpp
index a30bb8fda0fed56d426af22ca9b063559fca78f0..2ae606940d6736c4a3c9d9416f698a17ab4cd449 100644 (file)
@@ -1,4 +1,18 @@
-
+/*
+ * This is where Inkscape connects to the DBus when it starts and 
+ * registers the main interface.
+ *
+ * Also where new interfaces are registered when a new document is created.
+ * (Not called directly by application-interface but called indirectly.)
+ *
+ * Authors:
+ *   Soren Berg <Glimmer07@gmail.com>
+ *
+ * Copyright (C) 2009 Soren Berg
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
 #include <dbus/dbus-glib.h>
 #include "dbus-init.h"
 
@@ -92,10 +106,10 @@ init_document (void) {
         DBusGProxy *proxy;
        SPDocument *doc;
 
-       doc = sp_document_new(NULL, 1, TRUE);
+        doc = SPDocument::createNewDoc(NULL, 1, TRUE);
 
         std::string name("/org/inkscape/");
-       name.append(doc->name);
+       name.append(doc->getName());
         std::replace(name.begin(), name.end(), ' ', '_');
 
         connection = dbus_get_connection();
@@ -115,6 +129,9 @@ dbus_init_desktop_interface (SPDesktop * dt)
     DBusGConnection *connection;
     DBusGProxy *proxy;
        DocumentInterface *obj;
+       dbus_g_error_domain_register (INKSCAPE_ERROR,
+                               NULL,
+                               INKSCAPE_TYPE_ERROR);
 
     std::string name("/org/inkscape/desktop_");
        std::stringstream out;