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,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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user