summaryrefslogtreecommitdiff
path: root/lib/ephy-web-app-utils.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2014-12-01 11:17:12 +0100
committerCarlos Garcia Campos <carlosgc@gnome.org>2014-12-01 17:52:21 +0100
commit331e681810d9b0af3ed66318f6c11e52e069616e (patch)
tree8d51332a5cbb149ca38a846cf5def69a230097dd /lib/ephy-web-app-utils.c
parent947c026218fd687722035b9cf39063b92c9f5239 (diff)
downloadepiphany-331e681810d9b0af3ed66318f6c11e52e069616e.tar.gz
file-helpers: Fix ephy_file_delete_dir_recursively when an error is given
The implementation is checking the given error pointer to check if an error ocurred, instead of checking the pointer pointed by the passed in error. This means that it is always failing when an error is passed, but it works in most of the cases when NULL is passed because the return value of functions is checked too. There's still a problem when g_file_enumerator_next_file() returns NULL, because in case of error we are considering it as end of enumeration. We can simplify the implementation and the caller code, by using the stdio API instead of GIO, since we know we are dealing with local files anyway and we are using the synchronous API.
Diffstat (limited to 'lib/ephy-web-app-utils.c')
-rw-r--r--lib/ephy-web-app-utils.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/ephy-web-app-utils.c b/lib/ephy-web-app-utils.c
index 165e83fc7..aeac51dcd 100644
--- a/lib/ephy-web-app-utils.c
+++ b/lib/ephy-web-app-utils.c
@@ -120,7 +120,7 @@ ephy_web_application_delete (const char *name)
char *profile_dir = NULL;
char *desktop_file = NULL, *desktop_path = NULL;
char *wm_class;
- GFile *profile = NULL, *launcher = NULL;
+ GFile *launcher = NULL;
gboolean return_value = FALSE;
g_return_val_if_fail (name, FALSE);
@@ -136,8 +136,7 @@ ephy_web_application_delete (const char *name)
goto out;
}
- profile = g_file_new_for_path (profile_dir);
- if (!ephy_file_delete_dir_recursively (profile, NULL))
+ if (!ephy_file_delete_dir_recursively (profile_dir, NULL))
goto out;
LOG ("Deleted application profile.\n");
@@ -156,8 +155,6 @@ ephy_web_application_delete (const char *name)
out:
- if (profile)
- g_object_unref (profile);
g_free (profile_dir);
if (launcher)