svn path=/trunk/; revision=32636
This commit is contained in:
Srinivasa Ragavan
2006-08-23 07:59:00 +00:00
parent f14ab0afa3
commit c09e79bbf4
8 changed files with 37 additions and 11 deletions
+13
View File
@@ -1,3 +1,16 @@
2006-08-02 Ushveen Kaur <kushveen@novell.com>
** Fixes bug #347238
* em-utils.h : Added a boolean variable to determine the readonly mode
* em-utils.c (em_utils_temp_save_part) : Save in readonly mode or not.
* em-popup.c (emp_apps_open_in) : set Read only for "open in"
attachments.
* em-format-html-display.c (efhd_drag_data_get) : Set 644 for dnd
attachments.
* mail-ops.c (save_part_save): File permissions changed to 644
while saving the attachment and drag and drop.
2006-08-22 Srinivasa Ragavan <sragavan@novell.com>
** Fix for bug #350337
+1 -1
View File
@@ -1566,7 +1566,7 @@ efhd_drag_data_get(GtkWidget *w, GdkDragContext *drag, GtkSelectionData *data, g
return;
}
path = em_utils_temp_save_part(w, part);
path = em_utils_temp_save_part(w, part, FALSE);
if (path == NULL)
return;
+2 -1
View File
@@ -633,6 +633,7 @@ static EPopupItem emp_standard_uri_popups[] = {
static void
emp_apps_open_in(EPopup *ep, EPopupItem *item, void *data)
{
printf("in emp_apps_open_in\n");
char *path;
EPopupTarget *target = ep->target;
CamelMimePart *part;
@@ -642,7 +643,7 @@ emp_apps_open_in(EPopup *ep, EPopupItem *item, void *data)
else
part = ((EMPopupTargetPart *) target)->part;
path = em_utils_temp_save_part(target->widget, part);
path = em_utils_temp_save_part(target->widget, part, TRUE);
if (path) {
GnomeVFSMimeApplication *app = item->user_data;
char *uri;
+5 -3
View File
@@ -1311,7 +1311,7 @@ emu_save_part_done(CamelMimePart *part, char *name, int done, void *data)
* Return value: NULL if anything failed.
**/
char *
em_utils_temp_save_part(GtkWidget *parent, CamelMimePart *part)
em_utils_temp_save_part(GtkWidget *parent, CamelMimePart *part, gboolean mode)
{
const char *filename;
char *tmpdir, *path, *utf8_mfilename = NULL, *mfilename = NULL;
@@ -1340,8 +1340,10 @@ em_utils_temp_save_part(GtkWidget *parent, CamelMimePart *part)
g_free(mfilename);
/* FIXME: This doesn't handle default charsets */
mail_msg_wait(mail_save_part(part, path, emu_save_part_done, &done, TRUE));
if (mode)
mail_msg_wait(mail_save_part(part, path, emu_save_part_done, &done, TRUE));
else
mail_msg_wait(mail_save_part(part, path, emu_save_part_done, &done, FALSE));
if (!done) {
/* mail_save_part should popup an error box automagically */
g_free(path);
+1 -1
View File
@@ -76,7 +76,7 @@ void em_utils_selection_get_uidlist(struct _GtkSelectionData *data, struct _Came
void em_utils_selection_set_urilist(struct _GtkSelectionData *data, struct _CamelFolder *folder, GPtrArray *uids);
void em_utils_selection_get_urilist(struct _GtkSelectionData *data, struct _CamelFolder *folder);
char *em_utils_temp_save_part(struct _GtkWidget *parent, struct _CamelMimePart *part);
char *em_utils_temp_save_part(struct _GtkWidget *parent, struct _CamelMimePart *part, gboolean mode);
void em_utils_save_parts (struct _GtkWidget *parent, const char *prompt, GSList * parts);
gboolean em_utils_folder_is_drafts(struct _CamelFolder *folder, const char *uri);
+1 -1
View File
@@ -2093,7 +2093,7 @@ save_part_save (struct _mail_msg *mm)
CamelStream *stream;
if(!m->readonly){
if (!(stream = camel_stream_vfs_new_with_uri (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0666))) {
if (!(stream = camel_stream_vfs_new_with_uri (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0644))) {
camel_exception_setv (&mm->ex, CAMEL_EXCEPTION_SYSTEM,
_("Cannot create output file: %s:\n %s"),
m->path, g_strerror (errno));
+7
View File
@@ -1,3 +1,10 @@
2006-08-07 Ushveen Kaur <kushveen@novell.com>
** Fix for bug #347238
* e-attachment-bar.c: Changed the file permission changed to 644
while saving the attachment.
2006-08-21 Li Yuan <li.yuan@sun.com>
** Fixes bug #348753
+7 -4
View File
@@ -705,7 +705,7 @@ destroy (GtkObject *object)
}
static char *
temp_save_part (CamelMimePart *part)
temp_save_part (CamelMimePart *part, gboolean readonly)
{
const char *filename;
char *tmpdir, *path, *mfilename = NULL, *utf8_mfilename = NULL;
@@ -731,7 +731,10 @@ temp_save_part (CamelMimePart *part)
g_free (mfilename);
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
stream = camel_stream_fs_new_with_name (path, O_RDWR|O_CREAT|O_TRUNC, 0600);
if (readonly)
stream = camel_stream_fs_new_with_name (path, O_RDWR|O_CREAT|O_TRUNC, 0444);
else
stream = camel_stream_fs_new_with_name (path, O_RDWR|O_CREAT|O_TRUNC, 0644);
if (!stream) {
/* TODO handle error conditions */
@@ -787,7 +790,7 @@ eab_drag_data_get(EAttachmentBar *bar, GdkDragContext *drag, GtkSelectionData *d
}
/* If we are not able to save, ignore it */
if (!(path = temp_save_part (attachment->body)))
if (!(path = temp_save_part (attachment->body, FALSE)))
continue;
url = camel_url_new ("file://", NULL);
@@ -902,7 +905,7 @@ eab_icon_clicked_cb (EAttachmentBar *bar, GdkEvent *event, gpointer *dummy)
/* Check if the file is stored already */
if (!attachment->store_uri) {
path = temp_save_part (attachment->body);
path = temp_save_part (attachment->body, TRUE);
url = camel_url_new ("file://", NULL);
camel_url_set_path (url, path);
attachment->store_uri = camel_url_to_string (url, 0);