aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder.c
diff options
context:
space:
mode:
authorDan Winship <danw@helixcode.com>2000-04-07 04:10:05 +0800
committerDan Winship <danw@src.gnome.org>2000-04-07 04:10:05 +0800
commitf3f2afef4c3c60fa1ba472ef93e8e8516e7027bb (patch)
treea1bb7f65da6d7b02e755f7b4b088e8b2c20e0458 /camel/camel-folder.c
parent1a6692a89d5e2ea02e777c010aa410b5ec5a48f3 (diff)
downloadgsoc2013-evolution-f3f2afef4c3c60fa1ba472ef93e8e8516e7027bb.tar.gz
gsoc2013-evolution-f3f2afef4c3c60fa1ba472ef93e8e8516e7027bb.tar.zst
gsoc2013-evolution-f3f2afef4c3c60fa1ba472ef93e8e8516e7027bb.zip
Reorganize the folder-fetching methods and implement a folder cache so
2000-04-06 Dan Winship <danw@helixcode.com> * camel-store.[ch]: Reorganize the folder-fetching methods and implement a folder cache so that multiple requests for the same folder will yield the same CamelFolder object (as long as it remains active). Includes some code to remove no-longer-active folders from the cache, but it doesn't get used since nothing is ever unref'ed in Camel right now... * providers/mbox/camel-mbox-store.c: * providers/pop3/camel-pop3-store.c: update for CamelStore changes. * camel-folder.[ch]: Remove the (unused) CamelException argument from camel_folder_get_name and camel_folder_get_full_name. (camel_folder_set_name): make this go away since changing a folder's name after it has been created could result in it conflicting with a separately-issued folder. svn path=/trunk/; revision=2314
Diffstat (limited to 'camel/camel-folder.c')
-rw-r--r--camel/camel-folder.c41
1 files changed, 11 insertions, 30 deletions
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index e6ab27b876..dffbb7d011 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -70,9 +70,8 @@ static void _close_async (CamelFolder *folder,
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 const gchar *_get_name (CamelFolder *folder);
+static const gchar *_get_full_name (CamelFolder *folder);
static gboolean _can_hold_folders (CamelFolder *folder);
@@ -270,7 +269,7 @@ _init (CamelFolder *folder, CamelStore *parent_store,
folder->open_mode = FOLDER_OPEN_UNKNOWN;
folder->open_state = FOLDER_CLOSE;
folder->separator = separator;
- camel_folder_set_name (folder, name, ex);
+ CF_CLASS (folder)->set_name (folder, name, ex);
}
@@ -462,8 +461,7 @@ _set_name (CamelFolder *folder,
if (folder->parent_folder) {
parent_full_name =
- camel_folder_get_full_name (folder->parent_folder, ex);
- if (camel_exception_get_id (ex)) return;
+ camel_folder_get_full_name (folder->parent_folder);
full_name = g_strdup_printf ("%s%c%s", parent_full_name,
folder->separator, name);
@@ -479,24 +477,9 @@ _set_name (CamelFolder *folder,
}
-/**
- * camel_folder_set_name:set the (short) name of the folder
- * @folder: folder
- * @name: new name of the folder
- * @ex: exception object
- **/
-void
-camel_folder_set_name (CamelFolder *folder, const gchar *name,
- CamelException *ex)
-{
- g_assert (folder != NULL);
- CF_CLASS (folder)->set_name (folder, name, ex);
-}
-
-
static const gchar *
-_get_name (CamelFolder *folder, CamelException *ex)
+_get_name (CamelFolder *folder)
{
return folder->name;
}
@@ -512,16 +495,16 @@ _get_name (CamelFolder *folder, CamelException *ex)
* Return value: name of the folder
**/
const gchar *
-camel_folder_get_name (CamelFolder *folder, CamelException *ex)
+camel_folder_get_name (CamelFolder *folder)
{
g_assert (folder != NULL);
- return CF_CLASS (folder)->get_name (folder, ex);
+ return CF_CLASS (folder)->get_name (folder);
}
static const gchar *
-_get_full_name (CamelFolder *folder, CamelException *ex)
+_get_full_name (CamelFolder *folder)
{
return folder->full_name;
}
@@ -535,10 +518,10 @@ _get_full_name (CamelFolder *folder, CamelException *ex)
* Return value: full name of the folder
**/
const gchar *
-camel_folder_get_full_name (CamelFolder *folder, CamelException *ex)
+camel_folder_get_full_name (CamelFolder *folder)
{
g_assert (folder != NULL);
- return CF_CLASS (folder)->get_full_name (folder, ex);
+ return CF_CLASS (folder)->get_full_name (folder);
}
@@ -648,9 +631,7 @@ _get_subfolder (CamelFolder *folder,
g_assert (folder->parent_store != NULL);
- current_folder_full_name = camel_folder_get_full_name (folder, ex);
- if (camel_exception_get_id (ex)) return NULL;
-
+ current_folder_full_name = camel_folder_get_full_name (folder);
full_name = g_strdup_printf ("%s%c%s", current_folder_full_name,
folder->separator, folder_name);