From 432b1c4cc65c9295268c520b8d56f19ffdba7bec Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Tue, 13 Jan 2015 15:47:18 -0800 Subject: [PATCH] Fix overwrite dialog Was setting the original pathname improperly, so when attempting to add a file to a NuFX archive the "do you want to overwrite existing entry?" dialog contained gibberish. --- app/NufxArchive.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/NufxArchive.cpp b/app/NufxArchive.cpp index ef4c408..80c11bc 100644 --- a/app/NufxArchive.cpp +++ b/app/NufxArchive.cpp @@ -989,7 +989,7 @@ bool NufxArchive::AddDisk(ActionProgressDialog* pActionProgress, unsigned char* diskData = NULL; WCHAR curDir[MAX_PATH] = L"\\"; bool retVal = false; - CStringA storageNameA, origNameA; + CStringA storageNameA; LOGI("AddDisk: '%ls' (count=%d)", (LPCWSTR) pAddOpts->GetDirectory(), pAddOpts->GetFileNames().GetCount()); @@ -1051,9 +1051,8 @@ bool NufxArchive::AddDisk(ActionProgressDialog* pActionProgress, details.storageType = kBlockSize; details.access = kNuAccessUnlocked; details.extraType = pAddOpts->fpDiskImg->GetNumBlocks(); - origNameA = fileName; // narrowing conversion - storageNameA = pathProp.fStoredPathName; - details.origName = origNameA; + storageNameA = pathProp.fStoredPathName; // TODO(Unicode) + details.origName = (LPCWSTR) fileName; // pass wide string through details.storageNameMOR = storageNameA; details.fileSysID = kNuFileSysUnknown; details.fileSysInfo = PathProposal::kDefaultStoredFssep; @@ -1314,6 +1313,7 @@ NuResult NufxArchive::HandleReplaceExisting(const NuErrorStatus* pErrorStatus) ConfirmOverwriteDialog confOvwr; PathName path(pErrorStatus->pathnameUNI); + // TODO(Unicode): convert MOR to Unicode confOvwr.fExistingFile = pErrorStatus->pRecord->filenameMOR; confOvwr.fExistingFileModWhen = DateTimeToSeconds(&pErrorStatus->pRecord->recModWhen); @@ -1322,7 +1322,7 @@ NuResult NufxArchive::HandleReplaceExisting(const NuErrorStatus* pErrorStatus) PathName checkPath(confOvwr.fNewFileSource); confOvwr.fNewFileModWhen = checkPath.GetModWhen(); } else { - confOvwr.fNewFileSource = "???"; + confOvwr.fNewFileSource = L"???"; confOvwr.fNewFileModWhen = kDateNone; }