mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 03:44:13 +08:00
tweaked if/else branching.
This commit is contained in:
parent
4a7678c3cd
commit
eef86f0804
@ -60,9 +60,18 @@ namespace GARbro.GUI
|
||||
if (!Directory.Exists (destination))
|
||||
destination = "";
|
||||
var vm = ViewModel;
|
||||
if (!vm.IsArchive)
|
||||
if (vm.IsArchive)
|
||||
{
|
||||
if (!entry.IsDirectory)
|
||||
if (string.IsNullOrEmpty (destination))
|
||||
destination = Path.GetDirectoryName (vm.Path.First());
|
||||
var archive_name = vm.Path[vm.Path.Count-2];
|
||||
extractor = new GarExtract (this, archive_name, VFS.Top as ArchiveFileSystem);
|
||||
if (null == entry || (entry.Name == ".." && string.IsNullOrEmpty (vm.Path.Last()))) // root entry
|
||||
extractor.ExtractAll (destination);
|
||||
else
|
||||
extractor.Extract (entry, destination);
|
||||
}
|
||||
else if (!entry.IsDirectory)
|
||||
{
|
||||
var source = entry.Source.Name;
|
||||
SetBusyState();
|
||||
@ -78,18 +87,6 @@ namespace GARbro.GUI
|
||||
extractor.ExtractAll (destination);
|
||||
}
|
||||
}
|
||||
else if (vm.Path.Count > 1)
|
||||
{
|
||||
if (string.IsNullOrEmpty (destination))
|
||||
destination = Path.GetDirectoryName (vm.Path.First());
|
||||
var archive_name = vm.Path[vm.Path.Count-2];
|
||||
extractor = new GarExtract (this, archive_name, VFS.Top as ArchiveFileSystem);
|
||||
if (null == entry || (entry.Name == ".." && string.IsNullOrEmpty (vm.Path.Last()))) // root entry
|
||||
extractor.ExtractAll (destination);
|
||||
else
|
||||
extractor.Extract (entry, destination);
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException X)
|
||||
{
|
||||
SetStatusText (X.Message);
|
||||
|
Loading…
x
Reference in New Issue
Block a user