aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog13
-rw-r--r--mail/em-format-html-display.c2
-rw-r--r--mail/em-popup.c3
-rw-r--r--mail/em-utils.c8
-rw-r--r--mail/em-utils.h2
-rw-r--r--mail/mail-ops.c2
6 files changed, 23 insertions, 7 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 7b7f69aa00..dffc005500 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -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
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index 6dbaa0a96c..7342cc076b 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -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;
diff --git a/mail/em-popup.c b/mail/em-popup.c
index 5d9a898237..13d85df201 100644
--- a/mail/em-popup.c
+++ b/mail/em-popup.c
@@ -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;
diff --git a/mail/em-utils.c b/mail/em-utils.c
index d59d99fc00..cdaeb67ac2 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -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);
diff --git a/mail/em-utils.h b/mail/em-utils.h
index 0b27628dcb..97b1aedfff 100644
--- a/mail/em-utils.h
+++ b/mail/em-utils.h
@@ -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);
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 5c8c97e2fd..c835c45f79 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -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));