aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog6
-rw-r--r--camel/camel-folder.c31
-rw-r--r--camel/camel-folder.h6
3 files changed, 42 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index a62a593ca5..5828717440 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,9 @@
+2001-09-16 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-folder.c (camel_folder_get_uri): New function to get the
+ URI of a folder.
+ (get_uri): Default implementation.
+
2001-09-14 <NotZed@Ximian.com>
* camel-vee-folder.c (camel_vee_folder_set_folders): New function,
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index dc93443c7c..3bbd8437e6 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -108,6 +108,8 @@ static void move_messages_to (CamelFolder *source,
CamelFolder *dest,
CamelException *ex);
+static char *get_uri (CamelFolder *folder);
+
static void freeze (CamelFolder *folder);
static void thaw (CamelFolder *folder);
static gboolean is_frozen (CamelFolder *folder);
@@ -154,6 +156,7 @@ camel_folder_class_init (CamelFolderClass *camel_folder_class)
camel_folder_class->free_message_info = free_message_info;
camel_folder_class->copy_messages_to = copy_messages_to;
camel_folder_class->move_messages_to = move_messages_to;
+ camel_folder_class->get_uri = get_uri;
camel_folder_class->freeze = freeze;
camel_folder_class->thaw = thaw;
camel_folder_class->is_frozen = is_frozen;
@@ -1250,6 +1253,34 @@ camel_folder_move_messages_to (CamelFolder *source, GPtrArray *uids,
CAMEL_FOLDER_UNLOCK(source, lock);
}
+
+static char *
+get_uri (CamelFolder *folder)
+{
+ /* default implementation */
+ CamelService *service = CAMEL_SERVICE (folder->parent_store);
+ char *service_url, *url;
+
+ service_url = camel_url_to_string (service->url, CAMEL_URL_HIDE_ALL);
+ url = g_strdup_printf ("%s/%s", service_url, folder->full_name);
+ g_free (service_url);
+
+ return url;
+}
+
+
+/**
+ * camel_folder_get_uri:
+ * @folder:
+ *
+ * Returns the uri for the given folder.
+ **/
+char *
+camel_folder_get_uri (CamelFolder *folder)
+{
+ return CF_CLASS (folder)->get_uri (folder);
+}
+
static void
freeze (CamelFolder *folder)
{
diff --git a/camel/camel-folder.h b/camel/camel-folder.h
index cc4bf78a0f..b869ee1264 100644
--- a/camel/camel-folder.h
+++ b/camel/camel-folder.h
@@ -150,7 +150,9 @@ typedef struct {
GPtrArray *uids,
CamelFolder *destination,
CamelException *ex);
-
+
+ char *(*get_uri) (CamelFolder *folder);
+
void (*freeze) (CamelFolder *folder);
void (*thaw) (CamelFolder *folder);
gboolean (*is_frozen) (CamelFolder *folder);
@@ -267,6 +269,8 @@ void camel_folder_move_messages_to (CamelFolder *source,
CamelFolder *dest,
CamelException *ex);
+char *camel_folder_get_uri (CamelFolder *folder);
+
/* stop/restart getting events */
void camel_folder_freeze (CamelFolder *folder);
void camel_folder_thaw (CamelFolder *folder);