[gnome-autoar/wip/oholy/extractor-cancellable] extractor: Return when passphrase prompt was cancelled




commit cfd1550211d93ea0349023113bb5e3edffdba519
Author: Ondrej Holy <oholy redhat com>
Date:   Mon Sep 13 10:30:20 2021 +0200

    extractor: Return when passphrase prompt was cancelled
    
    Currently, a misleading error appears when the passphrase prompt in Nautilus
    is cancelled. This is because the `scanned` signal is emitted regardless the
    `cancellable` state. This happens only for archives with one file. Let's
    return immediately to prevent this problematic behavior.
    
    Fixes: https://gitlab.gnome.org/GNOME/gnome-autoar/-/issues/35

 gnome-autoar/autoar-extractor.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/gnome-autoar/autoar-extractor.c b/gnome-autoar/autoar-extractor.c
index 758f741..0c4be32 100644
--- a/gnome-autoar/autoar-extractor.c
+++ b/gnome-autoar/autoar-extractor.c
@@ -1676,6 +1676,10 @@ autoar_extractor_step_scan_toplevel (AutoarExtractor *self)
 
     if (archive_entry_is_encrypted (entry)) {
       autoar_extractor_request_passphrase (self);
+      if (g_cancellable_is_cancelled (self->cancellable)) {
+        archive_read_free (a);
+        return;
+      }
     }
 
     if (self->use_raw_format) {


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