[evolution/gnome-3-24] [ECompEditor] Ensure local store directory exists before saving attachments
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-24] [ECompEditor] Ensure local store directory exists before saving attachments
- Date: Fri, 19 May 2017 06:02:39 +0000 (UTC)
commit c126c9432ad3a313fdbed8378ba2ebdca5a6ebde
Author: Milan Crha <mcrha redhat com>
Date: Fri May 19 08:00:49 2017 +0200
[ECompEditor] Ensure local store directory exists before saving attachments
src/calendar/gui/e-comp-editor.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/calendar/gui/e-comp-editor.c b/src/calendar/gui/e-comp-editor.c
index baf479d..7fa78c2 100644
--- a/src/calendar/gui/e-comp-editor.c
+++ b/src/calendar/gui/e-comp-editor.c
@@ -630,6 +630,7 @@ ece_save_component_attachments_sync (ECalClient *cal_client,
GError **error)
{
icalproperty *prop;
+ const gchar *local_store;
gchar *target_filename_prefix, *filename_prefix, *tmp;
gboolean success = TRUE;
@@ -641,9 +642,13 @@ ece_save_component_attachments_sync (ECalClient *cal_client,
filename_prefix = g_strconcat (tmp, "-", NULL);
g_free (tmp);
- target_filename_prefix = g_build_filename (
- e_cal_client_get_local_attachment_store (cal_client),
- filename_prefix, NULL);
+ local_store = e_cal_client_get_local_attachment_store (cal_client);
+ if (local_store && *local_store &&
+ g_mkdir_with_parents (local_store, 0700) < 0) {
+ g_debug ("%s: Failed to create local store directory '%s'", G_STRFUNC, local_store);
+ }
+
+ target_filename_prefix = g_build_filename (local_store, filename_prefix, NULL);
g_free (filename_prefix);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]