aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-attachment.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2005-08-19 13:30:15 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2005-08-19 13:30:15 +0800
commitcb37c563afea6d1f7680fa845076992c749ee024 (patch)
tree920f2fc4b1e7189bc2d67e97d0ea68a970f66dfd /widgets/misc/e-attachment.c
parenteedaf1ba9d1d1846d888ce6a2b4fc6d64a97a3bc (diff)
downloadgsoc2013-evolution-cb37c563afea6d1f7680fa845076992c749ee024.tar
gsoc2013-evolution-cb37c563afea6d1f7680fa845076992c749ee024.tar.gz
gsoc2013-evolution-cb37c563afea6d1f7680fa845076992c749ee024.tar.bz2
gsoc2013-evolution-cb37c563afea6d1f7680fa845076992c749ee024.tar.lz
gsoc2013-evolution-cb37c563afea6d1f7680fa845076992c749ee024.tar.xz
gsoc2013-evolution-cb37c563afea6d1f7680fa845076992c749ee024.tar.zst
gsoc2013-evolution-cb37c563afea6d1f7680fa845076992c749ee024.zip
Use camel_url to construct url (eab_icon_clicked_cb)
2005-08-17 Srinivasa Ragavan <sragavan@novell.com> * e-attachment-bar.c eab_drag_data_get: Use camel_url to construct url (eab_icon_clicked_cb) (e_attachment_bar_new): Fixed part of bug #312224. It handles double click on a attachment icon and calls gnome_url_show. * e-attachment.[ch] (finalise) (init): Add a new member to preserve the stored location (e_attachment_new)(e_attachment_build_remote_file): Camel_url to construct urls svn path=/trunk/; revision=30160
Diffstat (limited to 'widgets/misc/e-attachment.c')
-rw-r--r--widgets/misc/e-attachment.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c
index 91f5bb8d27..54579ccfa6 100644
--- a/widgets/misc/e-attachment.c
+++ b/widgets/misc/e-attachment.c
@@ -78,6 +78,7 @@ finalise(GObject *object)
}
g_free (attachment->file_name);
+ g_free (attachment->store_uri);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -143,6 +144,7 @@ init (EAttachment *attachment)
attachment->disposition = FALSE;
attachment->sign = CAMEL_CIPHER_VALIDITY_SIGN_NONE;
attachment->encrypt = CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE;
+ attachment->store_uri = NULL;
}
GType
@@ -210,7 +212,7 @@ e_attachment_new (const char *file_name,
struct stat statbuf;
char *mime_type;
char *filename;
- char *uri;
+ CamelURL *curl;
g_return_val_if_fail (file_name != NULL, NULL);
@@ -283,8 +285,11 @@ e_attachment_new (const char *file_name,
new->handle = NULL;
new->is_available_local = TRUE;
new->file_name = filename;
- uri = g_strdup_printf("file://%s\r\n", file_name);
- g_object_set_data_full((GObject *)new, "e-drag-uri", uri, g_free);
+
+ curl = camel_url_new ("file:", NULL);
+ camel_url_set_path (curl, file_name);
+ new->store_uri = camel_url_to_string (curl, 0);
+ camel_url_free (curl);
return new;
}
@@ -411,7 +416,7 @@ e_attachment_build_remote_file (const char *file_name,
struct stat statbuf;
char *mime_type;
char *filename;
- char *uri;
+ CamelURL *curl;
g_return_if_fail (file_name != NULL);
@@ -486,9 +491,12 @@ e_attachment_build_remote_file (const char *file_name,
attachment->guessed_type = TRUE;
g_free (attachment->file_name);
attachment->file_name = g_strdup (filename);
- uri = g_strdup_printf("file://%s\r\n", file_name);
- g_object_set_data_full((GObject *)attachment, "e-drag-uri", uri, g_free);
+ curl = camel_url_new ("file:", NULL);
+ camel_url_set_path (curl, file_name);
+ attachment->store_uri = camel_url_to_string (curl, 0);
+ camel_url_free (curl);
+
}