aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-12-04 00:27:06 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-12-04 00:27:06 +0800
commit5b7662b8c7a5e988c74ad142d7e5f63aee4085fa (patch)
tree73cb6a51e76a7837c94f52bf8c23ad8831902228 /mail
parentaf58db7c0f3ca69e3e876e00581e4d2612fc458e (diff)
downloadgsoc2013-evolution-5b7662b8c7a5e988c74ad142d7e5f63aee4085fa.tar.gz
gsoc2013-evolution-5b7662b8c7a5e988c74ad142d7e5f63aee4085fa.tar.zst
gsoc2013-evolution-5b7662b8c7a5e988c74ad142d7e5f63aee4085fa.zip
Fixed a FIXME by using the CamelProvider url flags to determine if the url
2003-12-03 Jeffrey Stedfast <fejj@ximian.com> * em-folder-selector.c (em_folder_selector_get_selected_uri): Fixed a FIXME by using the CamelProvider url flags to determine if the url used url->fragment or url->path as the folder path. svn path=/trunk/; revision=23604
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/em-folder-selector.c25
-rw-r--r--mail/em-folder-tree-model.c5
3 files changed, 26 insertions, 10 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 5c75baafc0..9181f562e4 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,9 @@
+2003-12-03 Jeffrey Stedfast <fejj@ximian.com>
+
+ * em-folder-selector.c (em_folder_selector_get_selected_uri):
+ Fixed a FIXME by using the CamelProvider url flags to determine if
+ the url used url->fragment or url->path as the folder path.
+
2003-12-03 JP Rosevear <jpr@ximian.com>
* em-folder-tree.c (em_folder_tree_destroy): remove the source
diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c
index b91fc1ce5b..dea2603e2f 100644
--- a/mail/em-folder-selector.c
+++ b/mail/em-folder-selector.c
@@ -270,7 +270,7 @@ em_folder_selector_set_selected (EMFolderSelector *emfs, const char *uri)
const char *
em_folder_selector_get_selected_uri (EMFolderSelector *emfs)
{
- const char *uri;
+ const char *uri, *name;
if (!(uri = em_folder_tree_get_selected_uri (emfs->emft))) {
d(printf ("no selected folder?\n"));
@@ -278,18 +278,29 @@ em_folder_selector_get_selected_uri (EMFolderSelector *emfs)
}
if (uri && emfs->name_entry) {
+ CamelProvider *provider;
+ CamelException ex;
CamelURL *url;
char *newpath;
+ camel_exception_init (&ex);
+ provider = camel_session_get_provider (session, uri, &ex);
+ camel_exception_clear (&ex);
+
+ name = gtk_entry_get_text (emfs->name_entry);
+
url = camel_url_new (uri, NULL);
- /* FIXME: if we try to create a toplevel folder on a
- * store that uses fragments, url->fragment will be
- * NULL and so the resultant url will be incorrect */
- newpath = g_strdup_printf ("%s/%s", url->fragment ? url->fragment : url->path, gtk_entry_get_text (emfs->name_entry));
- if (url->fragment)
+ if (provider && (provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH)) {
+ if (url->fragment)
+ newpath = g_strdup_printf ("%s/%s", url->fragment, name);
+ else
+ newpath = g_strdup (name);
+
camel_url_set_fragment (url, newpath);
- else
+ } else {
+ newpath = g_strdup_printf ("%s/%s", url->path ? url->path : "", name);
camel_url_set_path (url, newpath);
+ }
g_free (emfs->selected_path);
emfs->selected_path = newpath;
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index df6cf80e73..ecaa095f6f 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -461,9 +461,8 @@ model_drag_data_received (GtkTreeDragDest *drag_dest, GtkTreePath *dest_path, Gt
if ((folder = camel_store_get_folder (store, full_name, 0, &ex))) {
/* FIXME: would have been nicer if we could 'move'
* messages and/or folders. but alas, gtktreeview
- * drag&drop sucks ass and doesn't give us the
- * context->action to check for GDK_ACTION_MOVE, so we
- * can't. Yay. */
+ * drag&drop doesn't give us the context->action to
+ * check for GDK_ACTION_MOVE, so we can't. Yay. */
gboolean move = FALSE;
if (selection->target == gdk_atom_intern ("x-uid-list", FALSE)) {