This commit is contained in:
Igor Pavlov
2010-03-15 00:00:00 +00:00
committed by Kornel Lesiński
parent db5eb6d638
commit 993daef9cb
74 changed files with 5177 additions and 1736 deletions

View File

@@ -55,8 +55,9 @@ static HRESULT DecompressArchive(
UString outDir = options.OutputDir;
outDir.Replace(L"*", GetCorrectFsPath(arc.DefaultName));
#ifdef _WIN32
outDir.TrimRight();
outDir = GetCorrectFullFsPath(outDir);
// GetCorrectFullFsPath doesn't like "..".
// outDir.TrimRight();
// outDir = GetCorrectFullFsPath(outDir);
#endif
if (!outDir.IsEmpty())

View File

@@ -590,9 +590,14 @@ HRESULT ListArchives(CCodecs *codecs, const CIntVector &formatIndices,
{
if (archiveLink.VolumePaths.Size() != 0)
arcPackSize += archiveLink.VolumesSize;
totalPackSize = arcPackSize;
totalPackSize = (numFiles == 0) ? 0 : arcPackSize;
totalPackSizePointer = &totalPackSize;
}
if (totalUnPackSizePointer == 0 && numFiles == 0)
{
totalUnPackSize = 0;
totalUnPackSizePointer = &totalUnPackSize;
}
if (enableHeaders && !techMode)
{
fieldPrinter.PrintTitleLines();

View File

@@ -118,6 +118,12 @@ STDMETHODIMP CExtractCallBackImp::MessageError(const wchar_t *message)
return S_OK;
}
static void ReduceString(UString &s, int size)
{
if (s.Length() > size)
s = s.Left(size / 2) + UString(L" ... ") + s.Right(size / 2);
}
STDMETHODIMP CExtractCallBackImp::SetOperationResult(Int32 operationResult, bool encrypted)
{
switch(operationResult)
@@ -145,10 +151,11 @@ STDMETHODIMP CExtractCallBackImp::SetOperationResult(Int32 operationResult, bool
default:
return E_FAIL;
}
char buffer[512];
const AString s = UnicodeStringToMultiByte(m_CurrentFilePath, m_CodePage);
sprintf(buffer, g_StartupInfo.GetMsgString(idMessage), (const char *)s);
if (g_StartupInfo.ShowMessage(buffer) == -1)
UString name = m_CurrentFilePath;
ReduceString(name, 70);
AString s = g_StartupInfo.GetMsgString(idMessage);
s.Replace(" '%s'", "");
if (g_StartupInfo.ShowMessageLines(s + (AString)("\n") + UnicodeStringToMultiByte(name, m_CodePage)) == -1)
return E_ABORT;
}
}

View File

@@ -29,6 +29,16 @@ struct CVolSeqName
UString ChangedPart;
CVolSeqName(): ChangedPart(L"000") {};
void SetNumDigits(UInt64 numVolumes)
{
ChangedPart = L"000";
while (numVolumes > 999)
{
numVolumes /= 10;
ChangedPart += L'0';
}
}
bool ParseName(const UString &name)
{
if (name.Right(2) != L"01")
@@ -81,6 +91,7 @@ class CThreadSplit: public CProgressThreadVirt
public:
UString FilePath;
UString VolBasePath;
UInt64 NumVolumes;
CRecordVector<UInt64> VolumeSizes;
};
@@ -96,6 +107,7 @@ HRESULT CThreadSplit::ProcessVirt()
Byte *buffer = (Byte *)(void *)bufferObject;
UInt64 curVolSize = 0;
CVolSeqName seqName;
seqName.SetNumDigits(NumVolumes);
UInt64 length;
if (!inFile.GetLength(length))
return GetLastError();
@@ -226,6 +238,7 @@ void CApp::Split()
{
CThreadSplit spliter;
spliter.NumVolumes = numVolumes;
CProgressDialog &progressDialog = spliter.ProgressDialog;
@@ -241,7 +254,7 @@ void CApp::Split()
spliter.FilePath = srcPath + itemName;
spliter.VolBasePath = path + itemName;
spliter.VolBasePath = path + itemName;
spliter.VolumeSizes = splitDialog.VolumeSizes;
// if (splitDialog.VolumeSizes.Size() == 0) return;