aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2006-08-23 15:59:00 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2006-08-23 15:59:00 +0800
commitc09e79bbf4b00ae5992456ff9e3dead1ee8efcb7 (patch)
tree18cabb8ea8d5cebadcf36dae12bf37a9a9390d98
parentf14ab0afa345a49816beb215a1b3e2042c13ec40 (diff)
downloadgsoc2013-evolution-c09e79bbf4b00ae5992456ff9e3dead1ee8efcb7.tar
gsoc2013-evolution-c09e79bbf4b00ae5992456ff9e3dead1ee8efcb7.tar.gz
gsoc2013-evolution-c09e79bbf4b00ae5992456ff9e3dead1ee8efcb7.tar.bz2
gsoc2013-evolution-c09e79bbf4b00ae5992456ff9e3dead1ee8efcb7.tar.lz
gsoc2013-evolution-c09e79bbf4b00ae5992456ff9e3dead1ee8efcb7.tar.xz
gsoc2013-evolution-c09e79bbf4b00ae5992456ff9e3dead1ee8efcb7.tar.zst
gsoc2013-evolution-c09e79bbf4b00ae5992456ff9e3dead1ee8efcb7.zip
** Fixes bug #347238
svn path=/trunk/; revision=32636
-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
-rw-r--r--widgets/misc/ChangeLog7
-rw-r--r--widgets/misc/e-attachment-bar.c11
8 files changed, 37 insertions, 11 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));
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index b0eba3ff6c..6b3ad957f8 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -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
diff --git a/widgets/misc/e-attachment-bar.c b/widgets/misc/e-attachment-bar.c
index 4b67ba21ec..708a365549 100644
--- a/widgets/misc/e-attachment-bar.c
+++ b/widgets/misc/e-attachment-bar.c
@@ -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);