[gnome-boxes/release-gnome-3-36-2: 3/10] downloads-hub: Don't do anything after a download is cancelled



commit a0d5aff4869d38db01933e39f3b09c9a428a6bb3
Author: Felipe Borges <felipeborges gnome org>
Date:   Thu Mar 26 11:48:13 2020 +0100

    downloads-hub: Don't do anything after a download is cancelled
    
    The widget is destroyed, so there's no point on us doing anything
    else after cancellation.

 src/downloads-hub.vala | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/downloads-hub.vala b/src/downloads-hub.vala
index a51a9c61..fc25f9cb 100644
--- a/src/downloads-hub.vala
+++ b/src/downloads-hub.vala
@@ -182,8 +182,10 @@ private async void download (string url, string filename) {
             return;
         }
 
-        download_complete (label.label, local_file);
-        download_status.set_visible_child (download_complete_label);
+        if (!cancellable.is_cancelled ()) {
+            download_complete (label.label, local_file);
+            download_status.set_visible_child (download_complete_label);
+        }
     }
 
     [GtkCallback]


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