This commit is contained in:
Igor Pavlov
2018-12-30 14:01:47 +00:00
committed by Kornel
parent 18dc2b4161
commit 5b2a99c548
113 changed files with 1805 additions and 932 deletions
+1 -1
View File
@@ -468,7 +468,7 @@ static HRESULT UpdateFile(NFsFolder::CCopyStateIO &state, CFSTR inPath, CFSTR ou
{
if (NFind::DoesFileOrDirExist(outPath))
{
RINOK(SendMessageError(callback, NError::MyFormatMessage(ERROR_ALREADY_EXISTS), outPath));
RINOK(SendMessageError(callback, NError::MyFormatMessage(ERROR_ALREADY_EXISTS), FString(outPath)));
CFileInfo fi;
if (fi.Find(inPath))
{
@@ -759,11 +759,15 @@ STDMETHODIMP CExtractCallbackImp::AskWrite(
destPathResultTemp = fs2us(destPathSys);
}
else
{
if (NFind::DoesFileExist(destPathSys))
if (!NDir::DeleteFileAlways(destPathSys))
if (GetLastError() != ERROR_FILE_NOT_FOUND)
{
RINOK(MessageError("can not delete output file", destPathSys));
return E_ABORT;
}
}
}
*writeAnswer = BoolToInt(true);
return StringToBstr(destPathResultTemp, destPathResult);
@@ -213,6 +213,12 @@ void CListViewDialog::ShowItemInfo()
if (index < Values.Size())
dlg.Text = Values[index];
}
#ifdef _WIN32
if (dlg.Text.Find(L'\r') < 0)
dlg.Text.Replace(L"\n", L"\r\n");
#endif
dlg.Create(*this);
}
+3 -2
View File
@@ -879,8 +879,9 @@ void CPanel::AddToArchive()
FOR_VECTOR (i, indices)
names.Add(curPrefix + GetItemRelPath2(indices[i]));
bool fromPrev = (names.Size() > 1);
const UString arcName = CreateArchiveName(names.Front(), fromPrev, false);
const UString arcName = CreateArchiveName(names);
HRESULT res = CompressFiles(destCurDirPrefix, arcName, L"",
true, // addExtension
names, false, true, false);
+8 -5
View File
@@ -29,7 +29,7 @@ public:
CMyComPtr<IFolderOperationsExtractCallback> ExtractCallback;
CHashBundle Hash;
UString FirstFilePath;
// UString FirstFilePath;
HRESULT Result;
@@ -48,7 +48,7 @@ void CPanelCopyThread::ShowFinalResults(HWND hwnd)
if (!ResultsWereShown)
{
ResultsWereShown = true;
ShowHashResults(Hash, fs2us(FirstFilePath), hwnd);
ShowHashResults(Hash, hwnd);
}
}
@@ -100,7 +100,7 @@ HRESULT CPanelCopyThread::ProcessVirt()
else if (options->testMode)
{
CProgressMessageBoxPair &pair = GetMessagePair(false); // GetMessagePair(ExtractCallbackSpec->Hash.NumErrors != 0);
AddHashBundleRes(pair.Message, Hash, FirstFilePath);
AddHashBundleRes(pair.Message, Hash);
}
}
@@ -158,7 +158,10 @@ HRESULT CPanel::CopyTo(CCopyToOptions &options, const CRecordVector<UInt32> &ind
if (indices.Size() == 1)
extracter.FirstFilePath = GetItemRelPath(indices[0]);
{
extracter.Hash.FirstFileName = GetItemRelPath(indices[0]);
extracter.Hash.MainName = extracter.Hash.FirstFileName;
}
if (options.VirtFileSystem)
{
@@ -186,7 +189,7 @@ HRESULT CPanel::CopyTo(CCopyToOptions &options, const CRecordVector<UInt32> &ind
extracter.ExtractCallbackSpec->SetHashCalc(&extracter.Hash);
}
extracter.Hash.Init();
// extracter.Hash.Init();
UString title;
{
+8 -4
View File
@@ -147,7 +147,7 @@ class CThreadCrc: public CProgressThreadVirt
public:
CDirEnumerator Enumerator;
CHashBundle Hash;
FString FirstFilePath;
// FString FirstFilePath;
void SetStatus(const UString &s);
void AddErrorMessage(DWORD systemError, const FChar *name);
@@ -165,7 +165,7 @@ void CThreadCrc::ShowFinalResults(HWND hwnd)
if (!ResultsWereShown)
{
ResultsWereShown = true;
ShowHashResults(Hash, fs2us(FirstFilePath), hwnd);
ShowHashResults(Hash, hwnd);
}
}
@@ -193,7 +193,7 @@ void CThreadCrc::SetStatus(const UString &s2)
HRESULT CThreadCrc::ProcessVirt()
{
Hash.Init();
// Hash.Init();
CMyBuffer buf;
if (!buf.Allocate(kBufSize))
@@ -289,7 +289,7 @@ HRESULT CThreadCrc::ProcessVirt()
}
if (isFirstFile)
{
FirstFilePath = path;
Hash.FirstFileName = path;
isFirstFile = false;
}
sync.Set_FilePath(fs2us(path));
@@ -370,9 +370,13 @@ HRESULT CApp::CalculateCrc2(const UString &methodName)
methods.Add(methodName);
RINOK(t.Hash.SetMethods(EXTERNAL_CODECS_VARS_G methods));
}
FOR_VECTOR (i, indices)
t.Enumerator.FilePaths.Add(us2fs(srcPanel.GetItemRelPath(indices[i])));
if (t.Enumerator.FilePaths.Size() == 1)
t.Hash.MainName = t.Enumerator.FilePaths[0];
UString basePrefix = srcPanel.GetFsPath();
UString basePrefix2 = basePrefix;
if (basePrefix2.Back() == ':')
+4 -2
View File
@@ -940,8 +940,10 @@ void CPanel::CompressDropFiles(const UStringVector &fileNames, const UString &fo
if (IsFolderInTemp(folderPath2F))
folderPath2 = ROOT_FS_FOLDER;
}
const UString archiveName = CreateArchiveName(fileNames.Front(), (fileNames.Size() > 1), false);
CompressFiles(folderPath2, archiveName, L"",
const UString arcName = CreateArchiveName(fileNames);
CompressFiles(folderPath2, arcName, L"",
true, // addExtension
fileNames,
false, // email