[gnome-settings-daemon] color: Simplify gcm_profile_store_mkdir_with_parents()
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] color: Simplify gcm_profile_store_mkdir_with_parents()
- Date: Mon, 3 Oct 2011 10:08:17 +0000 (UTC)
commit e3313eb16fd2cb25ab3fbc010837b910e525acf6
Author: Bastien Nocera <hadess hadess net>
Date: Mon Oct 3 11:02:56 2011 +0100
color: Simplify gcm_profile_store_mkdir_with_parents()
No need to check for the path existing,
g_file_make_directory_with_parents() will do that for us.
plugins/color/gcm-profile-store.c | 15 ++++-----------
1 files changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/plugins/color/gcm-profile-store.c b/plugins/color/gcm-profile-store.c
index 3dde406..d705604 100644
--- a/plugins/color/gcm-profile-store.c
+++ b/plugins/color/gcm-profile-store.c
@@ -419,19 +419,12 @@ static gboolean
gcm_profile_store_mkdir_with_parents (const gchar *filename, GError **error)
{
gboolean ret;
- GFile *file = NULL;
/* ensure destination exists */
- ret = g_file_test (filename, G_FILE_TEST_EXISTS);
- if (!ret) {
- file = g_file_new_for_path (filename);
- ret = g_file_make_directory_with_parents (file, NULL, error);
- if (!ret)
- goto out;
- }
-out:
- if (file != NULL)
- g_object_unref (file);
+ file = g_file_new_for_path (filename);
+ ret = g_file_make_directory_with_parents (file, NULL, error);
+ g_object_unref (file);
+
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]