aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBertrand Guiheneuf <bertrand@src.gnome.org>1999-09-24 03:26:54 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-09-24 03:26:54 +0800
commit6ed1a40852d43229bec2509d7d0b9e35efde163f (patch)
tree3e62a7cf60ceaaecfbf05f4d8ed09207690cfcc2
parent6d24357f783eff964bcae1c531e08c5040b3b919 (diff)
downloadgsoc2013-evolution-6ed1a40852d43229bec2509d7d0b9e35efde163f.tar
gsoc2013-evolution-6ed1a40852d43229bec2509d7d0b9e35efde163f.tar.gz
gsoc2013-evolution-6ed1a40852d43229bec2509d7d0b9e35efde163f.tar.bz2
gsoc2013-evolution-6ed1a40852d43229bec2509d7d0b9e35efde163f.tar.lz
gsoc2013-evolution-6ed1a40852d43229bec2509d7d0b9e35efde163f.tar.xz
gsoc2013-evolution-6ed1a40852d43229bec2509d7d0b9e35efde163f.tar.zst
gsoc2013-evolution-6ed1a40852d43229bec2509d7d0b9e35efde163f.zip
Added corba-like exception system to CamelFolder. The exception system is
* Added corba-like exception system to CamelFolder. The exception system is not finished but I wanted the async and event implementation to get this right from the beginning. svn path=/trunk/; revision=1256
-rw-r--r--camel/camel-folder-pt-proxy.c146
-rw-r--r--camel/camel-folder.c240
-rw-r--r--camel/camel-folder.h113
-rw-r--r--camel/providers/MH/camel-mh-folder.c112
-rw-r--r--camel/providers/MH/camel-mh-store.c4
-rw-r--r--camel/providers/MH/mh-uid.c2
-rw-r--r--camel/providers/maildir/camel-maildir-folder.c58
-rw-r--r--camel/providers/maildir/camel-maildir-store.c4
-rw-r--r--tests/test4.c8
9 files changed, 352 insertions, 335 deletions
diff --git a/camel/camel-folder-pt-proxy.c b/camel/camel-folder-pt-proxy.c
index e480494ae0..f6a5dc5bc0 100644
--- a/camel/camel-folder-pt-proxy.c
+++ b/camel/camel-folder-pt-proxy.c
@@ -42,34 +42,34 @@ static CamelFolderClass *parent_class=NULL;
#define CFPP_CLASS(so) CAMEL_FOLDER_PT_PROXY_CLASS (GTK_OBJECT(so)->klass)
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (GTK_OBJECT(so)->klass)
-static void _init_with_store (CamelFolder *folder, CamelStore *parent_store);
-static void _open (CamelFolder *folder, CamelFolderOpenMode mode);
-static void _close (CamelFolder *folder, gboolean expunge);
-static void _set_name (CamelFolder *folder, const gchar *name);
-static const gchar *_get_name (CamelFolder *folder);
-static const gchar *_get_full_name (CamelFolder *folder);
-static gboolean _can_hold_folders (CamelFolder *folder);
-static gboolean _can_hold_messages(CamelFolder *folder);
-static gboolean _exists (CamelFolder *folder);
-static gboolean _is_open (CamelFolder *folder);
-static CamelFolder *_get_folder (CamelFolder *folder, const gchar *folder_name);
-static gboolean _create (CamelFolder *folder);
-static gboolean _delete (CamelFolder *folder, gboolean recurse);
-static gboolean _delete_messages (CamelFolder *folder);
-static CamelFolder *_get_parent_folder (CamelFolder *folder);
-static CamelStore *_get_parent_store (CamelFolder *folder);
-static CamelFolderOpenMode _get_mode (CamelFolder *folder);
-static GList *_list_subfolders (CamelFolder *folder);
-static void _expunge (CamelFolder *folder);
-static CamelMimeMessage *_get_message (CamelFolder *folder, gint number);
-static gint _get_message_count (CamelFolder *folder);
-static gint _append_message (CamelFolder *folder, CamelMimeMessage *message);
-static const GList *_list_permanent_flags (CamelFolder *folder);
-static void _copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder);
-
-static const gchar *_get_message_uid (CamelFolder *folder, CamelMimeMessage *message);
-static CamelMimeMessage *_get_message_by_uid (CamelFolder *folder, const gchar *uid);
-static GList *_get_uid_list (CamelFolder *folder);
+static void _init_with_store (CamelFolder *folder, CamelStore *parent_store, CamelException *ex);
+static void _open (CamelFolder *folder, CamelFolderOpenMode mode, CamelException *ex);
+static void _close (CamelFolder *folder, gboolean expunge, CamelException *ex);
+static void _set_name (CamelFolder *folder, const gchar *name, CamelException *ex);
+static const gchar *_get_name (CamelFolder *folder, CamelException *ex);
+static const gchar *_get_full_name (CamelFolder *folder, CamelException *ex);
+static gboolean _can_hold_folders (CamelFolder *folder, CamelException *ex);
+static gboolean _can_hold_messages(CamelFolder *folder, CamelException *ex);
+static gboolean _exists (CamelFolder *folder, CamelException *ex);
+static gboolean _is_open (CamelFolder *folder, CamelException *ex);
+static CamelFolder *_get_folder (CamelFolder *folder, const gchar *folder_name, CamelException *ex);
+static gboolean _create (CamelFolder *folder, CamelException *ex);
+static gboolean _delete (CamelFolder *folder, gboolean recurse, CamelException *ex);
+static gboolean _delete_messages (CamelFolder *folder, CamelException *ex);
+static CamelFolder *_get_parent_folder (CamelFolder *folder, CamelException *ex);
+static CamelStore *_get_parent_store (CamelFolder *folder, CamelException *ex);
+static CamelFolderOpenMode _get_mode (CamelFolder *folder, CamelException *ex);
+static GList *_list_subfolders (CamelFolder *folder, CamelException *ex);
+static void _expunge (CamelFolder *folder, CamelException *ex);
+static CamelMimeMessage *_get_message (CamelFolder *folder, gint number, CamelException *ex);
+static gint _get_message_count (CamelFolder *folder, CamelException *ex);
+static gint _append_message (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex);
+static const GList *_list_permanent_flags (CamelFolder *folder, CamelException *ex);
+static void _copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder, CamelException *ex);
+
+static const gchar *_get_message_uid (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex);
+static CamelMimeMessage *_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException *ex);
+static GList *_get_uid_list (CamelFolder *folder, CamelException *ex);
static void _finalize (GtkObject *object);
@@ -457,6 +457,7 @@ _thread_notification_catch (GIOChannel *source,
typedef struct {
CamelFolder *folder;
CamelStore *parent_store;
+ CamelException *ex;
} _InitStoreParam;
static void
@@ -464,12 +465,15 @@ _async_init_with_store (gpointer param)
{
_InitStoreParam *init_store_param;
CamelFolder *folder;
-
+ CamelException *ex;
+
init_store_param = (_InitStoreParam *)param;
folder = init_store_param->folder;
- CF_CLASS (folder)->init_with_store (folder, init_store_param->parent_store);
+ CF_CLASS (folder)->init_with_store (folder,
+ init_store_param->parent_store,
+ NULL);
g_free (param);
/* tell the main thread we are completed */
@@ -479,7 +483,7 @@ _async_init_with_store (gpointer param)
static void
-_init_with_store (CamelFolder *folder, CamelStore *parent_store)
+_init_with_store (CamelFolder *folder, CamelStore *parent_store, CamelException *ex)
{
CamelFolderPtProxy *proxy_folder = CAMEL_FOLDER_PT_PROXY (folder);
_InitStoreParam *param;
@@ -513,6 +517,7 @@ _init_with_store (CamelFolder *folder, CamelStore *parent_store)
typedef struct {
CamelFolder *folder;
CamelFolderOpenMode mode;
+ CamelException *ex;
} _OpenFolderParam;
static void
@@ -520,19 +525,22 @@ _async_open (gpointer param)
{
_OpenFolderParam *open_folder_param;
CamelFolder *folder;
+ CamelException *ex;
open_folder_param = (_OpenFolderParam *)param;
folder = open_folder_param->folder;
- CF_CLASS (folder)->open (folder, open_folder_param->mode);
+ CF_CLASS (folder)->open (folder,
+ open_folder_param->mode,
+ NULL);
g_free (param);
_notify_availability (folder, 'a');
}
static void
-_open (CamelFolder *folder, CamelFolderOpenMode mode)
+_open (CamelFolder *folder, CamelFolderOpenMode mode, CamelException *ex)
{
CamelFolderPtProxy *proxy_folder = CAMEL_FOLDER_PT_PROXY (folder);
_OpenFolderParam *param;
@@ -558,6 +566,7 @@ _open (CamelFolder *folder, CamelFolderOpenMode mode)
typedef struct {
CamelFolder *folder;
gboolean expunge;
+ CamelException *ex;
} _CloseFolderParam;
static void
@@ -565,19 +574,22 @@ _async_close (gpointer param)
{
_CloseFolderParam *close_folder_param;
CamelFolder *folder;
-
+ CamelException *ex;
+
close_folder_param = (_CloseFolderParam *)param;
folder = close_folder_param->folder;
- CF_CLASS (folder)->close (folder, close_folder_param->expunge);
+ CF_CLASS (folder)->close (folder,
+ close_folder_param->expunge,
+ NULL);
g_free (param);
_notify_availability (folder, 'a');
}
static void
-_close (CamelFolder *folder, gboolean expunge)
+_close (CamelFolder *folder, gboolean expunge, CamelException *ex)
{
CamelFolderPtProxy *proxy_folder = CAMEL_FOLDER_PT_PROXY (folder);
_CloseFolderParam *param;
@@ -602,6 +614,7 @@ _close (CamelFolder *folder, gboolean expunge)
typedef struct {
CamelFolder *folder;
const gchar *name;
+ CamelException *ex;
} _SetNameFolderParam;
static void
@@ -609,19 +622,22 @@ _async_set_name (gpointer param)
{
_SetNameFolderParam *set_name_folder_param;
CamelFolder *folder;
+ CamelException *ex;
set_name_folder_param = (_SetNameFolderParam *)param;
folder = set_name_folder_param->folder;
- CF_CLASS (folder)->set_name (folder, set_name_folder_param->name);
+ CF_CLASS (folder)->set_name (folder,
+ set_name_folder_param->name,
+ NULL);
g_free (param);
_notify_availability (folder, 'a');
}
static void
-_set_name (CamelFolder *folder, const gchar *name)
+_set_name (CamelFolder *folder, const gchar *name, CamelException *ex)
{
CamelFolderPtProxy *proxy_folder = CAMEL_FOLDER_PT_PROXY (folder);
_SetNameFolderParam *param;
@@ -643,31 +659,31 @@ _set_name (CamelFolder *folder, const gchar *name)
/* folder->get_name implementation */
/* this one i not executed in a thread */
static const gchar *
-_get_name (CamelFolder *folder)
+_get_name (CamelFolder *folder, CamelException *ex)
{
CamelFolderPtProxy *proxy_folder = CAMEL_FOLDER_PT_PROXY (folder);
return CF_CLASS (proxy_folder->real_folder)->
- get_name (proxy_folder->real_folder);
+ get_name (proxy_folder->real_folder, ex);
}
static const gchar *
-_get_full_name (CamelFolder *folder)
+_get_full_name (CamelFolder *folder, CamelException *ex)
{
CamelFolderPtProxy *proxy_folder = CAMEL_FOLDER_PT_PROXY (folder);
return CF_CLASS (proxy_folder->real_folder)->
- get_full_name (proxy_folder->real_folder);
+ get_full_name (proxy_folder->real_folder, ex);
}
static gboolean
-_can_hold_folders (CamelFolder *folder)
+_can_hold_folders (CamelFolder *folder, CamelException *ex)
{
return folder->can_hold_folders;
}
@@ -676,7 +692,7 @@ _can_hold_folders (CamelFolder *folder)
static gboolean
-_can_hold_messages (CamelFolder *folder)
+_can_hold_messages (CamelFolder *folder, CamelException *ex)
{
return folder->can_hold_messages;
}
@@ -684,7 +700,7 @@ _can_hold_messages (CamelFolder *folder)
static gboolean
-_exists (CamelFolder *folder)
+_exists (CamelFolder *folder, CamelException *ex)
{
return FALSE;
}
@@ -693,7 +709,7 @@ _exists (CamelFolder *folder)
static gboolean
-_is_open (CamelFolder *folder)
+_is_open (CamelFolder *folder, CamelException *ex)
{
return (folder->open_state == FOLDER_OPEN);
}
@@ -703,7 +719,7 @@ _is_open (CamelFolder *folder)
static CamelFolder *
-_get_folder (CamelFolder *folder, const gchar *folder_name)
+_get_folder (CamelFolder *folder, const gchar *folder_name, CamelException *ex)
{
return NULL;
@@ -715,7 +731,7 @@ _get_folder (CamelFolder *folder, const gchar *folder_name)
static gboolean
-_create(CamelFolder *folder)
+_create(CamelFolder *folder, CamelException *ex)
{
return FALSE;
@@ -729,7 +745,7 @@ _create(CamelFolder *folder)
static gboolean
-_delete (CamelFolder *folder, gboolean recurse)
+_delete (CamelFolder *folder, gboolean recurse, CamelException *ex)
{
return FALSE;
}
@@ -741,7 +757,7 @@ _delete (CamelFolder *folder, gboolean recurse)
static gboolean
-_delete_messages (CamelFolder *folder)
+_delete_messages (CamelFolder *folder, CamelException *ex)
{
return TRUE;
}
@@ -752,7 +768,7 @@ _delete_messages (CamelFolder *folder)
static CamelFolder *
-_get_parent_folder (CamelFolder *folder)
+_get_parent_folder (CamelFolder *folder, CamelException *ex)
{
return folder->parent_folder;
}
@@ -762,7 +778,7 @@ _get_parent_folder (CamelFolder *folder)
static CamelStore *
-_get_parent_store (CamelFolder *folder)
+_get_parent_store (CamelFolder *folder, CamelException *ex)
{
return folder->parent_store;
}
@@ -771,7 +787,7 @@ _get_parent_store (CamelFolder *folder)
static CamelFolderOpenMode
-_get_mode (CamelFolder *folder)
+_get_mode (CamelFolder *folder, CamelException *ex)
{
return folder->open_mode;
}
@@ -780,7 +796,7 @@ _get_mode (CamelFolder *folder)
static GList *
-_list_subfolders (CamelFolder *folder)
+_list_subfolders (CamelFolder *folder, CamelException *ex)
{
return NULL;
}
@@ -789,7 +805,7 @@ _list_subfolders (CamelFolder *folder)
static void
-_expunge (CamelFolder *folder)
+_expunge (CamelFolder *folder, CamelException *ex)
{
}
@@ -798,7 +814,7 @@ _expunge (CamelFolder *folder)
static CamelMimeMessage *
-_get_message (CamelFolder *folder, gint number)
+_get_message (CamelFolder *folder, gint number, CamelException *ex)
{
return NULL;
}
@@ -808,7 +824,7 @@ _get_message (CamelFolder *folder, gint number)
static gint
-_get_message_count (CamelFolder *folder)
+_get_message_count (CamelFolder *folder, CamelException *ex)
{
return -1;
}
@@ -817,7 +833,7 @@ _get_message_count (CamelFolder *folder)
static gint
-_append_message (CamelFolder *folder, CamelMimeMessage *message)
+_append_message (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex)
{
return -1;
}
@@ -825,7 +841,7 @@ _append_message (CamelFolder *folder, CamelMimeMessage *message)
static const GList *
-_list_permanent_flags (CamelFolder *folder)
+_list_permanent_flags (CamelFolder *folder, CamelException *ex)
{
return folder->permanent_flags;
}
@@ -833,9 +849,9 @@ _list_permanent_flags (CamelFolder *folder)
static void
-_copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder)
+_copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder, CamelException *ex)
{
- camel_folder_append_message (dest_folder, message);
+ camel_folder_append_message (dest_folder, message, ex);
}
@@ -847,7 +863,7 @@ _copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *d
static const gchar *
-_get_message_uid (CamelFolder *folder, CamelMimeMessage *message)
+_get_message_uid (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex)
{
return NULL;
}
@@ -855,7 +871,7 @@ _get_message_uid (CamelFolder *folder, CamelMimeMessage *message)
/* the next two func are left there temporarily */
static const gchar *
-_get_message_uid_by_number (CamelFolder *folder, gint message_number)
+_get_message_uid_by_number (CamelFolder *folder, gint message_number, CamelException *ex)
{
return NULL;
}
@@ -863,14 +879,14 @@ _get_message_uid_by_number (CamelFolder *folder, gint message_number)
static CamelMimeMessage *
-_get_message_by_uid (CamelFolder *folder, const gchar *uid)
+_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
return NULL;
}
static GList *
-_get_uid_list (CamelFolder *folder)
+_get_uid_list (CamelFolder *folder, CamelException *ex)
{
return NULL;
}
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 5fb9b6a29a..adcc7fc423 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -30,35 +30,35 @@ static GtkObjectClass *parent_class=NULL;
/* Returns the class for a CamelFolder */
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (GTK_OBJECT(so)->klass)
-static void _init_with_store (CamelFolder *folder, CamelStore *parent_store);
-static void _open (CamelFolder *folder, CamelFolderOpenMode mode);
-static void _close (CamelFolder *folder, gboolean expunge);
-static void _set_name (CamelFolder *folder, const gchar *name);
+static void _init_with_store (CamelFolder *folder, CamelStore *parent_store, CamelException *ex);
+static void _open (CamelFolder *folder, CamelFolderOpenMode mode, CamelException *ex);
+static void _close (CamelFolder *folder, gboolean expunge, CamelException *ex);
+static void _set_name (CamelFolder *folder, const gchar *name, CamelException *ex);
/* static void _set_full_name (CamelFolder *folder, const gchar *name); */
-static const gchar *_get_name (CamelFolder *folder);
-static const gchar *_get_full_name (CamelFolder *folder);
-static gboolean _can_hold_folders (CamelFolder *folder);
-static gboolean _can_hold_messages(CamelFolder *folder);
-static gboolean _exists (CamelFolder *folder);
-static gboolean _is_open (CamelFolder *folder);
-static CamelFolder *_get_folder (CamelFolder *folder, const gchar *folder_name);
-static gboolean _create (CamelFolder *folder);
-static gboolean _delete (CamelFolder *folder, gboolean recurse);
-static gboolean _delete_messages (CamelFolder *folder);
-static CamelFolder *_get_parent_folder (CamelFolder *folder);
-static CamelStore *_get_parent_store (CamelFolder *folder);
-static CamelFolderOpenMode _get_mode (CamelFolder *folder);
-static GList *_list_subfolders (CamelFolder *folder);
-static void _expunge (CamelFolder *folder);
-static CamelMimeMessage *_get_message (CamelFolder *folder, gint number);
-static gint _get_message_count (CamelFolder *folder);
-static gint _append_message (CamelFolder *folder, CamelMimeMessage *message);
-static const GList *_list_permanent_flags (CamelFolder *folder);
-static void _copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder);
-
-static const gchar *_get_message_uid (CamelFolder *folder, CamelMimeMessage *message);
-static CamelMimeMessage *_get_message_by_uid (CamelFolder *folder, const gchar *uid);
-static GList *_get_uid_list (CamelFolder *folder);
+static const gchar *_get_name (CamelFolder *folder, CamelException *ex);
+static const gchar *_get_full_name (CamelFolder *folder, CamelException *ex);
+static gboolean _can_hold_folders (CamelFolder *folder, CamelException *ex);
+static gboolean _can_hold_messages(CamelFolder *folder, CamelException *ex);
+static gboolean _exists (CamelFolder *folder, CamelException *ex);
+static gboolean _is_open (CamelFolder *folder, CamelException *ex);
+static CamelFolder *_get_folder (CamelFolder *folder, const gchar *folder_name, CamelException *ex);
+static gboolean _create (CamelFolder *folder, CamelException *ex);
+static gboolean _delete (CamelFolder *folder, gboolean recurse, CamelException *ex);
+static gboolean _delete_messages (CamelFolder *folder, CamelException *ex);
+static CamelFolder *_get_parent_folder (CamelFolder *folder, CamelException *ex);
+static CamelStore *_get_parent_store (CamelFolder *folder, CamelException *ex);
+static CamelFolderOpenMode _get_mode (CamelFolder *folder, CamelException *ex);
+static GList *_list_subfolders (CamelFolder *folder, CamelException *ex);
+static void _expunge (CamelFolder *folder, CamelException *ex);
+static CamelMimeMessage *_get_message (CamelFolder *folder, gint number, CamelException *ex);
+static gint _get_message_count (CamelFolder *folder, CamelException *ex);
+static gint _append_message (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex);
+static const GList *_list_permanent_flags (CamelFolder *folder, CamelException *ex);
+static void _copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder, CamelException *ex);
+
+static const gchar *_get_message_uid (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex);
+static CamelMimeMessage *_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException *ex);
+static GList *_get_uid_list (CamelFolder *folder, CamelException *ex);
static void _finalize (GtkObject *object);
@@ -168,7 +168,7 @@ _finalize (GtkObject *object)
*
**/
static void
-_init_with_store (CamelFolder *folder, CamelStore *parent_store)
+_init_with_store (CamelFolder *folder, CamelStore *parent_store, CamelException *ex)
{
g_assert(folder);
g_assert(parent_store);
@@ -193,16 +193,16 @@ _init_with_store (CamelFolder *folder, CamelStore *parent_store)
*
**/
static void
-_open (CamelFolder *folder, CamelFolderOpenMode mode)
+_open (CamelFolder *folder, CamelFolderOpenMode mode, CamelException *ex)
{
folder->open_state = FOLDER_OPEN;
folder->open_mode = mode;
}
-void camel_folder_open (CamelFolder *folder, CamelFolderOpenMode mode)
+void camel_folder_open (CamelFolder *folder, CamelFolderOpenMode mode, CamelException *ex)
{
- CF_CLASS(folder)->open (folder, mode);
+ CF_CLASS(folder)->open (folder, mode, ex);
}
@@ -216,22 +216,22 @@ void camel_folder_open (CamelFolder *folder, CamelFolderOpenMode mode)
* expunge the flagged messages.
**/
static void
-_close (CamelFolder *folder, gboolean expunge)
+_close (CamelFolder *folder, gboolean expunge, CamelException *ex)
{
- if (expunge) camel_folder_expunge (folder, FALSE);
+ if (expunge) camel_folder_expunge (folder, FALSE, ex);
folder->open_state = FOLDER_CLOSE;
}
void
-camel_folder_close (CamelFolder *folder, gboolean expunge)
+camel_folder_close (CamelFolder *folder, gboolean expunge, CamelException *ex)
{
- CF_CLASS(folder)->close (folder, expunge);
+ CF_CLASS(folder)->close (folder, expunge, ex);
}
static void
-_set_name (CamelFolder *folder, const gchar *name)
+_set_name (CamelFolder *folder, const gchar *name, CamelException *ex)
{
gchar separator;
gchar *full_name;
@@ -247,7 +247,7 @@ _set_name (CamelFolder *folder, const gchar *name)
separator = camel_store_get_separator (folder->parent_store);
if (folder->parent_folder) {
- parent_full_name = camel_folder_get_full_name (folder->parent_folder);
+ parent_full_name = camel_folder_get_full_name (folder->parent_folder, ex);
full_name = g_strdup_printf ("%s%d%s", parent_full_name, separator, name);
} else {
@@ -270,15 +270,15 @@ _set_name (CamelFolder *folder, const gchar *name)
*
**/
void
-camel_folder_set_name (CamelFolder *folder, const gchar *name)
+camel_folder_set_name (CamelFolder *folder, const gchar *name, CamelException *ex)
{
- CF_CLASS(folder)->set_name (folder, name);
+ CF_CLASS(folder)->set_name (folder, name, ex);
}
#if 0
static void
-_set_full_name (CamelFolder *folder, const gchar *name)
+_set_full_name (CamelFolder *folder, const gchar *name, CamelException *ex)
{
g_free(folder->full_name);
folder->full_name = g_strdup (name);
@@ -294,14 +294,14 @@ _set_full_name (CamelFolder *folder, const gchar *name)
*
**/
void
-camel_folder_set_full_name (CamelFolder *folder, const gchar *name)
+camel_folder_set_full_name (CamelFolder *folder, const gchar *name, CamelException *ex)
{
- CF_CLASS(folder)->set_full_name (folder, name);
+ CF_CLASS(folder)->set_full_name (folder, name, ex);
}
#endif
static const gchar *
-_get_name (CamelFolder *folder)
+_get_name (CamelFolder *folder, CamelException *ex)
{
return folder->name;
}
@@ -317,15 +317,15 @@ _get_name (CamelFolder *folder)
* Return value: name of the folder
**/
const gchar *
-camel_folder_get_name (CamelFolder *folder)
+camel_folder_get_name (CamelFolder *folder, CamelException *ex)
{
- return CF_CLASS(folder)->get_name (folder);
+ return CF_CLASS(folder)->get_name (folder, ex);
}
static const gchar *
-_get_full_name (CamelFolder *folder)
+_get_full_name (CamelFolder *folder, CamelException *ex)
{
return folder->full_name;
}
@@ -339,9 +339,9 @@ _get_full_name (CamelFolder *folder)
* Return value: full name of the folder
**/
const gchar *
-camel_folder_get_full_name (CamelFolder *folder)
+camel_folder_get_full_name (CamelFolder *folder, CamelException *ex)
{
- return CF_CLASS(folder)->get_full_name (folder);
+ return CF_CLASS(folder)->get_full_name (folder, ex);
}
@@ -355,7 +355,7 @@ camel_folder_get_full_name (CamelFolder *folder)
* Return value:
**/
static gboolean
-_can_hold_folders (CamelFolder *folder)
+_can_hold_folders (CamelFolder *folder, CamelException *ex)
{
return folder->can_hold_folders;
}
@@ -374,7 +374,7 @@ _can_hold_folders (CamelFolder *folder)
* Return value: true if it can contain messages false otherwise
**/
static gboolean
-_can_hold_messages (CamelFolder *folder)
+_can_hold_messages (CamelFolder *folder, CamelException *ex)
{
return folder->can_hold_messages;
}
@@ -382,7 +382,7 @@ _can_hold_messages (CamelFolder *folder)
static gboolean
-_exists (CamelFolder *folder)
+_exists (CamelFolder *folder, CamelException *ex)
{
return FALSE;
}
@@ -399,9 +399,9 @@ _exists (CamelFolder *folder)
* Return value: true if the folder exists on the store false otherwise
**/
gboolean
-camel_folder_exists (CamelFolder *folder)
+camel_folder_exists (CamelFolder *folder, CamelException *ex)
{
- return (CF_CLASS(folder)->exists (folder));
+ return (CF_CLASS(folder)->exists (folder, ex));
}
@@ -416,7 +416,7 @@ camel_folder_exists (CamelFolder *folder)
* Return value: true if the folder exists, false otherwise
**/
static gboolean
-_is_open (CamelFolder *folder)
+_is_open (CamelFolder *folder, CamelException *ex)
{
return (folder->open_state == FOLDER_OPEN);
}
@@ -426,7 +426,7 @@ _is_open (CamelFolder *folder)
static CamelFolder *
-_get_folder (CamelFolder *folder, const gchar *folder_name)
+_get_folder (CamelFolder *folder, const gchar *folder_name, CamelException *ex)
{
CamelFolder *new_folder;
gchar *full_name;
@@ -438,7 +438,7 @@ _get_folder (CamelFolder *folder, const gchar *folder_name)
if (!folder->parent_store) return NULL;
- current_folder_full_name = camel_folder_get_full_name (folder);
+ current_folder_full_name = camel_folder_get_full_name (folder, ex);
if (!current_folder_full_name) return NULL;
separator = camel_store_get_separator (folder->parent_store);
@@ -463,9 +463,9 @@ _get_folder (CamelFolder *folder, const gchar *folder_name)
* Return value: Required folder. NULL if the subfolder object could not be obtained
**/
CamelFolder *
-camel_folder_get_folder (CamelFolder *folder, gchar *folder_name)
+camel_folder_get_folder (CamelFolder *folder, gchar *folder_name, CamelException *ex)
{
- return (CF_CLASS(folder)->get_folder(folder,folder_name));
+ return (CF_CLASS(folder)->get_folder(folder,folder_name, ex));
}
@@ -486,7 +486,7 @@ camel_folder_get_folder (CamelFolder *folder, gchar *folder_name)
* Return value: %TRUE if the folder exists, %FALSE otherwise
**/
static gboolean
-_create(CamelFolder *folder)
+_create(CamelFolder *folder, CamelException *ex)
{
gchar *prefix;
gchar dich_result;
@@ -497,12 +497,12 @@ _create(CamelFolder *folder)
g_assert (folder->parent_store);
g_assert (folder->name);
- if (CF_CLASS(folder)->exists (folder))
+ if (CF_CLASS(folder)->exists (folder, ex))
return TRUE;
sep = camel_store_get_separator (folder->parent_store);
if (folder->parent_folder)
- camel_folder_create (folder->parent_folder);
+ camel_folder_create (folder->parent_folder, ex);
else {
if (folder->full_name) {
dich_result = string_dichotomy (
@@ -513,7 +513,7 @@ _create(CamelFolder *folder)
return FALSE;
} else {
parent = camel_store_get_folder (folder->parent_store, prefix);
- camel_folder_create (parent);
+ camel_folder_create (parent, ex);
}
}
}
@@ -536,9 +536,9 @@ _create(CamelFolder *folder)
* Return value:
**/
gboolean
-camel_folder_create (CamelFolder *folder)
+camel_folder_create (CamelFolder *folder, CamelException *ex)
{
- return (CF_CLASS(folder)->create(folder));
+ return (CF_CLASS(folder)->create(folder, ex));
}
@@ -569,7 +569,7 @@ camel_folder_create (CamelFolder *folder)
* Return value: true if the folder has been deleted
**/
static gboolean
-_delete (CamelFolder *folder, gboolean recurse)
+_delete (CamelFolder *folder, gboolean recurse, CamelException *ex)
{
GList *subfolders=NULL;
GList *sf;
@@ -581,14 +581,14 @@ _delete (CamelFolder *folder, gboolean recurse)
if (folder->open_state != FOLDER_CLOSE) return FALSE;
/* delete all messages in the folder */
- CF_CLASS(folder)->delete_messages(folder);
+ CF_CLASS(folder)->delete_messages(folder, ex);
- subfolders = CF_CLASS(folder)->list_subfolders(folder);
+ subfolders = CF_CLASS(folder)->list_subfolders(folder, ex);
if (recurse) { /* delete subfolders */
if (subfolders) {
sf = subfolders;
do {
- /* CF_CLASS(sf->data)->delete(sf->data, TRUE); */
+ /* CF_CLASS(sf->data)->delete(sf->data, TRUE, ex); */
} while (sf = sf->next);
}
} else if (subfolders) return FALSE;
@@ -613,9 +613,9 @@ _delete (CamelFolder *folder, gboolean recurse)
*
* Return value: TRUE if deletion was successful
**/
-gboolean camel_folder_delete (CamelFolder *folder, gboolean recurse)
+gboolean camel_folder_delete (CamelFolder *folder, gboolean recurse, CamelException *ex)
{
- return CF_CLASS(folder)->delete(folder, recurse);
+ return CF_CLASS(folder)->delete(folder, recurse, ex);
}
@@ -631,7 +631,7 @@ gboolean camel_folder_delete (CamelFolder *folder, gboolean recurse)
* Return value:
**/
static gboolean
-_delete_messages (CamelFolder *folder)
+_delete_messages (CamelFolder *folder, CamelException *ex)
{
return TRUE;
}
@@ -646,9 +646,9 @@ _delete_messages (CamelFolder *folder)
* Return value: TRUE if the messages could be deleted
**/
gboolean
-camel_folder_delete_messages (CamelFolder *folder)
+camel_folder_delete_messages (CamelFolder *folder, CamelException *ex)
{
- return CF_CLASS(folder)->delete_messages(folder);
+ return CF_CLASS(folder)->delete_messages(folder, ex);
}
@@ -665,7 +665,7 @@ camel_folder_delete_messages (CamelFolder *folder)
* Return value:
**/
static CamelFolder *
-_get_parent_folder (CamelFolder *folder)
+_get_parent_folder (CamelFolder *folder, CamelException *ex)
{
return folder->parent_folder;
}
@@ -680,9 +680,9 @@ _get_parent_folder (CamelFolder *folder)
* Return value:
**/
CamelFolder *
-camel_folder_get_parent_folder (CamelFolder *folder)
+camel_folder_get_parent_folder (CamelFolder *folder, CamelException *ex)
{
- return CF_CLASS(folder)->get_parent_folder(folder);
+ return CF_CLASS(folder)->get_parent_folder(folder, ex);
}
@@ -695,7 +695,7 @@ camel_folder_get_parent_folder (CamelFolder *folder)
* Return value:
**/
static CamelStore *
-_get_parent_store (CamelFolder *folder)
+_get_parent_store (CamelFolder *folder, CamelException *ex)
{
return folder->parent_store;
}
@@ -710,9 +710,9 @@ _get_parent_store (CamelFolder *folder)
* Return value:
**/
CamelStore *
-camel_folder_get_parent_store (CamelFolder *folder)
+camel_folder_get_parent_store (CamelFolder *folder, CamelException *ex)
{
- return CF_CLASS(folder)->get_parent_store(folder);
+ return CF_CLASS(folder)->get_parent_store(folder, ex);
}
@@ -726,7 +726,7 @@ camel_folder_get_parent_store (CamelFolder *folder)
* Return value: open mode of the folder
**/
static CamelFolderOpenMode
-_get_mode (CamelFolder *folder)
+_get_mode (CamelFolder *folder, CamelException *ex)
{
return folder->open_mode;
}
@@ -741,16 +741,16 @@ _get_mode (CamelFolder *folder)
* Return value: open mode of the folder
**/
CamelFolderOpenMode
-camel_folder_get_mode (CamelFolder *folder)
+camel_folder_get_mode (CamelFolder *folder, CamelException *ex)
{
- return CF_CLASS(folder)->get_mode(folder);
+ return CF_CLASS(folder)->get_mode(folder, ex);
}
static GList *
-_list_subfolders (CamelFolder *folder)
+_list_subfolders (CamelFolder *folder, CamelException *ex)
{
return NULL;
}
@@ -765,16 +765,16 @@ _list_subfolders (CamelFolder *folder)
* Return value: list of subfolders
**/
GList *
-camel_folder_list_subfolders (CamelFolder *folder)
+camel_folder_list_subfolders (CamelFolder *folder, CamelException *ex)
{
- return CF_CLASS(folder)->list_subfolders(folder);
+ return CF_CLASS(folder)->list_subfolders(folder, ex);
}
static void
-_expunge (CamelFolder *folder)
+_expunge (CamelFolder *folder, CamelException *ex)
{
}
@@ -799,7 +799,7 @@ camel_mime_message_number_cmp (gconstpointer a, gconstpointer b)
* Return value: list of expunged message objects.
**/
GList *
-camel_folder_expunge (CamelFolder *folder, gboolean want_list)
+camel_folder_expunge (CamelFolder *folder, gboolean want_list, CamelException *ex)
{
GList *expunged_list = NULL;
CamelMimeMessage *message;
@@ -815,7 +815,7 @@ camel_folder_expunge (CamelFolder *folder, gboolean want_list)
/* call provider method,
* PROVIDERS MUST SET THE EXPUNGED FLAGS TO TRUE
* when they expunge a message of the active message list */
- CF_CLASS (folder)->expunge (folder);
+ CF_CLASS (folder)->expunge (folder, ex);
message_node = folder->message_list;
@@ -857,7 +857,7 @@ camel_folder_expunge (CamelFolder *folder, gboolean want_list)
static CamelMimeMessage *
-_get_message (CamelFolder *folder, gint number)
+_get_message (CamelFolder *folder, gint number, CamelException *ex)
{
return NULL;
}
@@ -875,7 +875,7 @@ _get_message (CamelFolder *folder, gint number)
* Return value: A pointer on the corresponding message or NULL if no corresponding message exists
**/
CamelMimeMessage *
-camel_folder_get_message (CamelFolder *folder, gint number)
+camel_folder_get_message (CamelFolder *folder, gint number, CamelException *ex)
{
#warning this code has nothing to do here.
CamelMimeMessage *a_message;
@@ -907,7 +907,7 @@ camel_folder_get_message (CamelFolder *folder, gint number)
CAMEL_LOG_FULL_DEBUG ("CamelFolder::get_message message node = %p\n", message_node);
}
- if (!new_message) new_message = CF_CLASS (folder)->get_message (folder, number);
+ if (!new_message) new_message = CF_CLASS (folder)->get_message (folder, number, ex);
if (!new_message) return NULL;
/* if the message has not been already put in
@@ -920,7 +920,7 @@ camel_folder_get_message (CamelFolder *folder, gint number)
static gint
-_get_message_count (CamelFolder *folder)
+_get_message_count (CamelFolder *folder, CamelException *ex)
{
return -1;
}
@@ -936,52 +936,52 @@ _get_message_count (CamelFolder *folder)
* Return value: the number of messages or -1 if unknown.
**/
gint
-camel_folder_get_message_count (CamelFolder *folder)
+camel_folder_get_message_count (CamelFolder *folder, CamelException *ex)
{
- return CF_CLASS (folder)->get_message_count (folder);
+ return CF_CLASS (folder)->get_message_count (folder, ex);
}
static gint
-_append_message (CamelFolder *folder, CamelMimeMessage *message)
+_append_message (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex)
{
return -1;
}
-gint camel_folder_append_message (CamelFolder *folder, CamelMimeMessage *message)
+gint camel_folder_append_message (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex)
{
- return CF_CLASS (folder)->append_message (folder, message);
+ return CF_CLASS (folder)->append_message (folder, message, ex);
}
static const GList *
-_list_permanent_flags (CamelFolder *folder)
+_list_permanent_flags (CamelFolder *folder, CamelException *ex)
{
return folder->permanent_flags;
}
const GList *
-camel_folder_list_permanent_flags (CamelFolder *folder)
+camel_folder_list_permanent_flags (CamelFolder *folder, CamelException *ex)
{
- return CF_CLASS (folder)->list_permanent_flags (folder);
+ return CF_CLASS (folder)->list_permanent_flags (folder, ex);
}
static void
-_copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder)
+_copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder, CamelException *ex)
{
- camel_folder_append_message (dest_folder, message);
+ camel_folder_append_message (dest_folder, message, ex);
}
void
-camel_folder_copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder)
+camel_folder_copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder, CamelException *ex)
{
- CF_CLASS (folder)->copy_message_to (folder, message, dest_folder);;
+ CF_CLASS (folder)->copy_message_to (folder, message, dest_folder, ex);;
}
@@ -991,14 +991,14 @@ camel_folder_copy_message_to (CamelFolder *folder, CamelMimeMessage *message, Ca
/* summary stuff */
gboolean
-camel_folder_has_summary_capability (CamelFolder *folder)
+camel_folder_has_summary_capability (CamelFolder *folder, CamelException *ex)
{
return folder->has_summary_capability;
}
CamelFolderSummary *
-camel_folder_get_summary (CamelFolder *folder)
+camel_folder_get_summary (CamelFolder *folder, CamelException *ex)
{
return folder->summary;
}
@@ -1019,7 +1019,7 @@ camel_folder_get_summary (CamelFolder *folder)
* Return value: TRUE if the folder supports UIDs
**/
gboolean
-camel_folder_has_uid_capability (CamelFolder *folder)
+camel_folder_has_uid_capability (CamelFolder *folder, CamelException *ex)
{
return folder->has_uid_capability;
}
@@ -1027,7 +1027,7 @@ camel_folder_has_uid_capability (CamelFolder *folder)
static const gchar *
-_get_message_uid (CamelFolder *folder, CamelMimeMessage *message)
+_get_message_uid (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex)
{
return NULL;
}
@@ -1045,17 +1045,17 @@ _get_message_uid (CamelFolder *folder, CamelMimeMessage *message)
* Return value: The UID of the message in the folder
**/
const gchar *
-camel_folder_get_message_uid (CamelFolder *folder, CamelMimeMessage *message)
+camel_folder_get_message_uid (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex)
{
if (!folder->has_uid_capability) return NULL;
- return CF_CLASS (folder)->get_message_uid (folder, message);
+ return CF_CLASS (folder)->get_message_uid (folder, message, ex);
}
/* the next two func are left there temporarily */
static const gchar *
-_get_message_uid_by_number (CamelFolder *folder, gint message_number)
+_get_message_uid_by_number (CamelFolder *folder, gint message_number, CamelException *ex)
{
return NULL;
}
@@ -1073,15 +1073,15 @@ _get_message_uid_by_number (CamelFolder *folder, gint message_number)
* Return value:
**/
const gchar *
-camel_folder_get_message_uid_by_number (CamelFolder *folder, gint message_number)
+camel_folder_get_message_uid_by_number (CamelFolder *folder, gint message_number, CamelException *ex)
{
//if (!folder->has_uid_capability) return NULL;
- //return CF_CLASS (folder)->get_message_uid_by_number (folder, message_number);
+ //return CF_CLASS (folder)->get_message_uid_by_number (folder, message_number, ex);
}
static CamelMimeMessage *
-_get_message_by_uid (CamelFolder *folder, const gchar *uid)
+_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
return NULL;
}
@@ -1099,14 +1099,14 @@ _get_message_by_uid (CamelFolder *folder, const gchar *uid)
* Return value: Message corresponding to the UID
**/
CamelMimeMessage *
-camel_folder_get_message_by_uid (CamelFolder *folder, const gchar *uid)
+camel_folder_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
if (!folder->has_uid_capability) return NULL;
- return CF_CLASS (folder)->get_message_by_uid (folder, uid);
+ return CF_CLASS (folder)->get_message_by_uid (folder, uid, ex);
}
static GList *
-_get_uid_list (CamelFolder *folder)
+_get_uid_list (CamelFolder *folder, CamelException *ex)
{
return NULL;
}
@@ -1124,10 +1124,10 @@ _get_uid_list (CamelFolder *folder)
* Return value: Glist of UID correspondind to the messages available in the folder.
**/
GList *
-camel_folder_get_uid_list (CamelFolder *folder)
+camel_folder_get_uid_list (CamelFolder *folder, CamelException *ex)
{
if (!folder->has_uid_capability) return NULL;
- return CF_CLASS (folder)->get_uid_list (folder);
+ return CF_CLASS (folder)->get_uid_list (folder, ex);
}
diff --git a/camel/camel-folder.h b/camel/camel-folder.h
index 0d30351d9d..05becd64b0 100644
--- a/camel/camel-folder.h
+++ b/camel/camel-folder.h
@@ -38,6 +38,7 @@ typedef struct _CamelFolder CamelFolder;
#include "camel-store.h"
#include "camel-mime-message.h"
#include "camel-folder-summary.h"
+#include "camel-exception.h"
#define CAMEL_FOLDER_TYPE (camel_folder_get_type ())
#define CAMEL_FOLDER(obj) (GTK_CHECK_CAST((obj), CAMEL_FOLDER_TYPE, CamelFolder))
@@ -87,35 +88,35 @@ typedef struct {
GtkObjectClass parent_class;
/* Virtual methods */
- void (*init_with_store) (CamelFolder *folder, CamelStore *parent_store);
- void (*open) (CamelFolder *object, CamelFolderOpenMode mode);
- void (*close) (CamelFolder *folder, gboolean expunge);
- void (*set_name) (CamelFolder *folder, const gchar *name);
+ void (*init_with_store) (CamelFolder *folder, CamelStore *parent_store, CamelException *ex);
+ void (*open) (CamelFolder *object, CamelFolderOpenMode mode, CamelException *ex);
+ void (*close) (CamelFolder *folder, gboolean expunge, CamelException *ex);
+ void (*set_name) (CamelFolder *folder, const gchar *name, CamelException *ex);
/* void (*set_full_name) (CamelFolder *folder, const gchar *name); */
- const gchar * (*get_name) (CamelFolder *folder);
- const gchar * (*get_full_name) (CamelFolder *folder);
- gboolean (*can_hold_folders) (CamelFolder *folder);
- gboolean (*can_hold_messages) (CamelFolder *folder);
- gboolean (*exists) (CamelFolder *folder);
- gboolean (*is_open) (CamelFolder *folder);
- CamelFolder * (*get_folder) (CamelFolder *folder, const gchar *folder_name);
- gboolean (*create) (CamelFolder *folder);
- gboolean (*delete) (CamelFolder *folder, gboolean recurse);
- gboolean (*delete_messages) (CamelFolder *folder);
- CamelFolder * (*get_parent_folder) (CamelFolder *folder);
- CamelStore * (*get_parent_store) (CamelFolder *folder);
- CamelFolderOpenMode (*get_mode) (CamelFolder *folder);
- GList * (*list_subfolders) (CamelFolder *folder);
- void (*expunge) (CamelFolder *folder);
- CamelMimeMessage * (*get_message) (CamelFolder *folder, gint number);
- gint (*get_message_count) (CamelFolder *folder);
- gint (*append_message) (CamelFolder *folder, CamelMimeMessage *message);
- const GList * (*list_permanent_flags) (CamelFolder *folder);
- void (*copy_message_to) (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder);
+ const gchar * (*get_name) (CamelFolder *folder, CamelException *ex);
+ const gchar * (*get_full_name) (CamelFolder *folder, CamelException *ex);
+ gboolean (*can_hold_folders) (CamelFolder *folder, CamelException *ex);
+ gboolean (*can_hold_messages) (CamelFolder *folder, CamelException *ex);
+ gboolean (*exists) (CamelFolder *folder, CamelException *ex);
+ gboolean (*is_open) (CamelFolder *folder, CamelException *ex);
+ CamelFolder * (*get_folder) (CamelFolder *folder, const gchar *folder_name, CamelException *ex);
+ gboolean (*create) (CamelFolder *folder, CamelException *ex);
+ gboolean (*delete) (CamelFolder *folder, gboolean recurse, CamelException *ex);
+ gboolean (*delete_messages) (CamelFolder *folder, CamelException *ex);
+ CamelFolder * (*get_parent_folder) (CamelFolder *folder, CamelException *ex);
+ CamelStore * (*get_parent_store) (CamelFolder *folder, CamelException *ex);
+ CamelFolderOpenMode (*get_mode) (CamelFolder *folder, CamelException *ex);
+ GList * (*list_subfolders) (CamelFolder *folder, CamelException *ex);
+ void (*expunge) (CamelFolder *folder, CamelException *ex);
+ CamelMimeMessage * (*get_message) (CamelFolder *folder, gint number, CamelException *ex);
+ gint (*get_message_count) (CamelFolder *folder, CamelException *ex);
+ gint (*append_message) (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex);
+ const GList * (*list_permanent_flags) (CamelFolder *folder, CamelException *ex);
+ void (*copy_message_to) (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder, CamelException *ex);
- const gchar * (*get_message_uid) (CamelFolder *folder, CamelMimeMessage *message);
- CamelMimeMessage * (*get_message_by_uid) (CamelFolder *folder, const gchar *uid);
- GList * (*get_uid_list) (CamelFolder *folder);
+ const gchar * (*get_message_uid) (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex);
+ CamelMimeMessage * (*get_message_by_uid) (CamelFolder *folder, const gchar *uid, CamelException *ex);
+ GList * (*get_uid_list) (CamelFolder *folder, CamelException *ex);
} CamelFolderClass;
@@ -126,36 +127,36 @@ GtkType camel_folder_get_type (void);
/* public methods */
-CamelFolder *camel_folder_get_folder (CamelFolder *folder, gchar *folder_name);
-void camel_folder_open (CamelFolder *folder, CamelFolderOpenMode mode);
-void camel_folder_close (CamelFolder *folder, gboolean expunge);
-gboolean camel_folder_create (CamelFolder *folder);
-gboolean camel_folder_delete (CamelFolder *folder, gboolean recurse);
-gboolean camel_folder_delete_messages (CamelFolder *folder);
-CamelFolder *camel_folder_get_parent_folder (CamelFolder *folder);
-CamelStore *camel_folder_get_parent_store (CamelFolder *folder);
-CamelFolderOpenMode camel_folder_get_mode (CamelFolder *folder);
-GList *camel_folder_list_subfolders (CamelFolder *folder);
-GList *camel_folder_expunge (CamelFolder *folder, gboolean want_list);
-void camel_folder_set_name (CamelFolder *folder, const gchar *name);
-const gchar *camel_folder_get_name (CamelFolder *folder);
+CamelFolder *camel_folder_get_folder (CamelFolder *folder, gchar *folder_name, CamelException *ex);
+void camel_folder_open (CamelFolder *folder, CamelFolderOpenMode mod, CamelException *exe);
+void camel_folder_close (CamelFolder *folder, gboolean expunge, CamelException *ex);
+gboolean camel_folder_create (CamelFolder *folder, CamelException *ex);
+gboolean camel_folder_delete (CamelFolder *folder, gboolean recurse, CamelException *ex);
+gboolean camel_folder_delete_messages (CamelFolder *folder, CamelException *ex);
+CamelFolder *camel_folder_get_parent_folder (CamelFolder *folder, CamelException *ex);
+CamelStore *camel_folder_get_parent_store (CamelFolder *folder, CamelException *ex);
+CamelFolderOpenMode camel_folder_get_mode (CamelFolder *folder, CamelException *ex);
+GList *camel_folder_list_subfolders (CamelFolder *folder, CamelException *ex);
+GList *camel_folder_expunge (CamelFolder *folder, gboolean want_list, CamelException *ex);
+void camel_folder_set_name (CamelFolder *folder, const gchar *name, CamelException *ex);
+const gchar *camel_folder_get_name (CamelFolder *folder, CamelException *ex);
/* void camel_folder_set_full_name (CamelFolder *folder, const gchar *name); */
-const gchar *camel_folder_get_full_name (CamelFolder *folder);
-CamelMimeMessage *camel_folder_get_message (CamelFolder *folder, gint number);
-gboolean camel_folder_exists (CamelFolder *folder);
-gint camel_folder_get_message_count (CamelFolder *folder);
-gint camel_folder_append_message (CamelFolder *folder, CamelMimeMessage *message);
-const GList *camel_folder_list_permanent_flags (CamelFolder *folder);
-void camel_folder_copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder);
-
-gboolean camel_folder_has_summary_capability (CamelFolder *folder);
-CamelFolderSummary *camel_folder_get_summary (CamelFolder *folder);
-
-
-gboolean camel_folder_has_uid_capability (CamelFolder *folder);
-const gchar * camel_folder_get_message_uid (CamelFolder *folder, CamelMimeMessage *message);
-CamelMimeMessage *camel_folder_get_message_by_uid (CamelFolder *folder, const gchar *uid);
-GList *camel_folder_get_uid_list (CamelFolder *folder);
+const gchar *camel_folder_get_full_name (CamelFolder *folder, CamelException *ex);
+CamelMimeMessage *camel_folder_get_message (CamelFolder *folder, gint number, CamelException *ex);
+gboolean camel_folder_exists (CamelFolder *folder, CamelException *ex);
+gint camel_folder_get_message_count (CamelFolder *folder, CamelException *ex);
+gint camel_folder_append_message (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex);
+const GList *camel_folder_list_permanent_flags (CamelFolder *folder, CamelException *ex);
+void camel_folder_copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder, CamelException *ex);
+
+gboolean camel_folder_has_summary_capability (CamelFolder *folder, CamelException *ex);
+CamelFolderSummary *camel_folder_get_summary (CamelFolder *folder, CamelException *ex);
+
+
+gboolean camel_folder_has_uid_capability (CamelFolder *folder, CamelException *ex);
+const gchar * camel_folder_get_message_uid (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex);
+CamelMimeMessage *camel_folder_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException *ex);
+GList *camel_folder_get_uid_list (CamelFolder *folder, CamelException *ex);
#ifdef __cplusplus
}
diff --git a/camel/providers/MH/camel-mh-folder.c b/camel/providers/MH/camel-mh-folder.c
index ee658b52dd..86bbab46ba 100644
--- a/camel/providers/MH/camel-mh-folder.c
+++ b/camel/providers/MH/camel-mh-folder.c
@@ -51,27 +51,27 @@ static CamelFolderClass *parent_class=NULL;
#define CMHS_CLASS(so) CAMEL_STORE_CLASS (GTK_OBJECT(so)->klass)
-static void _set_name(CamelFolder *folder, const gchar *name);
-static void _init_with_store (CamelFolder *folder, CamelStore *parent_store);
-static gboolean _exists (CamelFolder *folder);
-static gboolean _create(CamelFolder *folder);
-static gboolean _delete (CamelFolder *folder, gboolean recurse);
-static gboolean _delete_messages (CamelFolder *folder);
-static GList *_list_subfolders (CamelFolder *folder);
-static CamelMimeMessage *_get_message (CamelFolder *folder, gint number);
-static gint _get_message_count (CamelFolder *folder);
-static gint _append_message (CamelFolder *folder, CamelMimeMessage *message);
-static void _expunge (CamelFolder *folder);
-static void _copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder);
-static void _open (CamelFolder *folder, CamelFolderOpenMode mode);
-static void _close (CamelFolder *folder, gboolean expunge);
-
-static const gchar *_get_message_uid (CamelFolder *folder, CamelMimeMessage *message);
-static CamelMimeMessage *_get_message_by_uid (CamelFolder *folder, const gchar *uid);
-static GList *_get_uid_list (CamelFolder *folder);
+static void _set_name(CamelFolder *folder, const gchar *name, CamelException *ex);
+static void _init_with_store (CamelFolder *folder, CamelStore *parent_store, CamelException *ex);
+static gboolean _exists (CamelFolder *folder, CamelException *ex);
+static gboolean _create(CamelFolder *folder, CamelException *ex);
+static gboolean _delete (CamelFolder *folder, gboolean recurse, CamelException *ex);
+static gboolean _delete_messages (CamelFolder *folder, CamelException *ex);
+static GList *_list_subfolders (CamelFolder *folder, CamelException *ex);
+static CamelMimeMessage *_get_message (CamelFolder *folder, gint number, CamelException *ex);
+static gint _get_message_count (CamelFolder *folder, CamelException *ex);
+static gint _append_message (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex);
+static void _expunge (CamelFolder *folder, CamelException *ex);
+static void _copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder, CamelException *ex);
+static void _open (CamelFolder *folder, CamelFolderOpenMode mode, CamelException *ex);
+static void _close (CamelFolder *folder, gboolean expunge, CamelException *ex);
+
+static const gchar *_get_message_uid (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex);
+static CamelMimeMessage *_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException *ex);
+static GList *_get_uid_list (CamelFolder *folder, CamelException *ex);
/* some utility functions */
-static int copy_reg (const char *src_path, const char *dst_path);
+static int copy_reg (const char *src_path, const char *dst_path, CamelException *ex);
static void
camel_mh_folder_class_init (CamelMhFolderClass *camel_mh_folder_class)
@@ -145,10 +145,10 @@ _message_name_compare (gconstpointer a, gconstpointer b)
static void
-_init_with_store (CamelFolder *folder, CamelStore *parent_store)
+_init_with_store (CamelFolder *folder, CamelStore *parent_store, CamelException *ex)
{
/* call parent method */
- parent_class->init_with_store (folder, parent_store);
+ parent_class->init_with_store (folder, parent_store, ex);
folder->can_hold_messages = TRUE;
folder->can_hold_folders = TRUE;
@@ -162,7 +162,7 @@ _init_with_store (CamelFolder *folder, CamelStore *parent_store)
static void
-_open (CamelFolder *folder, CamelFolderOpenMode mode)
+_open (CamelFolder *folder, CamelFolderOpenMode mode, CamelException *ex)
{
CamelMhFolder *mh_folder = CAMEL_MH_FOLDER (folder);
struct dirent *dir_entry;
@@ -205,7 +205,7 @@ _open (CamelFolder *folder, CamelFolderOpenMode mode)
static void
-_close (CamelFolder *folder, gboolean expunge)
+_close (CamelFolder *folder, gboolean expunge, CamelException *ex)
{
CamelMhFolder *mh_folder = CAMEL_MH_FOLDER (folder);
@@ -218,7 +218,7 @@ _close (CamelFolder *folder, gboolean expunge)
mh_save_summary (mh_folder);
/* call parent implementation */
- parent_class->close (folder, expunge);
+ parent_class->close (folder, expunge, ex);
}
@@ -234,7 +234,7 @@ _close (CamelFolder *folder, gboolean expunge)
*
**/
static void
-_set_name (CamelFolder *folder, const gchar *name)
+_set_name (CamelFolder *folder, const gchar *name, CamelException *ex)
{
CamelMhFolder *mh_folder = CAMEL_MH_FOLDER (folder);
const gchar *root_dir_path;
@@ -248,7 +248,7 @@ _set_name (CamelFolder *folder, const gchar *name)
g_assert (folder->parent_store);
/* call default implementation */
- parent_class->set_name (folder, name);
+ parent_class->set_name (folder, name, ex);
if (mh_folder->directory_path) g_free (mh_folder->directory_path);
@@ -261,7 +261,7 @@ _set_name (CamelFolder *folder, const gchar *name)
mh_folder->directory_path = g_strdup_printf ("%s%c%s", root_dir_path, separator, folder->full_name);
- if (!camel_folder_exists (folder)) return;
+ if (!camel_folder_exists (folder, ex)) return;
CAMEL_LOG_FULL_DEBUG ("CamelMhFolder::set_name mh_folder->directory_path is %s\n",
@@ -272,7 +272,7 @@ _set_name (CamelFolder *folder, const gchar *name)
static gboolean
-_exists (CamelFolder *folder)
+_exists (CamelFolder *folder, CamelException *ex)
{
CamelMhFolder *mh_folder = CAMEL_MH_FOLDER(folder);
struct stat stat_buf;
@@ -299,7 +299,7 @@ _exists (CamelFolder *folder)
static gboolean
-_create (CamelFolder *folder)
+_create (CamelFolder *folder, CamelException *ex)
{
CamelMhFolder *mh_folder = CAMEL_MH_FOLDER(folder);
const gchar *directory_path;
@@ -309,12 +309,12 @@ _create (CamelFolder *folder)
g_assert(folder);
/* call default implementation */
- parent_class->create (folder);
+ parent_class->create (folder, ex);
directory_path = mh_folder->directory_path;
if (!directory_path) return FALSE;
- if (camel_folder_exists (folder)) return TRUE;
+ if (camel_folder_exists (folder, ex)) return TRUE;
mkdir_error = mkdir (directory_path, dir_mode);
return (mkdir_error == -1);
@@ -323,7 +323,7 @@ _create (CamelFolder *folder)
static gboolean
-_delete (CamelFolder *folder, gboolean recurse)
+_delete (CamelFolder *folder, gboolean recurse, CamelException *ex)
{
CamelMhFolder *mh_folder = CAMEL_MH_FOLDER(folder);
@@ -333,7 +333,7 @@ _delete (CamelFolder *folder, gboolean recurse)
g_assert(folder);
/* call default implementation */
- parent_class->delete (folder, recurse);
+ parent_class->delete (folder, recurse, ex);
/* the default implementation will care about deleting
messages first and recursing the operation if
necessary */
@@ -341,7 +341,7 @@ _delete (CamelFolder *folder, gboolean recurse)
directory_path = mh_folder->directory_path;
if (!directory_path) return FALSE;
- if (!camel_folder_exists (folder)) return TRUE;
+ if (!camel_folder_exists (folder, ex)) return TRUE;
/* physically delete the directory */
CAMEL_LOG_FULL_DEBUG ("CamelMhFolder::delete removing directory %s\n", directory_path);
@@ -356,7 +356,7 @@ _delete (CamelFolder *folder, gboolean recurse)
static gboolean
-_delete_messages (CamelFolder *folder)
+_delete_messages (CamelFolder *folder, CamelException *ex)
{
CamelMhFolder *mh_folder = CAMEL_MH_FOLDER(folder);
@@ -371,12 +371,12 @@ _delete_messages (CamelFolder *folder)
g_assert(folder);
/* call default implementation */
- parent_class->delete_messages (folder);
+ parent_class->delete_messages (folder, ex);
directory_path = mh_folder->directory_path;
if (!directory_path) return FALSE;
- if (!camel_folder_exists (folder)) return TRUE;
+ if (!camel_folder_exists (folder, ex)) return TRUE;
dir_handle = opendir (directory_path);
@@ -413,7 +413,7 @@ _delete_messages (CamelFolder *folder)
static GList *
-_list_subfolders (CamelFolder *folder)
+_list_subfolders (CamelFolder *folder, CamelException *ex)
{
GList *subfolder_name_list = NULL;
@@ -430,12 +430,12 @@ _list_subfolders (CamelFolder *folder)
g_assert(folder);
/* call default implementation */
- parent_class->delete_messages (folder);
+ parent_class->delete_messages (folder, ex);
directory_path = mh_folder->directory_path;
if (!directory_path) return NULL;
- if (!camel_folder_exists (folder)) return NULL;
+ if (!camel_folder_exists (folder, ex)) return NULL;
dir_handle = opendir (directory_path);
@@ -480,7 +480,7 @@ _filename_free (gpointer data)
/* slow routine, may be optimixed, or we should use
caches if users complain */
static CamelMimeMessage *
-_get_message (CamelFolder *folder, gint number)
+_get_message (CamelFolder *folder, gint number, CamelException *ex)
{
CamelMhFolder *mh_folder = CAMEL_MH_FOLDER(folder);
const gchar *directory_path;
@@ -528,7 +528,7 @@ _get_message (CamelFolder *folder, gint number)
static gint
-_get_message_count (CamelFolder *folder)
+_get_message_count (CamelFolder *folder, CamelException *ex)
{
CamelMhFolder *mh_folder = CAMEL_MH_FOLDER(folder);
@@ -542,7 +542,7 @@ _get_message_count (CamelFolder *folder)
directory_path = mh_folder->directory_path;
if (!directory_path) return -1;
- if (!camel_folder_exists (folder)) return 0;
+ if (!camel_folder_exists (folder, ex)) return 0;
dir_handle = opendir (directory_path);
@@ -564,7 +564,7 @@ _get_message_count (CamelFolder *folder)
static gboolean
-_find_next_free_message_file (CamelFolder *folder, gint *new_msg_number, gchar **new_msg_filename)
+_find_next_free_message_file (CamelFolder *folder, gint *new_msg_number, gchar **new_msg_filename, CamelException *ex)
{
CamelMhFolder *mh_folder = CAMEL_MH_FOLDER(folder);
const gchar *directory_path;
@@ -578,7 +578,7 @@ _find_next_free_message_file (CamelFolder *folder, gint *new_msg_number, gchar *
directory_path = mh_folder->directory_path;
if (!directory_path) return FALSE;
- if (!camel_folder_exists (folder)) return FALSE;
+ if (!camel_folder_exists (folder, ex)) return FALSE;
dir_handle = opendir (directory_path);
@@ -606,7 +606,7 @@ _find_next_free_message_file (CamelFolder *folder, gint *new_msg_number, gchar *
}
static gint
-_append_message (CamelFolder *folder, CamelMimeMessage *message)
+_append_message (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex)
{
guint new_msg_number;
gchar *new_msg_filename;
@@ -614,7 +614,7 @@ _append_message (CamelFolder *folder, CamelMimeMessage *message)
gboolean error;
CAMEL_LOG_FULL_DEBUG ("Entering CamelMhFolder::append_message\n");
- if (!_find_next_free_message_file (folder, &new_msg_number, &new_msg_filename))
+ if (!_find_next_free_message_file (folder, &new_msg_number, &new_msg_filename, ex))
return -1;
output_stream = camel_stream_fs_new_with_name (new_msg_filename, CAMEL_STREAM_FS_WRITE);
@@ -639,7 +639,7 @@ _append_message (CamelFolder *folder, CamelMimeMessage *message)
static void
-_expunge (CamelFolder *folder)
+_expunge (CamelFolder *folder, CamelException *ex)
{
/* For the moment, we look in the folder active message
* list. I did not make my mind for the moment, should
@@ -691,7 +691,7 @@ _expunge (CamelFolder *folder)
static void
-_copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder)
+_copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder, CamelException *ex)
{
gchar *src_msg_filename;
guint dest_msg_number;
@@ -700,14 +700,14 @@ _copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *d
if (IS_CAMEL_MH_FOLDER (dest_folder)) {
/*g_return_if_fail (message->parent_folder == folder);*/
- if (!_find_next_free_message_file (dest_folder, &dest_msg_number, &dest_msg_filename))
+ if (!_find_next_free_message_file (dest_folder, &dest_msg_number, &dest_msg_filename, ex))
return;
src_msg_filename = gtk_object_get_data (GTK_OBJECT (message), "fullpath");
CAMEL_LOG_FULL_DEBUG ("CamelMhFolder::copy_to copy file %s to %s\n", src_msg_filename, dest_msg_filename);
- copy_reg (src_msg_filename, dest_msg_filename);
+ copy_reg (src_msg_filename, dest_msg_filename, ex);
} else
- parent_class->copy_message_to (folder, message, dest_folder);
+ parent_class->copy_message_to (folder, message, dest_folder, ex);
}
@@ -715,7 +715,7 @@ _copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *d
/** UID **/
static const gchar *
-_get_message_uid (CamelFolder *folder, CamelMimeMessage *message)
+_get_message_uid (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex)
{
CamelMhFolder *mh_folder = CAMEL_MH_FOLDER (folder);
GArray *uid_array;
@@ -751,7 +751,7 @@ _get_message_uid (CamelFolder *folder, CamelMimeMessage *message)
static CamelMimeMessage *
-_get_message_by_uid (CamelFolder *folder, const gchar *uid)
+_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelMhFolder *mh_folder = CAMEL_MH_FOLDER (folder);
GArray *uid_array;
@@ -801,7 +801,7 @@ _get_message_by_uid (CamelFolder *folder, const gchar *uid)
}
static GList *
-_get_uid_list (CamelFolder *folder)
+_get_uid_list (CamelFolder *folder, CamelException *ex)
{
CamelMhFolder *mh_folder = CAMEL_MH_FOLDER (folder);
GList *uid_list;
@@ -862,7 +862,7 @@ full_write (int desc, const char *ptr, size_t len)
static int
-copy_reg (const char *src_path, const char *dst_path)
+copy_reg (const char *src_path, const char *dst_path, CamelException *ex)
{
char *buf;
int buf_size;
diff --git a/camel/providers/MH/camel-mh-store.c b/camel/providers/MH/camel-mh-store.c
index 24a8c8a72c..60ba07f47b 100644
--- a/camel/providers/MH/camel-mh-store.c
+++ b/camel/providers/MH/camel-mh-store.c
@@ -145,8 +145,8 @@ _get_folder (CamelStore *store, const gchar *folder_name)
new_mh_folder = gtk_type_new (CAMEL_MH_FOLDER_TYPE);
new_folder = CAMEL_FOLDER (new_mh_folder);
- CF_CLASS (new_folder)->init_with_store (new_folder, store);
- CF_CLASS (new_folder)->set_name (new_folder, folder_name);
+ CF_CLASS (new_folder)->init_with_store (new_folder, store, NULL);
+ CF_CLASS (new_folder)->set_name (new_folder, folder_name, NULL);
return new_folder;
diff --git a/camel/providers/MH/mh-uid.c b/camel/providers/MH/mh-uid.c
index 425cc27697..7dbde4de00 100644
--- a/camel/providers/MH/mh-uid.c
+++ b/camel/providers/MH/mh-uid.c
@@ -182,7 +182,7 @@ mh_generate_uid_list (CamelMhFolder *mh_folder)
return -1;
}
- msg_count = camel_folder_get_message_count (CAMEL_FOLDER (mh_folder));
+ msg_count = camel_folder_get_message_count (CAMEL_FOLDER (mh_folder), NULL);
if (!msg_count) {
CAMEL_LOG_FULL_DEBUG ("no message in %s. Exiting\n", directory_path);
return -1;
diff --git a/camel/providers/maildir/camel-maildir-folder.c b/camel/providers/maildir/camel-maildir-folder.c
index ea0302cbd1..4ad5409658 100644
--- a/camel/providers/maildir/camel-maildir-folder.c
+++ b/camel/providers/maildir/camel-maildir-folder.c
@@ -50,16 +50,16 @@ static CamelFolderClass *parent_class=NULL;
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (GTK_OBJECT(so)->klass)
#define CMAILDIRS_CLASS(so) CAMEL_STORE_CLASS (GTK_OBJECT(so)->klass)
-static void _init_with_store (CamelFolder *folder, CamelStore *parent_store);
-static void _set_name (CamelFolder *folder, const gchar *name);
-static gboolean _exists (CamelFolder *folder);
-static gboolean _create (CamelFolder *folder);
-static gboolean _delete (CamelFolder *folder, gboolean recurse);
-static gboolean _delete_messages (CamelFolder *folder);
-static CamelMimeMessage *_get_message (CamelFolder *folder, gint number);
-static gint _get_message_count (CamelFolder *folder);
-static void _expunge (CamelFolder *folder);
-static GList *_list_subfolders (CamelFolder *folder);
+static void _init_with_store (CamelFolder *folder, CamelStore *parent_store, CamelException *ex);
+static void _set_name (CamelFolder *folder, const gchar *name, CamelException *ex);
+static gboolean _exists (CamelFolder *folder, CamelException *ex);
+static gboolean _create (CamelFolder *folder, CamelException *ex);
+static gboolean _delete (CamelFolder *folder, gboolean recurse, CamelException *ex);
+static gboolean _delete_messages (CamelFolder *folder, CamelException *ex);
+static CamelMimeMessage *_get_message (CamelFolder *folder, gint number, CamelException *ex);
+static gint _get_message_count (CamelFolder *folder, CamelException *ex);
+static void _expunge (CamelFolder *folder, CamelException *ex);
+static GList *_list_subfolders (CamelFolder *folder, CamelException *ex);
/* fs utility functions */
static DIR * _xopendir (const gchar *path);
@@ -131,14 +131,14 @@ camel_maildir_folder_get_type (void)
* Perhaps we'll later implement subfolders too...
*/
static void
-_init_with_store (CamelFolder *folder, CamelStore *parent_store)
+_init_with_store (CamelFolder *folder, CamelStore *parent_store, CamelException *ex)
{
CAMEL_LOG_FULL_DEBUG ("Entering CamelMaildirFolder::init_with_store\n");
g_assert (folder);
g_assert (parent_store);
/* call parent method */
- parent_class->init_with_store (folder, parent_store);
+ parent_class->init_with_store (folder, parent_store, ex);
folder->can_hold_messages = TRUE;
folder->can_hold_folders = TRUE;
@@ -156,7 +156,7 @@ _init_with_store (CamelFolder *folder, CamelStore *parent_store)
* the given name is not checked in this function.
*/
static void
-_set_name (CamelFolder *folder, const gchar *name)
+_set_name (CamelFolder *folder, const gchar *name, CamelException *ex)
{
CamelMaildirFolder *maildir_folder;
CamelMaildirStore *maildir_store;
@@ -170,7 +170,7 @@ _set_name (CamelFolder *folder, const gchar *name)
maildir_store = CAMEL_MAILDIR_STORE (folder->parent_store);
/* call default implementation */
- parent_class->set_name (folder, name);
+ parent_class->set_name (folder, name, ex);
if (maildir_folder->directory_path)
g_free (maildir_folder->directory_path);
@@ -205,7 +205,7 @@ _set_name (CamelFolder *folder, const gchar *name)
* Return value: TRUE if the maildir exists, FALSE otherwise
*/
static gboolean
-_exists (CamelFolder *folder)
+_exists (CamelFolder *folder, CamelException *ex)
{
CamelMaildirFolder *maildir_folder = CAMEL_MAILDIR_FOLDER (folder);
static const gchar *dir[3] = { "new", "cur", "tmp" };
@@ -258,7 +258,7 @@ _exists (CamelFolder *folder)
* FALSE otherwise
*/
static gboolean
-_create (CamelFolder *folder)
+_create (CamelFolder *folder, CamelException *ex)
{
CamelMaildirFolder *maildir_folder = CAMEL_MAILDIR_FOLDER (folder);
static const gchar *dir[3] = { "new", "cur", "tmp" };
@@ -271,7 +271,7 @@ _create (CamelFolder *folder)
g_assert (folder);
/* check whether the maildir already exists */
- if (camel_folder_exists (folder)) return TRUE;
+ if (camel_folder_exists (folder, ex)) return TRUE;
maildir = maildir_folder->directory_path;
@@ -309,7 +309,7 @@ _create (CamelFolder *folder)
* maildir directory won't be removed, but it might no longer be a valid maildir.
*/
static gboolean
-_delete (CamelFolder *folder, gboolean recurse)
+_delete (CamelFolder *folder, gboolean recurse, CamelException *ex)
{
CamelMaildirFolder *maildir_folder = CAMEL_MAILDIR_FOLDER (folder);
static const gchar *dir[3] = { "new", "cur", "tmp" };
@@ -322,7 +322,7 @@ _delete (CamelFolder *folder, gboolean recurse)
g_assert (folder);
/* check whether the maildir already exists */
- if (!camel_folder_exists (folder)) return TRUE;
+ if (!camel_folder_exists (folder, ex)) return TRUE;
maildir = maildir_folder->directory_path;
@@ -367,7 +367,7 @@ _delete (CamelFolder *folder, gboolean recurse)
* TRUE otherwise.
*/
static gboolean
-_delete_messages (CamelFolder *folder)
+_delete_messages (CamelFolder *folder, CamelException *ex)
{
CamelMaildirFolder *maildir_folder = CAMEL_MAILDIR_FOLDER (folder);
const gchar *maildir;
@@ -380,10 +380,10 @@ _delete_messages (CamelFolder *folder)
g_assert (folder);
/* call default implementation */
- parent_class->delete_messages (folder);
+ parent_class->delete_messages (folder, ex);
/* Check if the folder didn't exist */
- if (!camel_folder_exists (folder)) return TRUE;
+ if (!camel_folder_exists (folder, ex)) return TRUE;
maildir = maildir_folder->directory_path;
@@ -424,7 +424,7 @@ _delete_messages (CamelFolder *folder)
* Return value: the message, NULL on error
*/
static CamelMimeMessage *
-_get_message (CamelFolder *folder, gint number)
+_get_message (CamelFolder *folder, gint number, CamelException *ex)
{
CamelMaildirFolder *maildir_folder = CAMEL_MAILDIR_FOLDER(folder);
DIR *dir_handle;
@@ -439,7 +439,7 @@ _get_message (CamelFolder *folder, gint number)
g_assert(folder);
/* Check if the folder exists */
- if (!camel_folder_exists (folder)) return NULL;
+ if (!camel_folder_exists (folder, ex)) return NULL;
maildir = maildir_folder->directory_path;
@@ -495,7 +495,7 @@ _get_message (CamelFolder *folder, gint number)
* Return value: number of messages in the maildir, -1 on error
*/
static gint
-_get_message_count (CamelFolder *folder)
+_get_message_count (CamelFolder *folder, CamelException *ex)
{
CamelMaildirFolder *maildir_folder = CAMEL_MAILDIR_FOLDER(folder);
const gchar *maildir;
@@ -509,7 +509,7 @@ _get_message_count (CamelFolder *folder)
g_assert(folder);
/* check if the maildir exists */
- if (!camel_folder_exists (folder)) return -1;
+ if (!camel_folder_exists (folder, ex)) return -1;
maildir = maildir_folder->directory_path;
@@ -564,7 +564,7 @@ _get_message_count (CamelFolder *folder)
* Physically deletes the messages marked as deleted in the folder.
*/
static void
-_expunge (CamelFolder *folder)
+_expunge (CamelFolder *folder, CamelException *ex)
{
CamelMimeMessage *message;
GList *node;
@@ -618,7 +618,7 @@ _expunge (CamelFolder *folder)
* Return value: list of subfolder names
*/
static GList *
-_list_subfolders (CamelFolder *folder)
+_list_subfolders (CamelFolder *folder, CamelException *ex)
{
CamelMaildirFolder *maildir_folder = CAMEL_MAILDIR_FOLDER (folder);
const gchar *maildir;
@@ -632,7 +632,7 @@ _list_subfolders (CamelFolder *folder)
g_assert (folder);
/* check if the maildir exists */
- if (!camel_folder_exists (folder)) return NULL;
+ if (!camel_folder_exists (folder, ex)) return NULL;
/* scan through the maildir toplevel directory */
maildir = maildir_folder->directory_path;
diff --git a/camel/providers/maildir/camel-maildir-store.c b/camel/providers/maildir/camel-maildir-store.c
index 0e296699a9..8f37494003 100644
--- a/camel/providers/maildir/camel-maildir-store.c
+++ b/camel/providers/maildir/camel-maildir-store.c
@@ -117,8 +117,8 @@ _get_folder (CamelStore *store, const gchar *folder_name)
new_maildir_folder = gtk_type_new (CAMEL_MAILDIR_FOLDER_TYPE);
new_folder = CAMEL_FOLDER (new_maildir_folder);
- CF_CLASS (new_folder)->init_with_store (new_folder, store);
- CF_CLASS (new_folder)->set_name (new_folder, folder_name);
+ CF_CLASS (new_folder)->init_with_store (new_folder, store, NULL);
+ CF_CLASS (new_folder)->set_name (new_folder, folder_name, NULL);
return new_folder;
}
diff --git a/tests/test4.c b/tests/test4.c
index 9c02fc3496..99285cec43 100644
--- a/tests/test4.c
+++ b/tests/test4.c
@@ -32,7 +32,7 @@ main (int argc, char**argv)
camel_store_init (store, (CamelSession *)NULL, g_strdup ("mh:///root/Mail"));
root_mh_folder = camel_store_get_folder (store, "");
- mh_subfolders_name = camel_folder_list_subfolders (root_mh_folder);
+ mh_subfolders_name = camel_folder_list_subfolders (root_mh_folder, NULL);
printf ("\n------------- Listing root Mh folder subfolders --------\n");
while (mh_subfolders_name) {
@@ -48,7 +48,7 @@ main (int argc, char**argv)
}
/* test existence */
- inbox_exists = camel_folder_exists (inbox_folder);
+ inbox_exists = camel_folder_exists (inbox_folder, NULL);
if (inbox_exists)
printf ("MH folder inbox exists, continuing tests\n");
else {
@@ -56,9 +56,9 @@ main (int argc, char**argv)
return 1;
}
- printf ("\n Inbox folder contains %d messages\n", camel_folder_get_message_count (inbox_folder));
+ printf ("\n Inbox folder contains %d messages\n", camel_folder_get_message_count (inbox_folder, NULL));
printf ("\n------------- Gettting message numer 3 in inbox --------\n");
- message_1 = camel_folder_get_message (inbox_folder, 3);
+ message_1 = camel_folder_get_message (inbox_folder, 3, NULL);
printf ("--------------------------------------------------------\n\n");