aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-tools.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-05-12 03:50:04 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-05-12 03:50:04 +0800
commit6febeab3270c35664cc3938d4f89b9c292550040 (patch)
tree2d04c55cf7fc1674f6b5b0c19fd6cad99400f3f3 /mail/mail-tools.c
parentb4796b63763b08f13aa77f51f679d0b660bf48a4 (diff)
downloadgsoc2013-evolution-6febeab3270c35664cc3938d4f89b9c292550040.tar
gsoc2013-evolution-6febeab3270c35664cc3938d4f89b9c292550040.tar.gz
gsoc2013-evolution-6febeab3270c35664cc3938d4f89b9c292550040.tar.bz2
gsoc2013-evolution-6febeab3270c35664cc3938d4f89b9c292550040.tar.lz
gsoc2013-evolution-6febeab3270c35664cc3938d4f89b9c292550040.tar.xz
gsoc2013-evolution-6febeab3270c35664cc3938d4f89b9c292550040.tar.zst
gsoc2013-evolution-6febeab3270c35664cc3938d4f89b9c292550040.zip
Set a title on the window "Reconfigure %s" where %s is the folder name.
2001-05-11 Jeffrey Stedfast <fejj@ximian.com> * mail-local.c (mail_local_reconfigure_folder): Set a title on the window "Reconfigure %s" where %s is the folder name. Also, don't allow more than one of these type windows to be opened per folder. * mail-tools.c (mail_tool_get_folder_name): Fix Danw's kludge to actually work :-) svn path=/trunk/; revision=9767
Diffstat (limited to 'mail/mail-tools.c')
-rw-r--r--mail/mail-tools.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index 994879953b..abec85f86c 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -62,23 +62,27 @@ mail_tool_get_folder_from_urlname (const gchar *url, const gchar *name,
return folder;
}
-const gchar *
+char *
mail_tool_get_folder_name (CamelFolder *folder)
{
const char *name = camel_folder_get_full_name (folder);
- char *path;
-
+ char *path, *pend;
+
/* This is a kludge. */
-
- if (strcmp (name, "//mbox") && strcmp (name, "//mh"))
- return name;
-
+ if (strcmp (name, "mbox") && strcmp (name, "mh") && strcmp (name, "maildir"))
+ return g_strdup (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;
+ path = g_strdup (CAMEL_SERVICE (folder->parent_store)->url->path);
+ pend = path + strlen (path) - 1;
+ if (*pend == '/')
+ *pend = '\0';
+
+ pend = path;
+ path = g_strdup (g_basename (path));
+ g_free (pend);
+
+ return path;
}
gchar *