aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/nntp
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-07-25 10:42:11 +0800
committerDan Winship <danw@src.gnome.org>2000-07-25 10:42:11 +0800
commit72183d80ecaa52aef8b45e9857d2464ad3e624ca (patch)
tree076ae2a90662000ed4f643609486ed0441dd2fed /camel/providers/nntp
parent58eab08d844f38038991580fea08a7b123d4169c (diff)
downloadgsoc2013-evolution-72183d80ecaa52aef8b45e9857d2464ad3e624ca.tar
gsoc2013-evolution-72183d80ecaa52aef8b45e9857d2464ad3e624ca.tar.gz
gsoc2013-evolution-72183d80ecaa52aef8b45e9857d2464ad3e624ca.tar.bz2
gsoc2013-evolution-72183d80ecaa52aef8b45e9857d2464ad3e624ca.tar.lz
gsoc2013-evolution-72183d80ecaa52aef8b45e9857d2464ad3e624ca.tar.xz
gsoc2013-evolution-72183d80ecaa52aef8b45e9857d2464ad3e624ca.tar.zst
gsoc2013-evolution-72183d80ecaa52aef8b45e9857d2464ad3e624ca.zip
Remove exceptions from a number of methods that work on what ought to be
* camel-folder.c: Remove exceptions from a number of methods that work on what ought to be static data: get_parent_folder, get_parent_store, get_message_count, get_unread_message_count, get_permanent_flags, get_message_flags, set_message_flags, get_message_user_flag, set_message_user_flag, get_uids, get_summary, get_subfolder_names. Turn camel_folder_delete_message into a macro. (Mostly a pull-up from the camel-async branch.) * providers/{imap,mbox,nntp,pop3,vee}: Update for CamelFolder changes svn path=/trunk/; revision=4303
Diffstat (limited to 'camel/providers/nntp')
-rw-r--r--camel/providers/nntp/camel-nntp-folder.c55
1 files changed, 18 insertions, 37 deletions
diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c
index 8384327cd9..b1d0a919d5 100644
--- a/camel/providers/nntp/camel-nntp-folder.c
+++ b/camel/providers/nntp/camel-nntp-folder.c
@@ -70,7 +70,7 @@ nntp_folder_init (CamelFolder *folder, CamelStore *parent_store,
parent_class->init (folder, parent_store, parent_folder,
name, separator, path_begins_with_sep,
ex);
- if (camel_exception_get_id (ex)) return;
+ if (camel_exception_is_set (ex)) return;
/* set flags */
@@ -130,9 +130,8 @@ nntp_folder_sync (CamelFolder *folder, gboolean expunge,
camel_folder_summary_save (CAMEL_NNTP_FOLDER(folder)->summary);
- store = CAMEL_NNTP_STORE (camel_folder_get_parent_store (folder, ex));
- if (!camel_exception_is_set (ex))
- camel_nntp_newsrc_write (store->newsrc);
+ store = CAMEL_NNTP_STORE (camel_folder_get_parent_store (folder));
+ camel_nntp_newsrc_write (store->newsrc);
}
static const gchar *
@@ -160,7 +159,7 @@ nntp_folder_get_subfolder (CamelFolder *folder,
}
static gint
-nntp_folder_get_message_count (CamelFolder *folder, CamelException *ex)
+nntp_folder_get_message_count (CamelFolder *folder)
{
CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER(folder);
@@ -171,7 +170,7 @@ nntp_folder_get_message_count (CamelFolder *folder, CamelException *ex)
}
static guint32
-nntp_folder_get_message_flags (CamelFolder *folder, const char *uid, CamelException *ex)
+nntp_folder_get_message_flags (CamelFolder *folder, const char *uid)
{
CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER (folder);
CamelMessageInfo *info = camel_folder_summary_uid (nntp_folder->summary, uid);
@@ -181,7 +180,7 @@ nntp_folder_get_message_flags (CamelFolder *folder, const char *uid, CamelExcept
static void
nntp_folder_set_message_flags (CamelFolder *folder, const char *uid,
- guint32 flags, guint32 set, CamelException *ex)
+ guint32 flags, guint32 set)
{
CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER (folder);
CamelMessageInfo *info = camel_folder_summary_uid (nntp_folder->summary, uid);
@@ -191,16 +190,14 @@ nntp_folder_set_message_flags (CamelFolder *folder, const char *uid,
if (set & CAMEL_MESSAGE_SEEN) {
CamelNNTPStore *store;
int article_num;
- CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (camel_folder_get_parent_store (folder, ex));
+ CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (camel_folder_get_parent_store (folder));
- if (!camel_exception_is_set (ex)) {
- sscanf (uid, "%d", &article_num);
+ sscanf (uid, "%d", &article_num);
- camel_nntp_newsrc_mark_article_read (nntp_store->newsrc,
- nntp_folder->group_name,
- article_num);
- }
- }
+ camel_nntp_newsrc_mark_article_read (nntp_store->newsrc,
+ nntp_folder->group_name,
+ article_num);
+ }
camel_folder_summary_touch (nntp_folder->summary);
}
@@ -220,10 +217,7 @@ nntp_folder_get_message (CamelFolder *folder, const gchar *uid, CamelException *
char *message_id;
/* get the parent store */
- parent_store = camel_folder_get_parent_store (folder, ex);
- if (camel_exception_get_id (ex)) {
- return NULL;
- }
+ parent_store = camel_folder_get_parent_store (folder);
message_id = strchr (uid, ',') + 1;
status = camel_nntp_command (CAMEL_NNTP_STORE( parent_store ), NULL, "ARTICLE %s", message_id);
@@ -297,17 +291,8 @@ nntp_folder_get_message (CamelFolder *folder, const gchar *uid, CamelException *
return message;
}
-static void
-nntp_folder_delete_message (CamelFolder *folder,
- const gchar *uid,
- CamelException *ex)
-{
- g_assert (0);
-}
-
static GPtrArray *
-nntp_folder_get_uids (CamelFolder *folder,
- CamelException *ex)
+nntp_folder_get_uids (CamelFolder *folder)
{
CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER (folder);
GPtrArray *out;
@@ -327,8 +312,7 @@ nntp_folder_get_uids (CamelFolder *folder,
}
static GPtrArray *
-nntp_folder_get_summary (CamelFolder *folder,
- CamelException *ex)
+nntp_folder_get_summary (CamelFolder *folder)
{
CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER (folder);
@@ -336,10 +320,10 @@ nntp_folder_get_summary (CamelFolder *folder,
}
static GPtrArray *
-nntp_folder_get_subfolder_names (CamelFolder *folder, CamelException *ex)
+nntp_folder_get_subfolder_names (CamelFolder *folder)
{
if (!strcmp (folder->name, "/")) {
- CamelStore *store = camel_folder_get_parent_store (folder, ex);
+ CamelStore *store = camel_folder_get_parent_store (folder);
GPtrArray *array = camel_nntp_newsrc_get_subscribed_group_names (CAMEL_NNTP_STORE (store)->newsrc);
return array;
}
@@ -352,10 +336,8 @@ static void
nntp_folder_free_subfolder_names (CamelFolder *folder, GPtrArray *subfolders)
{
if (subfolders) {
- CamelException *ex = camel_exception_new ();
- CamelStore *store = camel_folder_get_parent_store (folder, ex);
+ CamelStore *store = camel_folder_get_parent_store (folder);
camel_nntp_newsrc_free_group_names (CAMEL_NNTP_STORE (store)->newsrc, subfolders);
- camel_exception_free (ex);
}
}
@@ -404,7 +386,6 @@ camel_nntp_folder_class_init (CamelNNTPFolderClass *camel_nntp_folder_class)
camel_folder_class->set_message_flags = nntp_folder_set_message_flags;
camel_folder_class->get_message_flags = nntp_folder_get_message_flags;
camel_folder_class->get_message = nntp_folder_get_message;
- camel_folder_class->delete_message = nntp_folder_delete_message;
camel_folder_class->get_uids = nntp_folder_get_uids;
camel_folder_class->free_uids = camel_folder_free_deep;
camel_folder_class->get_summary = nntp_folder_get_summary;