[evolution-data-server/openismus-work-master: 7/8] Migrate to using generate D-Bus apis.
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/openismus-work-master: 7/8] Migrate to using generate D-Bus apis.
- Date: Thu, 14 Feb 2013 16:08:40 +0000 (UTC)
commit a6322e79db2f821d9a4468074a50b721ec74bd7c
Author: Tristan Van Berkom <tristanvb openismus com>
Date: Thu Feb 14 23:12:18 2013 +0900
Migrate to using generate D-Bus apis.
addressbook/libebook/e-book-client.c | 25 +-
addressbook/libedata-book/e-data-book-direct.c | 12 +-
addressbook/libegdbus/Makefile.am | 2 -
addressbook/libegdbus/e-gdbus-book-direct.c | 1359 --------------------
addressbook/libegdbus/e-gdbus-book-direct.h | 173 ---
private/Makefile.am | 17 +
.../org.gnome.evolution.dataserver.DirectBook.xml | 19 +
7 files changed, 54 insertions(+), 1553 deletions(-)
---
diff --git a/addressbook/libebook/e-book-client.c b/addressbook/libebook/e-book-client.c
index 111e2a8..f55ff57 100644
--- a/addressbook/libebook/e-book-client.c
+++ b/addressbook/libebook/e-book-client.c
@@ -28,6 +28,7 @@
/* Private D-Bus classes. */
#include <e-dbus-address-book.h>
+#include <e-dbus-direct-book.h>
#include <e-dbus-address-book-factory.h>
#include <libedataserver/libedataserver.h>
@@ -37,7 +38,6 @@
#include <libedata-book/libedata-book.h>
#include "e-book-client.h"
-#include "e-gdbus-book-direct.h"
#define E_BOOK_CLIENT_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -1348,7 +1348,7 @@ e_book_client_connect_direct_sync (ESourceRegistry *registry,
{
EClient *client;
EBookClientPrivate *priv;
- EGdbusBookDirect *direct_config;
+ EDBusDirectBook *direct_config;
const gchar *backend_name, *backend_path, *config;
GError *local_error = NULL;
@@ -1359,17 +1359,16 @@ e_book_client_connect_direct_sync (ESourceRegistry *registry,
priv = E_BOOK_CLIENT_GET_PRIVATE (client);
- direct_config =
- e_gdbus_book_direct_proxy_new_sync (
- g_dbus_proxy_get_connection (G_DBUS_PROXY (priv->dbus_proxy)),
- G_DBUS_PROXY_FLAGS_NONE,
- ADDRESS_BOOK_DBUS_SERVICE_NAME,
- g_dbus_proxy_get_object_path (G_DBUS_PROXY (priv->dbus_proxy)),
- NULL, NULL);
-
- backend_path = e_gdbus_book_direct_get_backend_path (direct_config);
- backend_name = e_gdbus_book_direct_get_backend_name (direct_config);
- config = e_gdbus_book_direct_get_backend_config (direct_config);
+ direct_config = e_dbus_direct_book_proxy_new_sync (
+ g_dbus_proxy_get_connection (G_DBUS_PROXY (priv->dbus_proxy)),
+ G_DBUS_PROXY_FLAGS_NONE,
+ ADDRESS_BOOK_DBUS_SERVICE_NAME,
+ g_dbus_proxy_get_object_path (G_DBUS_PROXY (priv->dbus_proxy)),
+ NULL, NULL);
+
+ backend_path = e_dbus_direct_book_get_backend_path (direct_config);
+ backend_name = e_dbus_direct_book_get_backend_name (direct_config);
+ config = e_dbus_direct_book_get_backend_config (direct_config);
if (backend_path && backend_path[0] &&
backend_name && backend_name[0]) {
diff --git a/addressbook/libedata-book/e-data-book-direct.c b/addressbook/libedata-book/e-data-book-direct.c
index dcedf86..6ed2a49 100644
--- a/addressbook/libedata-book/e-data-book-direct.c
+++ b/addressbook/libedata-book/e-data-book-direct.c
@@ -24,8 +24,8 @@
#include <string.h>
+#include <e-dbus-direct-book.h>
#include "e-data-book-direct.h"
-#include "e-gdbus-book-direct.h"
#define E_DATA_BOOK_DIRECT_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -36,7 +36,7 @@ G_DEFINE_TYPE (EDataBookDirect, e_data_book_direct, G_TYPE_OBJECT);
#define THRESHOLD_SECONDS 2 /* how long to wait until notifications are propagated to UI; in seconds */
struct _EDataBookDirectPrivate {
- EGdbusBookDirect *gdbus_object;
+ EDBusDirectBook *gdbus_object;
};
/* GObjectClass */
@@ -58,7 +58,7 @@ static void
e_data_book_direct_init (EDataBookDirect *direct)
{
direct->priv = E_DATA_BOOK_DIRECT_GET_PRIVATE (direct);
- direct->priv->gdbus_object = e_gdbus_book_direct_skeleton_new ();
+ direct->priv->gdbus_object = e_dbus_direct_book_skeleton_new ();
}
static void
@@ -99,9 +99,9 @@ e_data_book_direct_new (const gchar *backend_path,
direct = g_object_new (E_TYPE_DATA_BOOK_DIRECT, NULL);
- e_gdbus_book_direct_set_backend_path (direct->priv->gdbus_object, backend_path);
- e_gdbus_book_direct_set_backend_name (direct->priv->gdbus_object, backend_factory_name);
- e_gdbus_book_direct_set_backend_config (direct->priv->gdbus_object, config);
+ e_dbus_direct_book_set_backend_path (direct->priv->gdbus_object, backend_path);
+ e_dbus_direct_book_set_backend_name (direct->priv->gdbus_object, backend_factory_name);
+ e_dbus_direct_book_set_backend_config (direct->priv->gdbus_object, config);
return direct;
}
diff --git a/addressbook/libegdbus/Makefile.am b/addressbook/libegdbus/Makefile.am
index 97cadce..434a880 100644
--- a/addressbook/libegdbus/Makefile.am
+++ b/addressbook/libegdbus/Makefile.am
@@ -12,8 +12,6 @@ libegdbus_book_la_CPPFLAGS = \
$(NULL)
libegdbus_book_la_SOURCES = \
- e-gdbus-book-direct.h \
- e-gdbus-book-direct.c \
e-gdbus-book-view.h \
e-gdbus-book-view.c
diff --git a/private/Makefile.am b/private/Makefile.am
index 38a2057..54a8b37 100644
--- a/private/Makefile.am
+++ b/private/Makefile.am
@@ -37,6 +37,15 @@ $(GENERATED_DBUS_ADDRESS_BOOK) : Makefile.am org.gnome.evolution.dataserver.Addr
$(top_srcdir)/private/org.gnome.evolution.dataserver.AddressBook.xml \
$(NULL)
+$(GENERATED_DBUS_DIRECT_BOOK) : Makefile.am org.gnome.evolution.dataserver.DirectBook.xml
+ $(AM_V_GEN) gdbus-codegen \
+ --interface-prefix org.gnome.evolution.dataserver \
+ --c-namespace E_DBus \
+ --generate-c-code e-dbus-direct-book \
+ --generate-docbook e-dbus-direct-book \
+ $(top_srcdir)/private/org.gnome.evolution.dataserver.DirectBook.xml \
+ $(NULL)
+
$(GENERATED_DBUS_ADDRESS_BOOK_FACTORY) : Makefile.am org.gnome.evolution.dataserver.AddressBookFactory.xml
$(AM_V_GEN) gdbus-codegen \
--interface-prefix org.gnome.evolution.dataserver \
@@ -108,6 +117,12 @@ GENERATED_DBUS_ADDRESS_BOOK = \
e-dbus-address-book-org.gnome.evolution.dataserver.AddressBook.xml \
$(NULL)
+GENERATED_DBUS_DIRECT_BOOK = \
+ e-dbus-direct-book.c \
+ e-dbus-direct-book.h \
+ e-dbus-direct-book-org.gnome.evolution.dataserver.DirectBook.xml \
+ $(NULL)
+
GENERATED_DBUS_ADDRESS_BOOK_FACTORY = \
e-dbus-address-book-factory.c \
e-dbus-address-book-factory.h \
@@ -131,6 +146,7 @@ BUILT_SOURCES = \
$(GENERATED_DBUS_SOURCE_MANAGER) \
$(GENERATED_DBUS_AUTHENTICATOR) \
$(GENERATED_DBUS_ADDRESS_BOOK) \
+ $(GENERATED_DBUS_DIRECT_BOOK) \
$(GENERATED_DBUS_ADDRESS_BOOK_FACTORY) \
$(GENERATED_DBUS_CALENDAR) \
$(GENERATED_DBUS_CALENDAR_FACTORY) \
@@ -167,6 +183,7 @@ EXTRA_DIST = \
org.gnome.evolution.dataserver.SourceManager.xml \
org.gnome.evolution.dataserver.Authenticator.xml \
org.gnome.evolution.dataserver.AddressBook.xml \
+ org.gnome.evolution.dataserver.DirectBook.xml \
org.gnome.evolution.dataserver.AddressBookFactory.xml \
org.gnome.evolution.dataserver.Calendar.xml \
org.gnome.evolution.dataserver.CalendarFactory.xml \
diff --git a/private/org.gnome.evolution.dataserver.DirectBook.xml
b/private/org.gnome.evolution.dataserver.DirectBook.xml
new file mode 100644
index 0000000..9263612
--- /dev/null
+++ b/private/org.gnome.evolution.dataserver.DirectBook.xml
@@ -0,0 +1,19 @@
+<!DOCTYPE node PUBLIC
+"-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
+"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
+
+<!--
+ org.gnome.evolution.dataserver.DirectBook:
+ @short_description: Direct Access book metadata object
+ @since: 3.8
+
+ This interface reports direct read access capability for an addressbook backend.
+-->
+<interface name="org.gnome.evolution.dataserver.DirectBook">
+
+ <property name="BackendPath" type="s" access="read"/>
+ <property name="BackendName" type="s" access="read"/>
+ <property name="BackendConfig" type="s" access="read"/>
+
+</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]