[evolution-data-server] ECollectionBackend: Add default method for dup_resource_id().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] ECollectionBackend: Add default method for dup_resource_id().
- Date: Wed, 27 Jun 2012 12:30:55 +0000 (UTC)
commit 25b692ba80a86fb7bc0be7092898a3c3f59049cd
Author: Matthew Barnes <mbarnes redhat com>
Date: Wed Jun 27 08:27:54 2012 -0400
ECollectionBackend: Add default method for dup_resource_id().
Now checks for an E_SOURCE_EXTENSION_RESOURCE by default and returns the
"identity" value if the extension if present. Otherwise it returns NULL.
libebackend/e-collection-backend.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/libebackend/e-collection-backend.c b/libebackend/e-collection-backend.c
index 063e383..888b5a5 100644
--- a/libebackend/e-collection-backend.c
+++ b/libebackend/e-collection-backend.c
@@ -572,6 +572,25 @@ collection_backend_populate (ECollectionBackend *backend)
/* Placeholder so subclasses can safely chain up. */
}
+static gchar *
+collection_backend_dup_resource_id (ECollectionBackend *backend,
+ ESource *source)
+{
+ const gchar *extension_name;
+ gchar *resource_id = NULL;
+
+ extension_name = E_SOURCE_EXTENSION_RESOURCE;
+
+ if (e_source_has_extension (source, extension_name)) {
+ ESourceResource *extension;
+
+ extension = e_source_get_extension (source, extension_name);
+ resource_id = e_source_resource_dup_identity (extension);
+ }
+
+ return resource_id;
+}
+
static void
collection_backend_child_added (ECollectionBackend *backend,
ESource *child_source)
@@ -610,6 +629,7 @@ e_collection_backend_class_init (ECollectionBackendClass *class)
object_class->constructed = collection_backend_constructed;
class->populate = collection_backend_populate;
+ class->dup_resource_id = collection_backend_dup_resource_id;
class->child_added = collection_backend_child_added;
class->child_removed = collection_backend_child_removed;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]