diff options
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/dialogs/cal-attachment-select-file.c | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 26 | ||||
-rw-r--r-- | calendar/gui/e-cal-popup.c | 4 | ||||
-rw-r--r-- | calendar/gui/e-calendar-table.c | 13 | ||||
-rw-r--r-- | calendar/gui/e-calendar-view.c | 15 | ||||
-rw-r--r-- | calendar/gui/e-memo-table.c | 14 |
6 files changed, 37 insertions, 38 deletions
diff --git a/calendar/gui/dialogs/cal-attachment-select-file.c b/calendar/gui/dialogs/cal-attachment-select-file.c index 2b7fb4fdae..79e4a75a77 100644 --- a/calendar/gui/dialogs/cal-attachment-select-file.c +++ b/calendar/gui/dialogs/cal-attachment-select-file.c @@ -82,6 +82,7 @@ run_selector(CompEditor *editor, const char *title, guint32 flags, gboolean *sho NULL); gtk_dialog_set_default_response (GTK_DIALOG (selection), GTK_RESPONSE_OK); + gtk_file_chooser_set_local_only (selection, FALSE); if ((flags & SELECTOR_MODE_SAVE) == 0) gtk_file_chooser_set_select_multiple ((GtkFileChooser *) selection, (flags & SELECTOR_MODE_MULTI)); @@ -193,7 +194,7 @@ comp_editor_select_file_attachments (CompEditor *editor, gboolean *showinline_p) #ifdef USE_GTKFILECHOOSER GSList *l, *n; - if ((l = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER (selection)))) { + if ((l = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (selection)))) { list = g_ptr_array_new (); while (l) { diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 5aa39dae90..d024eb7213 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -295,7 +295,7 @@ drop_action(CompEditor *editor, GdkDragContext *context, guint32 action, GtkSele else e_attachment_bar_attach_remote_file (E_ATTACHMENT_BAR (editor->priv->attachment_bar), - str); + str, "attachment"); camel_url_free (url); g_free (str); @@ -1060,8 +1060,18 @@ cab_add(EPopup *ep, EPopupItem *item, void *data) if (!file_list) return; for (i = 0; i < file_list->len; i++) { - e_attachment_bar_attach (bar, file_list->pdata[i], is_inline ? "inline" : "attachment"); + CamelURL *url; + + url = camel_url_new (file_list->pdata[i], NULL); + if (url == NULL) + continue; + + if (!g_ascii_strcasecmp (url->protocol, "file")) + e_attachment_bar_attach (bar, url->path, is_inline ? "inline" : "attachment"); + else + e_attachment_bar_attach_remote_file (bar, file_list->pdata[i], is_inline ? "inline" : "attachment"); g_free (file_list->pdata[i]); + camel_url_free (url); } g_ptr_array_free (file_list, TRUE); @@ -1355,8 +1365,18 @@ menu_insert_attachment_cb (BonoboUIComponent *uic, if (!file_list) return; for (i = 0; i < file_list->len; i++) { - e_attachment_bar_attach (bar, file_list->pdata[i], is_inline ? "inline" : "attachment"); + CamelURL *url; + + url = camel_url_new (file_list->pdata[i], NULL); + if (url == NULL) + continue; + + if (!g_ascii_strcasecmp (url->protocol, "file")) + e_attachment_bar_attach (bar, url->path, is_inline ? "inline" : "attachment"); + else + e_attachment_bar_attach_remote_file (bar, file_list->pdata[i], is_inline ? "inline" : "attachment"); g_free (file_list->pdata[i]); + camel_url_free (url); } g_ptr_array_free (file_list, TRUE); diff --git a/calendar/gui/e-cal-popup.c b/calendar/gui/e-cal-popup.c index 7e1d1ca040..32967f04b5 100644 --- a/calendar/gui/e-cal-popup.c +++ b/calendar/gui/e-cal-popup.c @@ -37,7 +37,7 @@ #include <libedataserverui/e-source-selector.h> #include <camel/camel-mime-part.h> -#include <camel/camel-stream-fs.h> +#include <camel/camel-stream-vfs.h> #include "e-util/e-util.h" #include "e-util/e-i18n.h" #include "e-util/e-mktemp.h" @@ -135,7 +135,7 @@ temp_save_part(CamelMimePart *part, char *path, gboolean file) } wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part)); - stream = camel_stream_fs_new_with_name (path, O_RDWR|O_CREAT|O_TRUNC, 0600); + stream = camel_stream_vfs_new_with_uri (path, O_WRONLY|O_CREAT|O_TRUNC, 0600); if (!stream) { /* TODO handle error conditions */ diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index 259238bb42..955ee0fb58 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -1097,8 +1097,7 @@ e_calendar_table_on_save_as (EPopup *ep, EPopupItem *pitem, void *data) ECalModelComponent *comp_data; char *filename; char *ical_string; - FILE *file; - + comp_data = e_calendar_table_get_selected_comp (cal_table); if (comp_data == NULL) return; @@ -1112,16 +1111,10 @@ e_calendar_table_on_save_as (EPopup *ep, EPopupItem *pitem, void *data) g_warning ("Couldn't convert item to a string"); return; } + + e_write_file_uri (filename, ical_string); - file = g_fopen (filename, "w"); - if (file == NULL) { - g_warning ("Couldn't save item"); - return; - } - - fprintf (file, "%s", ical_string); g_free (ical_string); - fclose (file); } static void diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index ac2eb66556..c8408c647c 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -1239,9 +1239,8 @@ on_save_as (EPopup *ep, EPopupItem *pitem, void *data) GList *selected; char *filename; char *ical_string; - FILE *file; ECalendarViewEvent *event; - + selected = e_calendar_view_get_selected_events (cal_view); if (!selected) return; @@ -1256,16 +1255,9 @@ on_save_as (EPopup *ep, EPopupItem *pitem, void *data) g_warning ("Couldn't convert item to a string"); return; } - - file = g_fopen (filename, "w"); - if (file == NULL) { - g_warning ("Couldn't save item"); - return; - } - - fprintf (file, "%s", ical_string); + + e_write_file_uri (filename, ical_string); g_free (ical_string); - fclose (file); g_list_free (selected); } @@ -2138,6 +2130,7 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) default_zone = e_calendar_view_get_timezone (data->cal_view); pevent = data->get_view_event (data->cal_view, data->day, data->event_num); + client = pevent->comp_data->client; clone_comp = icalcomponent_new_clone (pevent->comp_data->icalcomp); diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index b63cde43d2..84ac373017 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -733,8 +733,7 @@ e_memo_table_on_save_as (EPopup *ep, EPopupItem *pitem, void *data) ECalModelComponent *comp_data; char *filename; char *ical_string; - FILE *file; - + comp_data = get_selected_comp (memo_table); if (comp_data == NULL) return; @@ -748,16 +747,9 @@ e_memo_table_on_save_as (EPopup *ep, EPopupItem *pitem, void *data) g_warning ("Couldn't convert item to a string"); return; } - - file = g_fopen (filename, "w"); - if (file == NULL) { - g_warning ("Couldn't save item"); - return; - } - - fprintf (file, ical_string); + + e_write_file_uri (filename, ical_string); g_free (ical_string); - fclose (file); } static void |