aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-tools.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-08-11 22:41:04 +0800
committerDan Winship <danw@src.gnome.org>2000-08-11 22:41:04 +0800
commitf0cbd6a20b8764be5524e5e4c666d33b22028b12 (patch)
treee1b5a1f3e15bd56b6bbdc035d0f89e39aa3343df /mail/mail-tools.c
parent5d33edf6a752557ddfb586ef153b3b5395f4c400 (diff)
downloadgsoc2013-evolution-f0cbd6a20b8764be5524e5e4c666d33b22028b12.tar
gsoc2013-evolution-f0cbd6a20b8764be5524e5e4c666d33b22028b12.tar.gz
gsoc2013-evolution-f0cbd6a20b8764be5524e5e4c666d33b22028b12.tar.bz2
gsoc2013-evolution-f0cbd6a20b8764be5524e5e4c666d33b22028b12.tar.lz
gsoc2013-evolution-f0cbd6a20b8764be5524e5e4c666d33b22028b12.tar.xz
gsoc2013-evolution-f0cbd6a20b8764be5524e5e4c666d33b22028b12.tar.zst
gsoc2013-evolution-f0cbd6a20b8764be5524e5e4c666d33b22028b12.zip
Add a function to return a useful name for a folder (not just "mbox" or
* mail-tools.c (mail_tool_get_folder_name): Add a function to return a useful name for a folder (not just "mbox" or "mh" for any local folder.) * mail-ops.c: Use mail_tool_get_folder_name rather than folder->full_name when printing folder names. svn path=/trunk/; revision=4733
Diffstat (limited to 'mail/mail-tools.c')
-rw-r--r--mail/mail-tools.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index dba9a60d3c..aa768c6def 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -117,6 +117,25 @@ mail_tool_get_folder_from_urlname (const gchar *url, const gchar *name,
return folder;
}
+const gchar *
+mail_tool_get_folder_name (CamelFolder *folder)
+{
+ const char *name = camel_folder_get_full_name (folder);
+ char *path;
+
+ /* This is a kludge. */
+
+ if (strcmp (name, "//mbox") && strcmp (name, "//mh"))
+ return name;
+
+ /* For mbox/mh, return the parent store's final path component. */
+ path = CAMEL_SERVICE (folder->parent_store)->url->path;
+ if (strchr (path, '/'))
+ return strrchr (path, '/') + 1;
+ else
+ return path;
+}
+
gchar *
mail_tool_get_local_inbox_url (void)
{