diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2006-02-14 07:01:21 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2006-02-14 07:01:21 +0800 |
commit | 44d332d8c7b555b37292ba70ca9be327c1aacfe8 (patch) | |
tree | e36487e9effcce688fcf5aa9a1ec20fbbcf3012f /lib/ephy-file-helpers.c | |
parent | 6a26e601c499f07ef80c69e72dd902490a019a59 (diff) | |
download | gsoc2013-epiphany-44d332d8c7b555b37292ba70ca9be327c1aacfe8.tar gsoc2013-epiphany-44d332d8c7b555b37292ba70ca9be327c1aacfe8.tar.gz gsoc2013-epiphany-44d332d8c7b555b37292ba70ca9be327c1aacfe8.tar.bz2 gsoc2013-epiphany-44d332d8c7b555b37292ba70ca9be327c1aacfe8.tar.lz gsoc2013-epiphany-44d332d8c7b555b37292ba70ca9be327c1aacfe8.tar.xz gsoc2013-epiphany-44d332d8c7b555b37292ba70ca9be327c1aacfe8.tar.zst gsoc2013-epiphany-44d332d8c7b555b37292ba70ca9be327c1aacfe8.zip |
Move --private-instance out of debug #ifdef.
2006-02-14 Christian Persch <chpe@cvs.gnome.org>
* lib/ephy-file-helpers.c: (ephy_file_helpers_init),
(ephy_file_helpers_shutdown), (ephy_file_delete_on_exit),
(ephy_file_monitor_cancel), (ephy_file_delete_directory):
* lib/ephy-file-helpers.h:
* src/ephy-main.c: (main):
Move --private-instance out of debug #ifdef.
Diffstat (limited to 'lib/ephy-file-helpers.c')
-rw-r--r-- | lib/ephy-file-helpers.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c index 7a40fde5e..c8548bf94 100644 --- a/lib/ephy-file-helpers.c +++ b/lib/ephy-file-helpers.c @@ -34,6 +34,7 @@ #include <libgnomevfs/gnome-vfs-utils.h> #include <libgnomevfs/gnome-vfs-file-info.h> #include <libgnomevfs/gnome-vfs-ops.h> +#include <libgnomevfs/gnome-vfs-directory.h> #include <libxml/xmlreader.h> /* bug http://bugzilla.gnome.org/show_bug.cgi?id=156687 */ @@ -61,7 +62,7 @@ static GHashTable *files = NULL; static GHashTable *mime_table = NULL; static gboolean have_private_profile = FALSE; -static gboolean delete_profile_on_exit = FALSE; +static gboolean keep_temp_directory = FALSE; /* for debug purposes */ static char *dot_dir = NULL; static char *tmp_dir = NULL; static GList *del_on_exit = NULL; @@ -260,7 +261,7 @@ ephy_dot_dir (void) gboolean ephy_file_helpers_init (const char *profile_dir, gboolean private_profile, - gboolean delete_profile, + gboolean keep_temp_dir, GError **error) { const char *uuid; @@ -284,7 +285,7 @@ ephy_file_helpers_init (const char *profile_dir, (GDestroyNotify) g_free); have_private_profile = private_profile; - delete_profile_on_exit = delete_profile; + keep_temp_directory = keep_temp_dir; if (private_profile && profile_dir != NULL) { @@ -344,15 +345,23 @@ ephy_file_helpers_shutdown (void) mime_table = NULL; } + g_free (dot_dir); + dot_dir = NULL; + if (tmp_dir != NULL) { - rmdir (tmp_dir); + if (!keep_temp_directory) + { + /* recursively delete the contents */ + ephy_file_delete_directory (tmp_dir); + + /* delete the directory itself too */ + rmdir (tmp_dir); + } + g_free (tmp_dir); tmp_dir = NULL; } - - g_free (dot_dir); - dot_dir = NULL; } gboolean @@ -479,8 +488,7 @@ failed: void ephy_file_delete_on_exit (const char *path) { - del_on_exit = g_list_prepend (del_on_exit, - g_strdup (path)); + /* does nothing now */ } static void @@ -1160,3 +1168,9 @@ ephy_file_monitor_cancel (EphyFileMonitor *monitor) g_free (monitor->uri); g_free (monitor); } + +void +ephy_file_delete_directory (const char *path) +{ + /* FIXME not implemented yet */ +} |