aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-chat-window.c
diff options
context:
space:
mode:
authorShaun McCance <Shaun McCance>2009-10-06 03:22:32 +0800
committerShaun McCance <shaunm@gnome.org>2009-11-25 05:14:51 +0800
commitf167ec2d92a526d19f1faf8320d9ff975ae1e502 (patch)
tree3c2c3888e3a77efd8d23a9a0a909f7608cacd33e /src/empathy-chat-window.c
parentcfb4283d66005aa2f12b15ce0d5aefde965d815a (diff)
downloadgsoc2013-empathy-f167ec2d92a526d19f1faf8320d9ff975ae1e502.tar
gsoc2013-empathy-f167ec2d92a526d19f1faf8320d9ff975ae1e502.tar.gz
gsoc2013-empathy-f167ec2d92a526d19f1faf8320d9ff975ae1e502.tar.bz2
gsoc2013-empathy-f167ec2d92a526d19f1faf8320d9ff975ae1e502.tar.lz
gsoc2013-empathy-f167ec2d92a526d19f1faf8320d9ff975ae1e502.tar.xz
gsoc2013-empathy-f167ec2d92a526d19f1faf8320d9ff975ae1e502.tar.zst
gsoc2013-empathy-f167ec2d92a526d19f1faf8320d9ff975ae1e502.zip
Utilitiy function to send files from a URI list, for dnd implementations
Diffstat (limited to 'src/empathy-chat-window.c')
-rw-r--r--src/empathy-chat-window.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index a58d4f65c..2c6acf75e 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -1438,9 +1438,6 @@ chat_window_drag_data_received (GtkWidget *widget,
EmpathyChatWindowPriv *priv;
EmpathyContact *contact;
const gchar *data;
- const gchar *nl;
- gchar *uri;
- GFile *file;
priv = GET_PRIV (window);
contact = empathy_chat_get_remote_contact (priv->current_chat);
@@ -1450,29 +1447,9 @@ chat_window_drag_data_received (GtkWidget *widget,
return;
}
- /* Only handle a single file for new. It would be wicked cool to be
- able to do multiple files, offering to zip them or whatever like
- nautilus-sendto does. Note that text/uri-list is defined to have
- each line terminated by \r\n, but we can be tolerant of applications
- that only use \n or don't terminate single-line entries.
- */
- data = (const gchar*) gtk_selection_data_get_data (selection);
- nl = strstr (data, "\r\n");
- if (!nl) {
- nl = strchr (data, '\n');
- }
- if (nl) {
- uri = g_strndup (data, nl - data);
- file = g_file_new_for_uri (uri);
- g_free (uri);
- }
- else {
- file = g_file_new_for_uri (data);
- }
-
- empathy_send_file (contact, file);
+ data = (const gchar *) gtk_selection_data_get_data (selection);
+ empathy_send_file_from_uri_list (contact, data);
- g_object_unref (file);
gtk_drag_finish (context, TRUE, FALSE, time);
}
else if (info == DND_DRAG_TYPE_TAB) {