aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-11-18 06:34:38 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-11-18 06:34:38 +0800
commite86602f0ef887fcace201e6f898bd8f2437deaaf (patch)
treeccb48c53b8ab4e3befc473b71906761f4c676459 /mail
parent561b83c1a1128305b27026cf284320c333966f4a (diff)
downloadgsoc2013-evolution-e86602f0ef887fcace201e6f898bd8f2437deaaf.tar.gz
gsoc2013-evolution-e86602f0ef887fcace201e6f898bd8f2437deaaf.tar.zst
gsoc2013-evolution-e86602f0ef887fcace201e6f898bd8f2437deaaf.zip
Fixed to check fi->child as well (since mbox does it right).
2003-11-17 Jeffrey Stedfast <fejj@ximian.com> * em-folder-tree.c (tree_row_expanded): Fixed to check fi->child as well (since mbox does it right). (emft_popup_new_folder_response): Fixed to subscribe to the correct folder. (emft_popup_delete_folders): Fixed to use the full_name rather than the path. svn path=/trunk/; revision=23407
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog4
-rw-r--r--mail/em-folder-tree.c27
2 files changed, 19 insertions, 12 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index b2733b5314..91613fcc5d 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -2,6 +2,10 @@
* em-folder-tree.c (tree_row_expanded): Fixed to check fi->child
as well (since mbox does it right).
+ (emft_popup_new_folder_response): Fixed to subscribe to the
+ correct folder.
+ (emft_popup_delete_folders): Fixed to use the full_name rather
+ than the path.
* em-folder-selection-button.c (set_contents): Fixed to not
include leading '/' in the folder name in the label.
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index 6adf2f18d1..9aa51ce1fa 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -1231,11 +1231,11 @@ emft_popup_new_folder_response (EMFolderSelector *emfs, int response, EMFolderTr
/* FIXME: ugh, kludge-a-licious: EMFolderSelector uses EMFolderTree so we can poke emfs->emft internals */
struct _EMFolderTreePrivate *priv = emfs->emft->priv;
struct _EMFolderTreeModelStoreInfo *si;
- const char *uri, *parent;
+ const char *uri, *parent, *path, *full_name;
+ char *name, *namebuf = NULL;
GtkWidget *dialog;
CamelStore *store;
CamelException ex;
- char *path, *name;
if (response != GTK_RESPONSE_OK) {
gtk_widget_destroy ((GtkWidget *) emfs);
@@ -1243,7 +1243,7 @@ emft_popup_new_folder_response (EMFolderSelector *emfs, int response, EMFolderTr
}
uri = em_folder_selector_get_selected_uri (emfs);
- path = (char *) em_folder_selector_get_selected_path (emfs);
+ path = em_folder_selector_get_selected_path (emfs);
d(printf ("Creating folder: %s (%s)\n", path, uri));
camel_exception_init (&ex);
@@ -1259,13 +1259,14 @@ emft_popup_new_folder_response (EMFolderSelector *emfs, int response, EMFolderTr
camel_object_unref (store);
/* FIXME: camel_store_create_folder should just take full path names */
- path = g_strdup (path[0] == '/' ? path + 1 : path);
- if (!(name = strrchr (path, '/'))) {
- name = path;
+ full_name = path[0] == '/' ? path + 1 : path;
+ namebuf = g_strdup (full_name);
+ if (!(name = strrchr (namebuf, '/'))) {
+ name = namebuf;
parent = "";
} else {
*name++ = '\0';
- parent = path;
+ parent = namebuf;
}
d(printf ("creating folder name='%s' path='%s'\n", name, path));
@@ -1274,12 +1275,12 @@ emft_popup_new_folder_response (EMFolderSelector *emfs, int response, EMFolderTr
if (camel_exception_is_set (&ex)) {
goto exception;
} else if (camel_store_supports_subscriptions (si->store)) {
- camel_store_subscribe_folder (si->store, path, &ex);
+ camel_store_subscribe_folder (si->store, full_name, &ex);
if (camel_exception_is_set (&ex))
goto exception;
}
- g_free (path);
+ g_free (namebuf);
gtk_widget_destroy ((GtkWidget *) emfs);
@@ -1291,7 +1292,7 @@ emft_popup_new_folder_response (EMFolderSelector *emfs, int response, EMFolderTr
GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("%s"), ex.desc);
g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog);
camel_exception_clear (&ex);
- g_free (path);
+ g_free (namebuf);
gtk_widget_show (dialog);
}
@@ -1351,15 +1352,17 @@ emft_popup_delete_rec (CamelStore *store, CamelFolderInfo *fi, CamelException *e
}
static void
-emft_popup_delete_folders (CamelStore *store, const char *base, CamelException *ex)
+emft_popup_delete_folders (CamelStore *store, const char *path, CamelException *ex)
{
guint32 flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE;
+ const char *full_name;
CamelFolderInfo *fi;
if (camel_store_supports_subscriptions (store))
flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
- fi = camel_store_get_folder_info (store, base, flags, ex);
+ full_name = path[0] == '/' ? path + 1 : path;
+ fi = camel_store_get_folder_info (store, full_name, flags, ex);
if (camel_exception_is_set (ex))
return;