Skip to content

Commit

Permalink
Extract archive into separate directory & Shift+F2
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Feb 19, 2016
1 parent a6e9640 commit 436afb4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 4 additions & 0 deletions plugins/arclite/changelog
@@ -1,3 +1,7 @@
drkns 19.02.2016 10:00:05 +0200 - build 229

1. ����� "Extract archive into separate directory" �� �������� ��� ���������� �� Shift+F2.

w17 17.02.2016 17:17:19 +0300 - build 228

1. � ������: ������� �����-�� ���, ��������� � ������� � sfx-��������.
Expand Down
16 changes: 13 additions & 3 deletions plugins/arclite/plugin.cpp
Expand Up @@ -177,6 +177,15 @@ class Plugin {
options.overwrite = oaOverwrite;
options.separate_dir = triFalse;
}

const auto update_dst_dir = [&]
{
if (options.separate_dir == triTrue || (options.separate_dir == triUndef && !single_item && (op_mode & OPM_TOPLEVEL)))
{
options.dst_dir = get_separate_dir_path(dst_dir, archive->arc_name());
}
};

if (show_dialog) {
if (!extract_dialog(options))
FAIL(E_ABORT);
Expand All @@ -185,16 +194,17 @@ class Plugin {
if (!is_absolute_path(options.dst_dir))
options.dst_dir = Far::get_absolute_path(options.dst_dir);
dst_dir = options.dst_dir;
if (options.separate_dir == triTrue || (options.separate_dir == triUndef && !single_item && (op_mode & OPM_TOPLEVEL))) {
options.dst_dir = get_separate_dir_path(options.dst_dir, archive->arc_name());
}
update_dst_dir();
if (!options.password.empty())
archive->password = options.password;
}
if (op_mode & OPM_TOPLEVEL)
{
if(op_mode & OPM_SILENT)
{
options = batch_options;
update_dst_dir();
}
else
batch_options = options;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/arclite/project.ini
Expand Up @@ -2,4 +2,4 @@
MODULE = arclite
VER_MAJOR = 3
VER_MINOR = 0
VER_BUILD = 228
VER_BUILD = 229

0 comments on commit 436afb4

Please sign in to comment.