This commit is contained in:
Igor Pavlov
2011-04-11 00:00:00 +00:00
committed by Kornel Lesiński
parent de4f8c22fe
commit 35596517f2
322 changed files with 9989 additions and 7759 deletions

View File

@@ -9,19 +9,19 @@
using namespace NWindows;
static UString CreateArchiveName2(const UString &srcName, bool fromPrev, bool keepName)
static FString CreateArchiveName2(const FString &srcName, bool fromPrev, bool keepName)
{
UString resultName = L"Archive";
FString resultName = FTEXT("Archive");
if (fromPrev)
{
UString dirPrefix;
FString dirPrefix;
if (NFile::NDirectory::GetOnlyDirPrefix(srcName, dirPrefix))
{
if (dirPrefix.Length() > 0)
if (dirPrefix[dirPrefix.Length() - 1] == WCHAR_PATH_SEPARATOR)
if (dirPrefix.Back() == FCHAR_PATH_SEPARATOR)
{
dirPrefix.Delete(dirPrefix.Length() - 1);
NFile::NFind::CFileInfoW fileInfo;
dirPrefix.DeleteBack();
NFile::NFind::CFileInfo fileInfo;
if (fileInfo.Find(dirPrefix))
resultName = fileInfo.Name;
}
@@ -29,7 +29,7 @@ static UString CreateArchiveName2(const UString &srcName, bool fromPrev, bool ke
}
else
{
NFile::NFind::CFileInfoW fileInfo;
NFile::NFind::CFileInfo fileInfo;
if (!fileInfo.Find(srcName))
// return resultName;
return srcName;
@@ -39,8 +39,8 @@ static UString CreateArchiveName2(const UString &srcName, bool fromPrev, bool ke
int dotPos = resultName.ReverseFind('.');
if (dotPos > 0)
{
UString archiveName2 = resultName.Left(dotPos);
if (archiveName2.ReverseFind('.') < 0)
FString archiveName2 = resultName.Left(dotPos);
if (archiveName2.ReverseFind(FTEXT('.')) < 0)
resultName = archiveName2;
}
}
@@ -50,5 +50,5 @@ static UString CreateArchiveName2(const UString &srcName, bool fromPrev, bool ke
UString CreateArchiveName(const UString &srcName, bool fromPrev, bool keepName)
{
return GetCorrectFsPath(CreateArchiveName2(srcName, fromPrev, keepName));
return GetCorrectFsPath(fs2us(CreateArchiveName2(us2fs(srcName), fromPrev, keepName)));
}