[geary/wip/728002-webkit2: 93/96] Fix not being able to save some inline images.



commit 4b096124d1ad055e760652fd69f447ea59f1dc29
Author: Michael James Gratton <mike vee net>
Date:   Mon Jan 9 16:03:39 2017 +1100

    Fix not being able to save some inline images.
    
    * src/client/conversation-viewer/conversation-message.vala
      (ConversationMessage::on_resource_load_started): Always store loaded
      resources for saving, not only if they have internal URLs.

 .../conversation-viewer/conversation-message.vala  |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-message.vala 
b/src/client/conversation-viewer/conversation-message.vala
index c5590cd..9758abf 100644
--- a/src/client/conversation-viewer/conversation-message.vala
+++ b/src/client/conversation-viewer/conversation-message.vala
@@ -817,19 +817,22 @@ public class ConversationMessage : Gtk.Grid {
     private void on_resource_load_started(WebKit.WebView view,
                                           WebKit.WebResource res,
                                           WebKit.URIRequest req) {
+        // Cache the resource to allow images to be saved
+        this.resources[res.get_uri()] = res;
+
         // We only want to show the body loading progress meter if we
-        // are loading images, so do it here rather than
-        // on_load_changed.
+        // are actually loading some images, so do it here rather than
+        // in on_load_changed.
         if (this.is_loading_images &&
             !res.get_uri().has_prefix(ClientWebView.INTERNAL_URL_PREFIX)) {
             this.body_progress.show();
             this.body_progress.pulse();
             if (!this.web_view.is_loading) {
                 // The initial page load has finished, so we must be
-                // loading a remote image, but can't rely on the
-                // load_changed signal to stop the timer or
-                // estimated-load-progress changing. So manually
-                // manage it here.
+                // loading a remote image afterwards at the user's
+                // request. We can't rely on the load_changed signal
+                // to stop the timer or estimated-load-progress
+                // changing, so manually manage it here.
                 this.remote_resources_requested++;
                 res.finished.connect(() => {
                         this.remote_resources_loaded++;
@@ -844,7 +847,6 @@ public class ConversationMessage : Gtk.Grid {
                         }
                     });
             }
-            this.resources[res.get_uri()] = res;
         }
     }
 


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