2007-11-22 [paul] 3.1.0cvs16
authorPaul Mangan <paul@claws-mail.org>
Thu, 22 Nov 2007 09:06:13 +0000 (09:06 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 22 Nov 2007 09:06:13 +0000 (09:06 +0000)
* src/compose.c
fix bug 1400, 'Drag and drop of URLs does not work'
Thanks to Colin

ChangeLog
PATCHSETS
configure.ac
src/compose.c

index d75c477..90b6985 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-11-22 [paul]      3.1.0cvs16
+
+       * src/compose.c
+               fix bug 1400, 'Drag and drop of URLs does not work'
+               Thanks to Colin
+
 2007-11-22 [paul]      3.1.0cvs15
 
        * src/prefs_common.c
index a8f9b6b..8916cbc 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.94.2.163 -r 1.94.2.164 src/messageview.c;  cvs diff -u -r 1.49.2.102 -r 1.49.2.103 src/procmime.c;  cvs diff -u -r 1.60.2.49 -r 1.60.2.50 src/procmsg.h;  ) > 3.1.0cvs13.patchset
 ( cvs diff -u -r 1.382.2.425 -r 1.382.2.426 src/compose.c;  cvs diff -u -r 1.23.2.27 -r 1.23.2.28 src/crash.c;  cvs diff -u -r 1.3.2.22 -r 1.3.2.23 src/exphtmldlg.c;  cvs diff -u -r 1.274.2.221 -r 1.274.2.222 src/mainwindow.c;  cvs diff -u -r 1.11.2.13 -r 1.11.2.14 src/manual.c;  cvs diff -u -r 1.83.2.123 -r 1.83.2.124 src/mimeview.c;  cvs diff -u -r 1.105.2.116 -r 1.105.2.117 src/prefs_account.c;  cvs diff -u -r 1.204.2.152 -r 1.204.2.153 src/prefs_common.c;  cvs diff -u -r 1.103.2.98 -r 1.103.2.99 src/prefs_common.h;  cvs diff -u -r 1.3.2.18 -r 1.3.2.19 src/prefs_ext_prog.c;  cvs diff -u -r 1.96.2.192 -r 1.96.2.193 src/textview.c;  cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/uri_opener.c;  cvs diff -u -r 1.4.2.56 -r 1.4.2.57 src/gtk/about.c;  cvs diff -u -r 1.5.2.72 -r 1.5.2.73 src/gtk/gtkutils.c;  ) > 3.1.0cvs14.patchset
 ( cvs diff -u -r 1.204.2.153 -r 1.204.2.154 src/prefs_common.c;  cvs diff -u -r 1.395.2.337 -r 1.395.2.338 src/summaryview.c;  ) > 3.1.0cvs15.patchset
+( cvs diff -u -r 1.382.2.426 -r 1.382.2.427 src/compose.c;  ) > 3.1.0cvs16.patchset
index 53b1318..54a83aa 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=1
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=15
+EXTRA_VERSION=16
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index e22707e..29993a0 100644 (file)
@@ -9684,6 +9684,21 @@ static void compose_insert_drag_received_cb (GtkWidget           *widget,
        if (gdk_atom_name(data->type) && !strcmp(gdk_atom_name(data->type), "text/uri-list")) {
                AlertValue val = G_ALERTDEFAULT;
 
+               list = uri_list_extract_filenames((const gchar *)data->data);
+
+               if (list == NULL && strstr((gchar *)(data->data), "://")) {
+                       /* Assume a list of no files, and data has ://, is a remote link */
+                       gchar *tmpdata = g_strstrip(g_strdup((const gchar *)data->data));
+                       gchar *tmpfile = get_tmp_file();
+                       str_write_to_file(tmpdata, tmpfile);
+                       g_free(tmpdata);  
+                       compose_insert_file(compose, tmpfile);
+                       g_unlink(tmpfile);
+                       g_free(tmpfile);
+                       gtk_drag_finish(drag_context, TRUE, FALSE, time);
+                       compose_beautify_paragraph(compose, NULL, TRUE);
+                       return;
+               }
                switch (prefs_common.compose_dnd_mode) {
                        case COMPOSE_DND_ASK:
                                val = alertpanel_full(_("Insert or attach?"),
@@ -9714,12 +9729,16 @@ static void compose_insert_drag_received_cb (GtkWidget          *widget,
 
                if (val == G_ALERTDEFAULT || val == G_ALERTCANCEL) {
                        gtk_drag_finish(drag_context, FALSE, FALSE, time);
+                       list_free_strings(list);
+                       g_list_free(list);
                        return;
                } else if (val == G_ALERTOTHER) {
                        compose_attach_drag_received_cb(widget, drag_context, x, y, data, info, time, user_data);
+                       list_free_strings(list);
+                       g_list_free(list);
                        return;
                } 
-               list = uri_list_extract_filenames((const gchar *)data->data);
+
                for (tmp = list; tmp != NULL; tmp = tmp->next) {
                        compose_insert_file(compose, (const gchar *)tmp->data);
                }