From 1ae9fa1311fddb9c86417d79ccf7c4bb407e8836 Mon Sep 17 00:00:00 2001 From: Tu Dinh <1257909+dinhngtu@users.noreply.github.com> Date: Wed, 1 Jan 2025 07:36:14 +0100 Subject: [PATCH] Always split path in CExtractDialog. 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. --- .../CPP/7zip/UI/GUI/ExtractDialog.cpp | 19 ++++++++++--------- .../CPP/7zip/UI/GUI/ExtractDialog.cpp | 17 +++++++++-------- .../CPP/7zip/UI/GUI/ExtractDialog.cpp | 17 +++++++++-------- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/NanaZip.Core/SevenZip/CPP/7zip/UI/GUI/ExtractDialog.cpp b/NanaZip.Core/SevenZip/CPP/7zip/UI/GUI/ExtractDialog.cpp index ad222b130..08107ef9c 100644 --- a/NanaZip.Core/SevenZip/CPP/7zip/UI/GUI/ExtractDialog.cpp +++ b/NanaZip.Core/SevenZip/CPP/7zip/UI/GUI/ExtractDialog.cpp @@ -192,19 +192,20 @@ bool CExtractDialog::OnInit() UString pathPrefix = DirPath; #ifndef Z7_SFX - + + // **************** NanaZip Modification Start **************** + 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); + // **************** NanaZip Modification End **************** #endif diff --git a/NanaZip.UI.Classic/SevenZip/CPP/7zip/UI/GUI/ExtractDialog.cpp b/NanaZip.UI.Classic/SevenZip/CPP/7zip/UI/GUI/ExtractDialog.cpp index 4cc73fe92..756329028 100644 --- a/NanaZip.UI.Classic/SevenZip/CPP/7zip/UI/GUI/ExtractDialog.cpp +++ b/NanaZip.UI.Classic/SevenZip/CPP/7zip/UI/GUI/ExtractDialog.cpp @@ -188,18 +188,19 @@ bool CExtractDialog::OnInit() #ifndef _SFX + // **************** NanaZip Modification Start **************** + 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); + // **************** NanaZip Modification End **************** #endif diff --git a/NanaZip.UI.Modern/SevenZip/CPP/7zip/UI/GUI/ExtractDialog.cpp b/NanaZip.UI.Modern/SevenZip/CPP/7zip/UI/GUI/ExtractDialog.cpp index 4cc73fe92..756329028 100644 --- a/NanaZip.UI.Modern/SevenZip/CPP/7zip/UI/GUI/ExtractDialog.cpp +++ b/NanaZip.UI.Modern/SevenZip/CPP/7zip/UI/GUI/ExtractDialog.cpp @@ -188,18 +188,19 @@ bool CExtractDialog::OnInit() #ifndef _SFX + // **************** NanaZip Modification Start **************** + 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); + // **************** NanaZip Modification End **************** #endif