aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>1999-08-05 01:30:17 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-08-05 01:30:17 +0800
commitbbd88805c2120aec425e133f11a5bb3f5168d9a3 (patch)
tree28435078085ade60b94a34c45947670e15a74773 /camel
parentb92cd47ad5105869b66b2166e2dafecbf8d29c93 (diff)
downloadgsoc2013-evolution-bbd88805c2120aec425e133f11a5bb3f5168d9a3.tar.gz
gsoc2013-evolution-bbd88805c2120aec425e133f11a5bb3f5168d9a3.tar.zst
gsoc2013-evolution-bbd88805c2120aec425e133f11a5bb3f5168d9a3.zip
implemented.
1999-08-04 bertrand <Bertrand.Guiheneuf@aful.org> * camel/providers/MH/camel-mh-folder.c (_list_subfolders): implemented. svn path=/trunk/; revision=1077
Diffstat (limited to 'camel')
-rw-r--r--camel/camel-folder.h7
-rw-r--r--camel/providers/MH/camel-mh-folder.c50
2 files changed, 54 insertions, 3 deletions
diff --git a/camel/camel-folder.h b/camel/camel-folder.h
index 40d7d8f303..53ff89e70d 100644
--- a/camel/camel-folder.h
+++ b/camel/camel-folder.h
@@ -48,9 +48,10 @@ typedef enum {
} CamelFolderState;
typedef enum {
- FOLDER_OPEN_UNKNOWN, /* folder open mode is unknown */
- FOLDER_OPEN_READ, /* folder is read only */
- FOLDER_OPEN_READ_WRITE /* folder is read/write */
+ FOLDER_OPEN_UNKNOWN = 0, /* folder open mode is unknown */
+ FOLDER_OPEN_READ = 1, /* folder is read only */
+ FOLDER_OPEN_WRITE = 2, /* folder is write only */
+ FOLDER_OPEN_RW = 3 /* folder is read/write */
} CamelFolderOpenMode;
diff --git a/camel/providers/MH/camel-mh-folder.c b/camel/providers/MH/camel-mh-folder.c
index 8027be95b6..ad910f4005 100644
--- a/camel/providers/MH/camel-mh-folder.c
+++ b/camel/providers/MH/camel-mh-folder.c
@@ -47,6 +47,7 @@ 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 void
camel_mh_folder_class_init (CamelMhFolderClass *camel_mh_folder_class)
@@ -62,6 +63,7 @@ camel_mh_folder_class_init (CamelMhFolderClass *camel_mh_folder_class)
camel_folder_class->exists = _exists;
camel_folder_class->delete = _delete;
camel_folder_class->delete_messages = _delete_messages;
+ camel_folder_class->list_subfolders = _list_subfolders;
}
@@ -279,6 +281,54 @@ _delete_messages (CamelFolder *folder)
+static GList *
+_list_subfolders(CamelFolder *folder)
+{
+ GList *subfolder_name_list = NULL;
+
+ CamelMhFolder *mh_folder = CAMEL_MH_FOLDER(folder);
+ const gchar *directory_path;
+ struct stat stat_buf;
+ gint stat_error = 0;
+ GList *file_list;
+ gchar *entry_name;
+ struct dirent *dir_entry;
+ DIR *dir_handle;
+
+ g_assert(folder);
+
+ /* call default implementation */
+ parent_class->delete_messages (folder);
+
+ directory_path = mh_folder->directory_path;
+ if (!directory_path) return FALSE;
+
+ if (!camel_folder_exists (folder)) return TRUE;
+
+ dir_handle = opendir (directory_path);
+
+ /* read first entry in the directory */
+ dir_entry = readdir (dir_handle);
+ while ((stat_error != -1) && (unlink_error != -1) && (dir_entry != NULL)) {
+
+ /* get the name of the next entry in the dir */
+ entry_name = dir_entry->d_name;
+ stat_error = stat (mh_folder->directory_path, &stat_buf);
+
+ /* is it a directory ? */
+ if ((stat_error != -1) && S_ISDIR (stat_buf.st_mode)) {
+ /* yes, add it to the list */
+ CAMEL_LOG_FULL_DEBUG ("CamelMhFolder::list_subfolders adding %s\n", entry_name);
+ subfolder_name_list = g_list_append (subfolder_name_list, g_strdup (entry_name));
+ }
+ /* read next entry */
+ dir_entry = readdir (dir_handle);
+ }
+
+ closedir (dir_handle);
+
+ return subfolder_name_list;
+}
'2018-08-07 15:06:04 +0800'>2018-08-071-0/+1 * New port: editors/ghostwritertobik2018-08-031-0/+1 * New port: editors/ecrire: EFL (Enlightenment) graphical text editoryuri2018-08-031-0/+1 * - Update to 6.0.5lwhsu2018-06-271-0/+1 * New port: editors/gomatetobik2018-05-261-0/+1 * - Remove obsolete ports (lazarus-lcl-gtk2, lazarus-lcl-nogui lazarus-lcl-qtacm2018-05-261-5/+2 * New port: editors/kiletcberner2018-04-291-0/+1 * Add new port for editors/calligraplantcberner2018-04-291-0/+1 * New port: editors/kakounetobik2018-04-131-0/+1 * New port: editors/katetcberner2018-04-091-0/+1 * Connect editors/libreoffice-hsblwhsu2018-03-171-0/+1 * New port: editors/neovim-qt: Neovim client library and QT5 GUIyuri2018-03-161-0/+1 * Give the KDE SC4 applications ports a -kde4 suffixtcberner2018-02-231-2/+2 * Flavorize and modernize Emacs portsjrm2018-02-021-1/+0 * - Update to 1.8.0acm2018-02-011-0/+1 * Revert recent fpc changes, they were obviously untestedantoine2018-01-311-1/+0 * - Update to 1.8.0acm2018-01-311-0/+1 * Rename editors/vim-lite to editors/vim-console. The vim-console port isn'tadamw2018-01-121-1/+1 * Add editors/vim-tiny.adamw2018-01-091-0/+1 * Add editors/rubygem-neovim, ruby bindings to control neovim.adamw2018-01-091-0/+1 * Add a port of medit, a programming and around-programming text editor.danfe2018-01-081-0/+1 * editors/tree-widget: Remove expired portjrm2017-12-261-1/+0 * New port: editors/dte: Small and easy to use console text editoryuri2017-12-191-0/+1 * Remove expired ports:rene2017-10-171-1/+0 * Remove expired port:rene2017-10-071-1/+0 * - New port: editors/dlangideacm2017-07-231-0/+1 * - New port: editors/coeditacm2017-07-221-0/+1 * New port: editors/xi-coretobik2017-06-221-0/+1 * Update the Calligra ports to 3.0.1.rakuco2017-06-171-19/+0 * New port: editors/jucitobik2017-05-311-0/+1 * New port: EditorConfig File Locator and Interpreter for Python.shaun2017-04-121-0/+1 * Remove expired ports:rene2017-04-111-1/+0 * Add new port `editors/encryptpad', a minimalist secure text editor anddanfe2017-03-191-0/+1 * editors/micro: create portswills2017-02-281-0/+1 * Resurrect bpatch, hope everything's right this time.joerg2017-01-291-0/+1 * Update to 5.2.4.jkim2017-01-021-0/+1 * Add editors/web-mode, an autonomous Emacs major-modehrs2016-12-301-0/+1 * Add hexer 1.0.3, multi buffer editor for binary files.ehaupt2016-12-161-0/+1 * - Update to 1.6.2jhale2016-12-041-1/+0 * This was not resurrected properly.mat2016-11-211-1/+0 * Resurrect bpatch, after moving the distfile to MASTER_SITE_LOCAL.joerg2016-11-171-0/+1 * Remove expired ports:rene2016-10-191-1/+0 * [NEW PORT] editors/ecce: Edinburgh Compatible Context Editorcpm2016-10-061-0/+1 * FocusWriter is a simple, distraction-free writing environment. It utilizes apawel2016-07-151-0/+1 * FocusWriter is a simple, distraction-free writing environment. It utilizes apawel2016-07-151-0/+1 * Remove expired ports without open PRs:rene2016-07-051-2/+0 * - Resurrect editors/pdfedit. Fix to compile the library part onlyhrs2016-06-121-0/+1 * New port: editors/with-editorpi2016-02-051-0/+1 * New port: editors/thepi2016-01-211-0/+1 * Add new port editors/fileobjmarino2016-01-161-0/+1 * Remove expired ports:rene2015-12-311-1/+0 * - Rename editors/sublime3 to editors/linux-sublime3 and add PKGNAMESUFFIXamdmi32015-12-301-1/+1 * - Rename editors/sublime to editors/linux-sublime as it's Linux binary portamdmi32015-12-291-1/+1 * Update Calligra to 2.9.10.rakuco2015-12-221-3/+0 * Remove expired ports:rene2015-11-291-4/+0 * Are you a writer? Plume Creator will help you with this hard task! Thispawel2015-10-291-0/+1 * editors/neovim: create portswills2015-09-111-0/+1 * Update LibreOffice to 5.0.1.jkim2015-09-021-0/+2 * The lazarus GTK1 interface has been discontinued upstream:bapt2015-07-151-1/+0 * Vanubi is an Emacs-like editor implemented in Vala. It is designed to beolivierd2015-07-091-0/+1 * editors/zim: move to deskutilsrm2015-06-191-1/+0 * Remove expired ports:rene2015-06-111-1/+0 * Add a port of Shed (Simple Hex Editor).danfe2015-04-071-0/+1 * Sort entries alphabetically across all categories to avoid extra repo churn.danfe2014-12-081-2/+2 * - Rename editors/texmakerx to editors/texstudio and update it to 2.8.6makc2014-12-071-1/+1 * LaTeXila is a LaTeX editor for the GNOME desktop. The idea of LaTeXila isolivierd2014-11-271-0/+1 * Resurrect editors/psgml.hrs2014-11-221-0/+1 * Remove expired port:rene2014-11-201-1/+0 * The FreeBSD GNOME team proudly presents GNOME 3.14 and Cinnamon 2.2.kwm2014-11-191-1/+0 * Remove eel and ports that use it.kwm2014-10-031-1/+0 * Update CentOS base to 6.5, add userland portsxmj2014-09-221-0/+2 * Attempt #5 to unbreak INDEX after Mate Desktop 1.8 import: s/SUBDUR/SUBDIR/.cperciva2014-09-111-1/+1 * Unhook mate-text-editor in an attempt to unbreak INDEX. I think this portcperciva2014-09-111-1/+0 * Welcome Mate Desktop 1.8bapt2014-09-101-0/+1 * Remove unstaged devel/semantic and two of it's unstaged dependenciesmarino2014-09-07