[evolution] EHMsgComposer - Remove an unnecessary code duplication



commit 30ff3062855e92ddadc85c00bfebcb6707b94690
Author: Tomas Popela <tpopela redhat com>
Date:   Mon May 2 10:26:59 2016 +0200

    EHMsgComposer - Remove an unnecessary code duplication

 composer/e-msg-composer.c |   28 +++-------------------------
 1 files changed, 3 insertions(+), 25 deletions(-)
---
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 2f5fcfa..b7e1fe6 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -2240,31 +2240,9 @@ msg_composer_drag_data_received_cb (GtkWidget *widget,
        /* If we're receiving URIs and -all- the URIs point to
         * image files, we want the image(s) to be inserted in
         * the message body. */
-       if (html_mode && e_composer_selection_is_image_uris (composer, selection)) {
-               const guchar *data;
-               gint length;
-               gint list_len, len;
-               gchar *uri;
-
-               data = gtk_selection_data_get_data (selection);
-               length = gtk_selection_data_get_length (selection);
-
-               if (!data || length < 0) {
-                       gtk_drag_finish (context, FALSE, FALSE, time);
-                       return;
-               }
-
-               e_html_editor_selection_set_on_point (editor_selection, x, y);
-
-               list_len = length;
-               do {
-                       uri = next_uri ((guchar **) &data, &len, &list_len);
-                       e_html_editor_selection_insert_image (editor_selection, uri);
-                       g_free (uri);
-               } while (list_len);
-
-               gtk_drag_finish (context, TRUE, FALSE, time);
-       } else if (html_mode && e_composer_selection_is_base64_uris (composer, selection)) {
+       if (html_mode &&
+           (e_composer_selection_is_image_uris (composer, selection) ||
+            e_composer_selection_is_base64_uris (composer, selection))) {
                const guchar *data;
                gint length;
                gint list_len, len;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]