From 103f8caae5d963f2360245ea740a427411b81e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sat, 6 Jan 2018 07:54:57 +0100 Subject: [PATCH] Add cancellation support to CompressedArchive (unarr). This will let threads end quickly when a comic opening is interrupted. --- compressed_archive/unarr/compressed_archive.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compressed_archive/unarr/compressed_archive.cpp b/compressed_archive/unarr/compressed_archive.cpp index e03ac8ef..d9bfe53f 100644 --- a/compressed_archive/unarr/compressed_archive.cpp +++ b/compressed_archive/unarr/compressed_archive.cpp @@ -93,6 +93,11 @@ void CompressedArchive::getAllData(const QVector & indexes, ExtractDele int i=0; while (i < indexes.count()) { + if(delegate->isCancelled()) + { + return; + } + //use the offset list so we generated so we're not getting any non-page files ar_parse_entry_at(ar, offsets.at(indexes.at(i))); //set ar_entry to start of indexes buffer.resize(ar_entry_get_size(ar));