[evolution-kolab/account-mgmt: 6/12] Add kolab_util_backend_get_foldername().



commit 39ec4aa0c4952ff97118ec087cc298bb9e330e7d
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Jun 27 13:21:21 2012 -0400

    Add kolab_util_backend_get_foldername().
    
    Extracts a Kolab foldername from an EBackend.

 src/libekolab/kolab-util-backend.c |   24 ++++++++++++++++++++++++
 src/libekolab/kolab-util-backend.h |    3 ++-
 2 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/src/libekolab/kolab-util-backend.c b/src/libekolab/kolab-util-backend.c
index 20c9657..4468a71 100644
--- a/src/libekolab/kolab-util-backend.c
+++ b/src/libekolab/kolab-util-backend.c
@@ -78,6 +78,30 @@ kolab_util_backend_error_quark (void)
 /*----------------------------------------------------------------------------*/
 
 /**
+ * kolab_util_backend_get_foldername:
+ * @backend: an #EBackend
+ *
+ * Returns the Kolab foldername for @backend.
+ *
+ * Returns: the foldername for @backend
+ **/
+const gchar *
+kolab_util_backend_get_foldername (EBackend *backend)
+{
+	ESource *source;
+	ESourceResource *extension;
+	const gchar *extension_name;
+
+	g_return_val_if_fail (E_IS_BACKEND (backend), NULL);
+
+	source = e_backend_get_source (backend);
+	extension_name = E_SOURCE_EXTENSION_RESOURCE;
+	extension = e_source_get_extension (source, extension_name);
+
+	return e_source_resource_get_identity (extension);
+}
+
+/**
  * kolab_util_backend_get_relative_path_from_uri:
  * @uri: An URI string
  *
diff --git a/src/libekolab/kolab-util-backend.h b/src/libekolab/kolab-util-backend.h
index 478925a..4e68cd7 100644
--- a/src/libekolab/kolab-util-backend.h
+++ b/src/libekolab/kolab-util-backend.h
@@ -35,7 +35,7 @@
 
 #include <libebook/libebook.h>
 #include <libecal/libecal.h>
-#include <libedataserver/libedataserver.h>
+#include <libebackend/libebackend.h>
 
 #include <libekolabutil/camel-system-headers.h>
 #include <libekolabutil/kolab-util-sqlite.h>
@@ -74,6 +74,7 @@ GQuark kolab_util_backend_error_quark (void) G_GNUC_CONST;
 
 /*----------------------------------------------------------------------------*/
 
+const gchar *kolab_util_backend_get_foldername (EBackend *backend);
 gchar *kolab_util_backend_get_relative_path_from_uri (const gchar *uri);
 gchar *kolab_util_backend_get_protocol_from_uri (const gchar *uri);
 KolabSyncStrategyID kolab_util_misc_sync_value_from_property (const gchar *sync_prop);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]