diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-07-25 11:45:55 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-07-25 11:45:55 +0800 |
commit | 6a601c210be648e1cb61da744a715656027aa175 (patch) | |
tree | ac100996d459b6d9ccdc496b114af5caa7c04f07 /camel/providers/imap/camel-imap-store.c | |
parent | f2aca892ee6085ce48240a1ebd2897a56d1e8989 (diff) | |
download | gsoc2013-evolution-6a601c210be648e1cb61da744a715656027aa175.tar.gz gsoc2013-evolution-6a601c210be648e1cb61da744a715656027aa175.tar.zst gsoc2013-evolution-6a601c210be648e1cb61da744a715656027aa175.zip |
Updated to give special attention to the root folder.
2000-07-24 Jeffrey Stedfast <fejj@helixcode.com>
* providers/imap/camel-imap-store.c (get_folder): Updated to give special
attention to the root folder.
* providers/imap/camel-imap-folder.c (imap_get_subfolder_names_internal):
Updated to handle the root folder
(imap_get_message_count_internal): return 0 if folder can't hold messages
(camel_imap_folder_new): Change so that root folder gets special attention
and always gets can_hold_messages set to FALSE
svn path=/trunk/; revision=4308
Diffstat (limited to 'camel/providers/imap/camel-imap-store.c')
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index 2554588461..a8f6f8c6f0 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -66,7 +66,7 @@ static CamelFolder *get_folder (CamelStore *store, const char *folder_name, gboo CamelException *ex); static char *get_folder_name (CamelStore *store, const char *folder_name, CamelException *ex); static gboolean imap_noop (gpointer data); -static gboolean stream_is_alive (CamelStream *istream); +/*static gboolean stream_is_alive (CamelStream *istream);*/ static int camel_imap_status (char *cmdid, char *respbuf); static void @@ -171,7 +171,7 @@ try_connect (CamelService *service, CamelException *ex) memcpy (&sin.sin_addr, h->h_addr, sizeof (sin.sin_addr)); fd = socket (h->h_addrtype, SOCK_STREAM, 0); - if (fd == -1 || connect (fd, (struct sockaddr *)&sin, sizeof(sin)) == -1) { + if (fd == -1 || connect (fd, (struct sockaddr *)&sin, sizeof (sin)) == -1) { /* We don't want to set a CamelException here */ @@ -423,7 +423,7 @@ imap_connect (CamelService *service, CamelException *ex) } /* Lets add a timeout so that we can hopefully prevent getting disconnected */ - store->timeout_id = gtk_timeout_add (60000, imap_noop, store); + store->timeout_id = gtk_timeout_add (600000, imap_noop, store); return TRUE; } @@ -594,6 +594,7 @@ folder_is_selectable (CamelStore *store, const char *folder_path) static CamelFolder * get_folder (CamelStore *store, const char *folder_name, gboolean create, CamelException *ex) { + CamelURL *url = CAMEL_SERVICE (store)->url; CamelFolder *new_folder; char *folder_path, *dir_sep; @@ -601,28 +602,27 @@ get_folder (CamelStore *store, const char *folder_name, gboolean create, CamelEx g_return_val_if_fail (folder_name != NULL, NULL); dir_sep = CAMEL_IMAP_STORE (store)->dir_sep; - + if (!strcmp (folder_name, dir_sep)) - folder_path = g_strdup ("INBOX"); + folder_path = g_strdup (url->path + 1); else folder_path = g_strdup (folder_name); - + new_folder = camel_imap_folder_new (store, folder_path, ex); -#if 0 - if (camel_exception_is_set (ex)) { - camel_exception_clear (ex); - g_free (folder_path); - return NULL; - } -#endif + + if (!strcmp (folder_name, dir_sep)) + return new_folder; + if (create && !imap_create (new_folder, ex)) { - if (!folder_is_selectable (store, folder_path)) + if (!folder_is_selectable (store, folder_path)) { camel_exception_clear (ex); - - g_free (folder_path); - /* FIXME: destroy new_folder */ - - return NULL; + new_folder->can_hold_messages = FALSE; + return new_folder; + } else { + g_free (folder_path); + gtk_object_unref (GTK_OBJECT (new_folder)); + return NULL; + } } return new_folder; @@ -648,6 +648,7 @@ imap_noop (gpointer data) return TRUE; } +#if 0 static gboolean stream_is_alive (CamelStream *istream) { @@ -664,6 +665,7 @@ stream_is_alive (CamelStream *istream) return FALSE; } +#endif static int camel_imap_status (char *cmdid, char *respbuf) @@ -970,8 +972,13 @@ camel_imap_command_extended (CamelImapStore *store, CamelFolder *folder, char ** g_ptr_array_free (data, TRUE); - if (folder && recent > 0) - gtk_signal_emit_by_name (GTK_OBJECT (folder), "folder_changed", 0); + if (folder && recent > 0) { + CamelException *ex; + + ex = camel_exception_new (); + camel_imap_folder_changed (folder, ex); + camel_exception_free (ex); + } return status; } |