diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-09-17 04:31:06 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-09-17 04:31:06 +0800 |
commit | a6c8b690b964552f57fa6fe2822beccc0489a7b4 (patch) | |
tree | b0025e5f9e9b7f9d23445a85fff624ffdfc01a51 /camel/camel-folder.c | |
parent | 4d8786621d12118a2aae67784705dc4193fade81 (diff) | |
download | gsoc2013-evolution-a6c8b690b964552f57fa6fe2822beccc0489a7b4.tar gsoc2013-evolution-a6c8b690b964552f57fa6fe2822beccc0489a7b4.tar.gz gsoc2013-evolution-a6c8b690b964552f57fa6fe2822beccc0489a7b4.tar.bz2 gsoc2013-evolution-a6c8b690b964552f57fa6fe2822beccc0489a7b4.tar.lz gsoc2013-evolution-a6c8b690b964552f57fa6fe2822beccc0489a7b4.tar.xz gsoc2013-evolution-a6c8b690b964552f57fa6fe2822beccc0489a7b4.tar.zst gsoc2013-evolution-a6c8b690b964552f57fa6fe2822beccc0489a7b4.zip |
New function to get the URI of a folder. (get_uri): Default
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.
svn path=/trunk/; revision=12860
Diffstat (limited to 'camel/camel-folder.c')
-rw-r--r-- | camel/camel-folder.c | 31 |
1 files changed, 31 insertions, 0 deletions
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) { |