diff options
author | Iain Holmes <iain@src.gnome.org> | 2000-12-14 02:26:45 +0800 |
---|---|---|
committer | Iain Holmes <iain@src.gnome.org> | 2000-12-14 02:26:45 +0800 |
commit | fe7da31d862feb3175a507bdb594341cac721f22 (patch) | |
tree | d9d6f60c28c48b94c12eb4c815454b4ef4139456 /executive-summary/component/e-summary-util.c | |
parent | 1aa4562d998bc7f107fe3ea09ddb01c102274492 (diff) | |
download | gsoc2013-evolution-fe7da31d862feb3175a507bdb594341cac721f22.tar gsoc2013-evolution-fe7da31d862feb3175a507bdb594341cac721f22.tar.gz gsoc2013-evolution-fe7da31d862feb3175a507bdb594341cac721f22.tar.bz2 gsoc2013-evolution-fe7da31d862feb3175a507bdb594341cac721f22.tar.lz gsoc2013-evolution-fe7da31d862feb3175a507bdb594341cac721f22.tar.xz gsoc2013-evolution-fe7da31d862feb3175a507bdb594341cac721f22.tar.zst gsoc2013-evolution-fe7da31d862feb3175a507bdb594341cac721f22.zip |
Rm the whole of the Executive Summary dir.
Correctly display all the windows.
Put an HTML explaination into the configure dialog.
svn path=/trunk/; revision=6969
Diffstat (limited to 'executive-summary/component/e-summary-util.c')
-rw-r--r-- | executive-summary/component/e-summary-util.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/executive-summary/component/e-summary-util.c b/executive-summary/component/e-summary-util.c index 78731a6b3e..c19c829d57 100644 --- a/executive-summary/component/e-summary-util.c +++ b/executive-summary/component/e-summary-util.c @@ -25,6 +25,20 @@ #include <gnome.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <dirent.h> + +/** + * e_pixmap_file: + * @filename: Filename of pixmap. + * + * Finds @filename in the Evolution or GNOME installation dir. + * + * Returns: A newly allocated absolute path to @filename, or NULL + * if it cannot be found. + */ char * e_pixmap_file (const char *filename) { @@ -65,3 +79,48 @@ e_pixmap_file (const char *filename) return gnome_pixmap_file (filename); } +/** + * e_summary_rm_dir: + * @path: Full path to the directory or file to be removed. + * + * Deletes everything in fullpath. + */ +void +e_summary_rm_dir (const char *path) +{ + DIR *base; + struct stat statbuf; + struct dirent *contents; + + stat (path, &statbuf); + if (!S_ISDIR (statbuf.st_mode)) { + /* Not a directory */ + g_warning ("Removing: %s", path); + unlink (path); + return; + } else { + g_warning ("Opening: %s", path); + base = opendir (path); + + contents = readdir (base); + while (contents != NULL) { + char *fullpath; + + if (strcmp (contents->d_name, ".") == 0|| + strcmp (contents->d_name, "..") ==0) { + contents = readdir (base); + continue; + } + + fullpath = g_concat_dir_and_file (path, contents->d_name); + e_summary_rm_dir (fullpath); + g_free (fullpath); + + contents = readdir (base); + } + + closedir (base); + rmdir (path); + } +} + |