mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-06 07:14:55 -06:00
when the archive has only one folder as its direct child, do not add filename to path by default on extraction; if not, add filename to path
This commit is contained in:
@@ -496,23 +496,30 @@ static void AddPropValueToSum(IFolderFolder *folder, UInt32 index, PROPID propID
|
||||
sum = (UInt64)(Int64)-1;
|
||||
}
|
||||
|
||||
UString CPanel::GetItemsInfoString(const CRecordVector<UInt32> &indices)
|
||||
UString CPanel::GetItemsInfoString(const CRecordVector<UInt32> &indices, int *soleDir)
|
||||
{
|
||||
UString info;
|
||||
UInt64 numDirs, numFiles, filesSize, foldersSize;
|
||||
numDirs = numFiles = filesSize = foldersSize = 0;
|
||||
|
||||
unsigned i;
|
||||
*soleDir = 0;
|
||||
for (i = 0; i < indices.Size(); i++)
|
||||
{
|
||||
const UInt32 index = indices[i];
|
||||
if (IsItem_Folder(index))
|
||||
{
|
||||
if (i == 0) {
|
||||
*soleDir = 1;
|
||||
} else {
|
||||
*soleDir = 0;
|
||||
}
|
||||
AddPropValueToSum(_folder, index, kpidSize, foldersSize);
|
||||
numDirs++;
|
||||
}
|
||||
else
|
||||
{
|
||||
*soleDir = 0;
|
||||
AddPropValueToSum(_folder, index, kpidSize, filesSize);
|
||||
numFiles++;
|
||||
}
|
||||
@@ -629,7 +636,7 @@ void CApp::OnCopy(bool move, bool copyToSame, unsigned srcPanelIndex)
|
||||
copyDialog.Value = destPath;
|
||||
LangString(move ? IDS_MOVE : IDS_COPY, copyDialog.Title);
|
||||
LangString(move ? IDS_MOVE_TO : IDS_COPY_TO, copyDialog.Static);
|
||||
copyDialog.Info = srcPanel.GetItemsInfoString(indices);
|
||||
copyDialog.Info = srcPanel.GetItemsInfoString(indices, ©Dialog.soleDir);
|
||||
copyDialog.m_currentFolderPrefix = srcPanel._currentFolderPrefix;
|
||||
|
||||
if (copyDialog.Create(srcPanel.GetParent()) != IDOK)
|
||||
|
||||
@@ -107,6 +107,9 @@ bool CCopyDialog::OnInit()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (soleDir == 0) {
|
||||
OnButtonAddFileName();
|
||||
}
|
||||
return CModalDialog::OnInit();
|
||||
}
|
||||
|
||||
@@ -265,6 +268,8 @@ void CCopyDialog::OnButtonAddFileName()
|
||||
currentPath += m_strRealFileName;
|
||||
|
||||
_path.SetText(currentPath);
|
||||
} else {
|
||||
_path.SetText(currentPath.Mid(0, n));
|
||||
}
|
||||
_path.SetFocus();
|
||||
}
|
||||
|
||||
@@ -30,7 +30,8 @@ protected:
|
||||
SIZE m_sizeMinWindow;
|
||||
|
||||
public:
|
||||
CCopyDialog(): m_bOpenOutputFolder(false), m_bDeleteSourceFile(false), m_bClose7Zip (false) { m_sizeMinWindow.cx = 0; m_sizeMinWindow.cy = 0; }
|
||||
// soleDir=2: undecided
|
||||
CCopyDialog(): soleDir(2), m_bOpenOutputFolder(false), m_bDeleteSourceFile(false), m_bClose7Zip (false) { m_sizeMinWindow.cx = 0; m_sizeMinWindow.cy = 0; }
|
||||
|
||||
UString Title;
|
||||
UString Static;
|
||||
@@ -38,6 +39,8 @@ public:
|
||||
UString Info;
|
||||
UStringVector Strings;
|
||||
|
||||
int soleDir;
|
||||
|
||||
bool m_bOpenOutputFolder;
|
||||
bool m_bDeleteSourceFile;
|
||||
bool m_bClose7Zip;
|
||||
|
||||
Reference in New Issue
Block a user