aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-02-19 02:42:54 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-02-19 03:19:34 +0800
commitc3ea33df618adcf49fc4294454e1ea1745544a62 (patch)
treed1e1aa3a0f64699060240817f9b4d31e38dec2b2 /addressbook/gui
parent2c471d12912c2b9666b3a7194831ac9997b72ce0 (diff)
downloadgsoc2013-evolution-c3ea33df618adcf49fc4294454e1ea1745544a62.tar
gsoc2013-evolution-c3ea33df618adcf49fc4294454e1ea1745544a62.tar.gz
gsoc2013-evolution-c3ea33df618adcf49fc4294454e1ea1745544a62.tar.bz2
gsoc2013-evolution-c3ea33df618adcf49fc4294454e1ea1745544a62.tar.lz
gsoc2013-evolution-c3ea33df618adcf49fc4294454e1ea1745544a62.tar.xz
gsoc2013-evolution-c3ea33df618adcf49fc4294454e1ea1745544a62.tar.zst
gsoc2013-evolution-c3ea33df618adcf49fc4294454e1ea1745544a62.zip
EAddressbookSelector: Inherit from EClientSelector.
Use e_client_selector_get_client() to obtain an EClient.
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/widgets/e-addressbook-selector.c26
-rw-r--r--addressbook/gui/widgets/e-addressbook-selector.h6
2 files changed, 22 insertions, 10 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-selector.c b/addressbook/gui/widgets/e-addressbook-selector.c
index 73a3334084..0ae747f404 100644
--- a/addressbook/gui/widgets/e-addressbook-selector.c
+++ b/addressbook/gui/widgets/e-addressbook-selector.c
@@ -65,7 +65,7 @@ static GtkTargetEntry drag_types[] = {
G_DEFINE_TYPE (
EAddressbookSelector,
e_addressbook_selector,
- E_TYPE_SOURCE_SELECTOR)
+ E_TYPE_CLIENT_SELECTOR)
static void
merge_context_next (MergeContext *merge_context)
@@ -257,7 +257,8 @@ target_client_connect_cb (GObject *source_object,
g_return_if_fail (merge_context != NULL);
- client = e_book_client_connect_finish (result, &error);
+ client = e_client_selector_get_client_finish (
+ E_CLIENT_SELECTOR (source_object), result, &error);
/* Sanity check. */
g_return_if_fail (
@@ -327,8 +328,9 @@ addressbook_selector_data_dropped (ESourceSelector *selector,
merge_context->remove_from_source = remove_from_source;
merge_context->pending_adds = TRUE;
- e_book_client_connect (
- destination, NULL, target_client_connect_cb, merge_context);
+ e_client_selector_get_client (
+ E_CLIENT_SELECTOR (selector), destination, NULL,
+ target_client_connect_cb, merge_context);
return TRUE;
}
@@ -381,14 +383,24 @@ e_addressbook_selector_init (EAddressbookSelector *selector)
}
GtkWidget *
-e_addressbook_selector_new (ESourceRegistry *registry)
+e_addressbook_selector_new (EClientCache *client_cache)
{
- g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), NULL);
+ ESourceRegistry *registry;
+ GtkWidget *widget;
+
+ g_return_val_if_fail (E_IS_CLIENT_CACHE (client_cache), NULL);
+
+ registry = e_client_cache_ref_registry (client_cache);
- return g_object_new (
+ widget = g_object_new (
E_TYPE_ADDRESSBOOK_SELECTOR,
+ "client-cache", client_cache,
"extension-name", E_SOURCE_EXTENSION_ADDRESS_BOOK,
"registry", registry, NULL);
+
+ g_object_unref (registry);
+
+ return widget;
}
EAddressbookView *
diff --git a/addressbook/gui/widgets/e-addressbook-selector.h b/addressbook/gui/widgets/e-addressbook-selector.h
index 663f58656b..3746bc3aeb 100644
--- a/addressbook/gui/widgets/e-addressbook-selector.h
+++ b/addressbook/gui/widgets/e-addressbook-selector.h
@@ -49,16 +49,16 @@ typedef struct _EAddressbookSelectorClass EAddressbookSelectorClass;
typedef struct _EAddressbookSelectorPrivate EAddressbookSelectorPrivate;
struct _EAddressbookSelector {
- ESourceSelector parent;
+ EClientSelector parent;
EAddressbookSelectorPrivate *priv;
};
struct _EAddressbookSelectorClass {
- ESourceSelectorClass parent_class;
+ EClientSelectorClass parent_class;
};
GType e_addressbook_selector_get_type (void);
-GtkWidget * e_addressbook_selector_new (ESourceRegistry *registry);
+GtkWidget * e_addressbook_selector_new (EClientCache *client_cache);
EAddressbookView *
e_addressbook_selector_get_current_view
(EAddressbookSelector *selector);