Skip to content

Commit

Permalink
Always split path in CExtractDialog.
Browse files Browse the repository at this point in the history
Even if the archive name checkbox in CExtractDialog is not checked, NanaZip
appends the archive name to its extraction path anyway. Fix this issue by
always splitting the extraction path in NanaZip.Windows.
  • Loading branch information
dinhngtu committed Dec 30, 2024
1 parent 27f148f commit 9306816
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 28 deletions.
19 changes: 9 additions & 10 deletions NanaZip.Core/SevenZip/CPP/7zip/UI/GUI/ExtractDialog.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ExtractDialog.cpp
// ExtractDialog.cpp

#include "StdAfx.h"

Expand Down Expand Up @@ -192,17 +192,16 @@ bool CExtractDialog::OnInit()
UString pathPrefix = DirPath;

#ifndef Z7_SFX


UString pathName;
SplitPathToParts_Smart(DirPath, pathPrefix, pathName);
if (pathPrefix.IsEmpty())
pathPrefix = pathName;
else
_pathName.SetText(pathName);

if (_info.SplitDest.Val)
{
CheckButton(IDX_EXTRACT_NAME_ENABLE, true);
UString pathName;
SplitPathToParts_Smart(DirPath, pathPrefix, pathName);
if (pathPrefix.IsEmpty())
pathPrefix = pathName;
else
_pathName.SetText(pathName);
}
else
ShowItem_Bool(IDE_EXTRACT_NAME, false);

Expand Down
17 changes: 8 additions & 9 deletions NanaZip.UI.Classic/SevenZip/CPP/7zip/UI/GUI/ExtractDialog.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ExtractDialog.cpp
// ExtractDialog.cpp

#include "StdAfx.h"

Expand Down Expand Up @@ -188,16 +188,15 @@ bool CExtractDialog::OnInit()

#ifndef _SFX

UString pathName;
SplitPathToParts_Smart(DirPath, pathPrefix, pathName);
if (pathPrefix.IsEmpty())
pathPrefix = pathName;
else
_pathName.SetText(pathName);

if (_info.SplitDest.Val)
{
CheckButton(IDX_EXTRACT_NAME_ENABLE, true);
UString pathName;
SplitPathToParts_Smart(DirPath, pathPrefix, pathName);
if (pathPrefix.IsEmpty())
pathPrefix = pathName;
else
_pathName.SetText(pathName);
}
else
ShowItem_Bool(IDE_EXTRACT_NAME, false);

Expand Down
17 changes: 8 additions & 9 deletions NanaZip.UI.Modern/SevenZip/CPP/7zip/UI/GUI/ExtractDialog.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ExtractDialog.cpp
// ExtractDialog.cpp

#include "StdAfx.h"

Expand Down Expand Up @@ -188,16 +188,15 @@ bool CExtractDialog::OnInit()

#ifndef _SFX

UString pathName;
SplitPathToParts_Smart(DirPath, pathPrefix, pathName);
if (pathPrefix.IsEmpty())
pathPrefix = pathName;
else
_pathName.SetText(pathName);

if (_info.SplitDest.Val)
{
CheckButton(IDX_EXTRACT_NAME_ENABLE, true);
UString pathName;
SplitPathToParts_Smart(DirPath, pathPrefix, pathName);
if (pathPrefix.IsEmpty())
pathPrefix = pathName;
else
_pathName.SetText(pathName);
}
else
ShowItem_Bool(IDE_EXTRACT_NAME, false);

Expand Down

0 comments on commit 9306816

Please sign in to comment.