From eef86f0804eb699c534a3499e8887ff158de7cd7 Mon Sep 17 00:00:00 2001 From: morkt Date: Thu, 17 Sep 2015 04:25:36 +0400 Subject: [PATCH] tweaked if/else branching. --- GarExtract.cs | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/GarExtract.cs b/GarExtract.cs index 93358c14..7428d4d3 100644 --- a/GarExtract.cs +++ b/GarExtract.cs @@ -60,25 +60,7 @@ namespace GARbro.GUI if (!Directory.Exists (destination)) destination = ""; var vm = ViewModel; - if (!vm.IsArchive) - { - if (!entry.IsDirectory) - { - var source = entry.Source.Name; - SetBusyState(); - if (string.IsNullOrEmpty (destination)) - { - // extract into directory named after archive - if (!string.IsNullOrEmpty (Path.GetExtension (entry.Name))) - destination = Path.GetFileNameWithoutExtension (source); - else - destination = vm.Path.First(); - } - extractor = new GarExtract (this, source); - extractor.ExtractAll (destination); - } - } - else if (vm.Path.Count > 1) + if (vm.IsArchive) { if (string.IsNullOrEmpty (destination)) destination = Path.GetDirectoryName (vm.Path.First()); @@ -89,6 +71,21 @@ namespace GARbro.GUI else extractor.Extract (entry, destination); } + else if (!entry.IsDirectory) + { + var source = entry.Source.Name; + SetBusyState(); + if (string.IsNullOrEmpty (destination)) + { + // extract into directory named after archive + if (!string.IsNullOrEmpty (Path.GetExtension (entry.Name))) + destination = Path.GetFileNameWithoutExtension (source); + else + destination = vm.Path.First(); + } + extractor = new GarExtract (this, source); + extractor.ExtractAll (destination); + } } catch (OperationCanceledException X) {