From fe7da31d862feb3175a507bdb594341cac721f22 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Wed, 13 Dec 2000 18:26:45 +0000 Subject: 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 --- executive-summary/component/e-summary-util.c | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'executive-summary/component/e-summary-util.c') 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 +#include +#include +#include +#include + +/** + * 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); + } +} + -- cgit