diff options
author | bertrand <Bertrand.Guiheneuf@aful.org> | 1999-08-04 02:08:04 +0800 |
---|---|---|
committer | Bertrand Guiheneuf <bertrand@src.gnome.org> | 1999-08-04 02:08:04 +0800 |
commit | 0f2d4dd1153bb7491c5494843d959148a31a895d (patch) | |
tree | f2d88dcc56a504498f59979c01e97729a7c53afc /camel/camel-folder.c | |
parent | b9daf0016bc3d7244ced57dd88f63c1fd6debbac (diff) | |
download | gsoc2013-evolution-0f2d4dd1153bb7491c5494843d959148a31a895d.tar.gz gsoc2013-evolution-0f2d4dd1153bb7491c5494843d959148a31a895d.tar.zst gsoc2013-evolution-0f2d4dd1153bb7491c5494843d959148a31a895d.zip |
Started implementing mh store/folder as a test provider. Next will be pop3.
1999-08-03 bertrand <Bertrand.Guiheneuf@aful.org>
* camel/providers/MH/camel-mh-folder.c (_create):
implemented.
(_delete): started implementation.
* camel/camel-folder.c (_get_folder): default implementation
calls camel_store_get_folder ().
* camel/providers/MH/camel-mh-folder.c (_init_with_store):
implemented.
* camel/camel-folder.h (struct _CamelFolder):
remove useless exist_on_store field.
* camel/camel-folder.c (_exists):
do not use exist_on_store field.
svn path=/trunk/; revision=1073
Diffstat (limited to 'camel/camel-folder.c')
-rw-r--r-- | camel/camel-folder.c | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/camel/camel-folder.c b/camel/camel-folder.c index db3e7f9f8a..2f103283d4 100644 --- a/camel/camel-folder.c +++ b/camel/camel-folder.c @@ -315,7 +315,7 @@ _can_hold_messages (CamelFolder *folder) /** - * _exists: tests if the folder object exists in its parent store. + * _exists: tests if the folder object exists in its parent store. * @folder: folder object * * Test if a folder exists on a store. A folder can be @@ -327,7 +327,7 @@ _can_hold_messages (CamelFolder *folder) static gboolean _exists (CamelFolder *folder) { - return folder->exists_on_store; + return FALSE; } @@ -350,30 +350,32 @@ _is_open (CamelFolder *folder) -/** - * _get_folder: return the (sub)folder object that is specified. - * - * @folder : the folder - * @folder_name: subfolder path. - * - * This method returns a folder objects. This folder - * is necessarily a subfolder of the current folder. - * It is an error to ask a folder begining with the - * folder separator character. - * - * - * Return value: Required folder. NULL if the subfolder object - * could not be obtained - **/ + static CamelFolder * _get_folder (CamelFolder *folder, const gchar *folder_name) { - g_warning("getFolder called on the abstract CamelFolder class\n"); - return NULL; + CamelFolder *new_folder; + gchar *full_name; + const gchar *current_folder_full_name; + gchar separator; + + g_assert (folder); + g_assert (folder_name); + + if (!folder->parent_store) return NULL; + + current_folder_full_name = camel_folder_get_full_name (folder); + if (!current_folder_full_name) return NULL; + + separator = camel_store_get_separator (folder->parent_store); + full_name = g_strdup_printf ("%s%d%s", current_folder_full_name, separator, folder_name); + + new_folder = camel_store_get_folder (folder->parent_store, full_name); + return new_folder; } /** - * _get_folder: return the (sub)folder object that is specified. + * camel_folder_get_folder: return the (sub)folder object that is specified. * * @folder : the folder * @folder_name: subfolder path. @@ -396,16 +398,18 @@ camel_folder_get_folder(CamelFolder *folder, gchar *folder_name) /** - * _create: - * @folder: + * _create: creates a folder on its store + * @folder: a CamelFolder object. * * this routine handles the recursion mechanism. * Children classes have to implement the actual * creation mechanism. They must call this method * before physically creating the folder in order * to be sure the parent folder exists. + * Calling this routine on an existing folder is + * not an error, and returns %TRUE. * - * Return value: + * Return value: %TRUE if the folder exists, %FALSE otherwise **/ static gboolean _create(CamelFolder *folder) @@ -415,9 +419,9 @@ _create(CamelFolder *folder) CamelFolder *parent; gchar sep; - - g_assert(folder->parent_store); - g_assert(folder->name); + g_assert (folder); + g_assert (folder->parent_store); + g_assert (folder->name); if (CF_CLASS(folder)->exists (folder)) return TRUE; @@ -511,7 +515,7 @@ _delete (CamelFolder *folder, gboolean recurse) if (subfolders) { sf = subfolders; do { - CF_CLASS(sf->data)->delete(sf->data, TRUE);; + /* CF_CLASS(sf->data)->delete(sf->data, TRUE); */ } while (sf = sf->next); } } else if (subfolders) return FALSE; |