diff options
author | Diego Escalante Urrelo <descalante@igalia.com> | 2011-09-05 05:34:49 +0800 |
---|---|---|
committer | Diego Escalante Urrelo <descalante@igalia.com> | 2011-09-05 05:56:44 +0800 |
commit | 7dafb390f5091bfbf1b5236aebf8e5f33aa0bbf1 (patch) | |
tree | 91ebd2a5c9f9a5739d1629cd51454e9bc98472ab /embed | |
parent | 5208e2eab48e8a64912d2f00264b9a6c96c572e0 (diff) | |
download | gsoc2013-epiphany-7dafb390f5091bfbf1b5236aebf8e5f33aa0bbf1.tar gsoc2013-epiphany-7dafb390f5091bfbf1b5236aebf8e5f33aa0bbf1.tar.gz gsoc2013-epiphany-7dafb390f5091bfbf1b5236aebf8e5f33aa0bbf1.tar.bz2 gsoc2013-epiphany-7dafb390f5091bfbf1b5236aebf8e5f33aa0bbf1.tar.lz gsoc2013-epiphany-7dafb390f5091bfbf1b5236aebf8e5f33aa0bbf1.tar.xz gsoc2013-epiphany-7dafb390f5091bfbf1b5236aebf8e5f33aa0bbf1.tar.zst gsoc2013-epiphany-7dafb390f5091bfbf1b5236aebf8e5f33aa0bbf1.zip |
e-file-helpers: implement and use ephy_file_delete_dir_recursively
Move the implementation from ephy-web-app-utils.c to
ephy-file-helpers.c.
The current one was not doing recursive delete, this caused the bug of
private instances leaving their profile directories behind in /tmp.
Bug #658201
Diffstat (limited to 'embed')
-rw-r--r-- | embed/ephy-web-app-utils.c | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/embed/ephy-web-app-utils.c b/embed/ephy-web-app-utils.c index 7920ebc4c..f2da66adb 100644 --- a/embed/ephy-web-app-utils.c +++ b/embed/ephy-web-app-utils.c @@ -29,57 +29,6 @@ #include <glib/gstdio.h> #include <libsoup/soup-gnome.h> -static gboolean -_g_directory_delete_recursively (GFile *directory, GError **error) -{ - GFileEnumerator *children = NULL; - GFileInfo *info; - gboolean ret = TRUE; - - children = g_file_enumerate_children (directory, - "standard::name,standard::type", - 0, NULL, error); - if (error) - goto out; - - info = g_file_enumerator_next_file (children, NULL, error); - while (info || error) { - GFile *child; - const char *name; - GFileType type; - - if (error) - goto out; - - name = g_file_info_get_name (info); - child = g_file_get_child (directory, name); - type = g_file_info_get_file_type (info); - - if (type == G_FILE_TYPE_DIRECTORY) - ret = _g_directory_delete_recursively (child, error); - else if (type == G_FILE_TYPE_REGULAR) - ret = g_file_delete (child, NULL, error); - - g_object_unref (info); - - if (!ret) - goto out; - - info = g_file_enumerator_next_file (children, NULL, error); - } - - ret = TRUE; - - g_file_delete (directory, NULL, error); - -out: - - if (children) - g_object_unref (children); - - return ret; -} - /** * ephy_web_application_get_directory: * @app_name: the application name @@ -129,7 +78,7 @@ ephy_web_application_delete (const char *name) } profile = g_file_new_for_path (profile_dir); - if (!_g_directory_delete_recursively (profile, NULL)) + if (!ephy_file_delete_dir_recursively (profile, NULL)) goto out; g_print ("Deleted application profile.\n"); |