summaryrefslogtreecommitdiff
path: root/UCore.pas
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2008-06-07 20:40:48 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2008-06-07 20:40:48 +0200
commita0f1e0e9db4b0edee45018c47a08761916af0ce6 (patch)
treedc9d05f5772442f61ec913631540b24cf67d5e8a /UCore.pas
parentecde167da74c86bc047aaf84c5e548cf65a5da98 (diff)
downloadtuxcmd-a0f1e0e9db4b0edee45018c47a08761916af0ce6.tar.xz
Revised UTF-8 filenames supportv0.6.38
Diffstat (limited to 'UCore.pas')
-rw-r--r--UCore.pas266
1 files changed, 134 insertions, 132 deletions
diff --git a/UCore.pas b/UCore.pas
index 694d249..9464460 100644
--- a/UCore.pas
+++ b/UCore.pas
@@ -158,6 +158,7 @@ procedure GetDirSize(AListView: TGTKListView; Engine: TPanelEngine; DataList: TL
type TMounterItem = class
public
+ // Strings are in locale encoding (ANSI)
DisplayText, MountPath, Device, IconPath, MountCommand, UmountCommand: string;
DeviceType: integer;
function Mounted: boolean;
@@ -238,7 +239,8 @@ begin
with Data^ do begin
UpDir := True;
IsDotFile := False;
- AName := nil;
+ FName := nil;
+ FDisplayName := nil;
LnkPointTo := nil;
Selected := False;
IsLnk := False;
@@ -304,10 +306,10 @@ begin
if i + Ord(not IsRoot) > ItemCount - 1
then ListItem := ListView.Items.Add
else ListItem := ListView.Items[i + Ord(not IsRoot)];
- s := String(AName);
+ s := String(FDisplayName);
Ext := '';
if not IsDir then SeparateExt(s, s, Ext);
- Ext := ANSIToUTF8(Ext);
+// Ext := ANSIToUTF8(Ext);
// Fill the column data
for j := 1 to ConstNumPanelColumns do
@@ -315,20 +317,20 @@ begin
case ConfColumnIDs[j] of
1: begin
if IsDir and (not ConfDisableDirectoryBrackets)
- then s2 := ANSIToUTF8(Format('[%s]', [s]))
- else s2 := ANSIToUTF8(s);
+ then s2 := Format('[%s]', [s])
+ else s2 := s;
ColumnData[ConfColumnIDs[j] - 1] := strdup(PChar(s2));
end;
2: begin
if IsDir and (not ConfDisableDirectoryBrackets)
- then s2 := ANSIToUTF8(Format('[%s]', [AName]))
- else s2 := ANSIToUTF8(AName);
+ then s2 := Format('[%s]', [FDisplayName])
+ else s2 := FDisplayName;
ColumnData[ConfColumnIDs[j] - 1] := strdup(PChar(s2));
end;
3: ColumnData[ConfColumnIDs[j] - 1] := strdup(PChar(Ext));
4: begin
if IsDir then s2 := LANGDIR
- else s2 := ANSIToUTF8(FormatSize(Size, 0));
+ else s2 := FormatSize(Size, 0);
ColumnData[ConfColumnIDs[j] - 1] := strdup(PChar(s2));
end;
5: begin
@@ -346,14 +348,14 @@ begin
8: begin
if ConfShowTextUIDs then begin
if not Assigned(UsrManager) then UsrManager := TUserManager.Create;
- s2 := AnsiToUTF8(UsrManager.GetUserName(UID, False));
+ s2 := UsrManager.GetUserName(UID, False);
end else s2 := IntToStr(UID);
ColumnData[ConfColumnIDs[j] - 1] := strdup(PChar(s2));
end;
9: begin
if ConfShowTextUIDs then begin
if not Assigned(UsrManager) then UsrManager := TUserManager.Create;
- s2 := AnsiToUTF8(UsrManager.GetGroupName(GID, False));
+ s2 := UsrManager.GetGroupName(GID, False);
end else s2 := IntToStr(GID);
ColumnData[ConfColumnIDs[j] - 1] := strdup(PChar(s2));
end;
@@ -451,7 +453,7 @@ begin
try
Error := Engine.MakeDir(IncludeTrailingPathDelimiter(Engine.Path) + NewDir);
if Error <> 0 then begin
- Application.MessageBox(Format(LANGErrorCreatingNewDirectorySInSPanel, [NewDir, LANGPanelStrings[LeftPanel], ANSIToUTF8(GetErrorString(Error))]), [mbOK], mbError, mbNone, mbOK);
+ Application.MessageBox(Format(LANGErrorCreatingNewDirectorySInSPanel, [StrToUTF8(NewDir), LANGPanelStrings[LeftPanel], GetErrorString(Error)]), [mbOK], mbError, mbNone, mbOK);
Exit;
end;
Result := True;
@@ -473,13 +475,13 @@ var SkipAll: boolean;
Result := True;
// DebugMsg(['Debug: IsDir: ', AFileRec^.IsDir, ', Stage1: ', AFileRec^.Stage1, ', IsLnk: ', AFileRec^.IsLnk, '; Result = ', AFileRec^.IsDir and AFileRec^.Stage1 and (not AFileRec^.IsLnk)]);
if AFileRec^.IsDir and AFileRec^.Stage1 and (not AFileRec^.IsLnk) then Exit;
- Res := SenderThread.Engine.Remove(String(AFileRec^.AName));
+ Res := SenderThread.Engine.Remove(String(AFileRec^.FName));
// DebugMsg(['Result : ', Res]);
if Res <> 0 then
if SkipAll then Result := True else
begin
- Response := SenderThread.ShowDirDeleteDialog(1, LANGTheFileDirectory, ANSIToUTF8(String(AFileRec^.AName)),
- Format(LANGCouldNotBeDeletedS, [ANSIToUTF8(GetErrorString(Res))]));
+ Response := SenderThread.ShowDirDeleteDialog(1, LANGTheFileDirectory, String(AFileRec^.FDisplayName),
+ Format(LANGCouldNotBeDeletedS, [GetErrorString(Res)]));
case Response of
1 : Result := True;
3 : begin
@@ -510,13 +512,13 @@ begin
with PDataItem(DataList[i])^ do
if (not UpDir) and Selected then
if IsDir and (not IsLnk)
- then Engine.FillDirFiles(CurrPath + String(AName), AList, 1)
- else AList.Add(Engine.GetFileInfoSL(CurrPath + String(AName)));
+ then Engine.FillDirFiles(CurrPath + String(FName), AList, 1)
+ else AList.Add(Engine.GetFileInfoSL(CurrPath + String(FName)));
if (AList.Count = 0) and Assigned(SelectedItem) and (not SelectedItem^.UpDir) then
with SelectedItem^ do
if IsDir and (not IsLnk)
- then Engine.FillDirFiles(CurrPath + String(AName), AList, 1)
- else AList.Add(Engine.GetFileInfoSL(CurrPath + String(AName)));
+ then Engine.FillDirFiles(CurrPath + String(FName), AList, 1)
+ else AList.Add(Engine.GetFileInfoSL(CurrPath + String(FName)));
if Engine.ChangeDir(CurrPath, False) <> 0 then DebugMsg(['*** WARNING: Cannot change to the origin location, strange behaviour might occur.']);
Engine.ExplicitChDir('/');
@@ -544,7 +546,7 @@ begin
if (not DeleteAll) and (PDataItemSL(AList[i])^.Level = 1) and PDataItemSL(AList[i])^.Stage1 and PDataItemSL(AList[i])^.IsDir and
(not PDataItemSL(AList[i])^.IsLnk) and (i < AList.Count - 2) and (PDataItemSL(AList[i + 1])^.Level = 2) then
begin
- Response := ShowDirDeleteDialog(4, Format(LANGTheDirectorySIsNotEmpty, [ANSIToUTF8(string(PDataItemSL(AList[i])^.AName))]),
+ Response := ShowDirDeleteDialog(4, Format(LANGTheDirectorySIsNotEmpty, [string(PDataItemSL(AList[i])^.FDisplayName)]),
LANGDoYouWantToDeleteItWithAllItsFilesAndSubdirectories);
case Response of
1 : ; // Do nothing in this case - I will not bother with changing the structure; it works :-)
@@ -556,7 +558,7 @@ begin
// Process delete
if not HandleDelete(AList[i]) then Break;
UpdateProgress1(i, Format('%d%%', [Round(Fr * i)]));
- UpdateCaption1(ANSIToUTF8(PDataItemSL(AList[i])^.AName));
+ UpdateCaption1(PDataItemSL(AList[i])^.FDisplayName);
CommitGUIUpdate;
end;
@@ -618,9 +620,9 @@ end;
end;
if ParamBool1 then s2 := LANGCopyError
else s2 := LANGMoveError;
- if ErrorType <> 1 then s3 := ANSIToUTF8(FileName)
+ if ErrorType <> 1 then s3 := StrToUTF8(FileName)
else s3 := '';
- case ShowDirDeleteDialog(3, s, s3, ANSIToUTF8(GetErrorString(ErrorNum)), s2) of
+ case ShowDirDeleteDialog(3, s, s3, GetErrorString(ErrorNum), s2) of
0 : begin // Cancel button
Result := False;
CancelIt;
@@ -754,7 +756,7 @@ var DefResponse: integer; // Global variables for this function
function IsOnSameFS(SrcPath, DestPath: string): boolean;
begin
- DebugMsg(['### IsOnSameFS: "', SrcPath, '" vs. "', DestPath, '"'#10'## Prefix = "', SenderThread.SrcEngine.GetPrefix, '" vs. "', SenderThread.DestEngine.GetPrefix, '"']);
+// DebugMsg(['### IsOnSameFS: "', SrcPath, '" vs. "', DestPath, '"'#10'## Prefix = "', SenderThread.SrcEngine.GetPrefix, '" vs. "', SenderThread.DestEngine.GetPrefix, '"']);
with SenderThread do
if SrcEngine.GetPrefix <> DestEngine.GetPrefix
then Result := False
@@ -765,7 +767,7 @@ var DefResponse: integer; // Global variables for this function
begin
with SenderThread do begin
if SrcEngine.GetPrefix <> DestEngine.GetPrefix then Result := False else
- if AnsiCompareStr(Path1, Path2) = 0 then Result := True else
+ if WideCompareStr(Path1, Path2) = 0 then Result := True else
Result := TestCaseInsensitiveFS and DestEngine.TwoSameFiles(Path1, Path2);
end;
end;
@@ -779,41 +781,41 @@ var DefResponse: integer; // Global variables for this function
with AFileRec^ do begin
if IsLnk then begin
// Explicit copy the file
- if ParamBool3 or (not IsOnSameFS(String(AName), ExtractFileDir(Dst))) then begin
+ if ParamBool3 or (not IsOnSameFS(String(FName), ExtractFileDir(Dst))) then begin
ErrorKind := DestEngine.MakeSymLink(Dst, String(LnkPointTo));
if ErrorKind <> 0 then Result := ERRCreateLink;
if not ParamBool3 then begin
- ErrorKind := SrcEngine.Remove(String(AName));
+ ErrorKind := SrcEngine.Remove(String(FName));
if ErrorKind <> 0 then Result := ERRRemove;
end;
end else begin // Move the file
- ErrorKind := DestEngine.RenameFile(String(AName), Dst);
+ ErrorKind := DestEngine.RenameFile(String(FName), Dst);
if ErrorKind <> 0 then Result := ERRCopyMove;
end;
end else // is not link
if ParamBool3 then begin // Copy mode
- if LocalCopyFile(String(AName), Dst, Append) then begin
+ if LocalCopyFile(String(FName), Dst, Append) then begin
if IsOnRO and ConfClearReadOnlyAttr and (Mode and S_IWUSR = 0) then Mode := Mode or S_IWUSR;
DestEngine.Chmod(Dst, Mode);
DestEngine.Chown(Dst, UID, GID);
DestEngine.ChangeTimes(Dst, mtime, atime);
end;
end else // Move mode
- if IsOnSameFS(String(AName), ExtractFileDir(Dst)) then begin
- if TwoSameFiles(String(AName), Dst, True) and (not TwoSameFiles(String(AName), Dst, False)) then begin
+ if IsOnSameFS(String(FName), ExtractFileDir(Dst)) then begin
+ if TwoSameFiles(String(FName), Dst, True) and (not TwoSameFiles(String(FName), Dst, False)) then begin
DebugMsg(['*** Activating double-rename due to renaming on case-insensitive FS']);
- ErrorKind := DestEngine.RenameFile(String(AName), Dst + '_tcmd');
+ ErrorKind := DestEngine.RenameFile(String(FName), Dst + '_tcmd');
if ErrorKind = 0 then ErrorKind := DestEngine.RenameFile(Dst + '_tcmd', Dst);
- end else ErrorKind := DestEngine.RenameFile(String(AName), Dst);
+ end else ErrorKind := DestEngine.RenameFile(String(FName), Dst);
if ErrorKind <> 0 then Result := ERRCopyMove;
end else begin
- if LocalCopyFile(String(AName), Dst, Append) then begin
+ if LocalCopyFile(String(FName), Dst, Append) then begin
if IsOnRO and ConfClearReadOnlyAttr and (Mode and S_IWUSR = 0) then Mode := Mode or S_IWUSR;
DestEngine.Chmod(Dst, Mode);
DestEngine.Chown(Dst, UID, GID);
DestEngine.ChangeTimes(Dst, mtime, atime);
if not Cancelled then begin
- ErrorKind := SrcEngine.Remove(String(AName));
+ ErrorKind := SrcEngine.Remove(String(FName));
if ErrorKind <> 0 then Result := ERRRemove;
end;
end;
@@ -842,7 +844,7 @@ var DefResponse: integer; // Global variables for this function
DestEngine.Chmod(NewFilePath, Mode);
DestEngine.Chown(NewFilePath, UID, GID);
DestEngine.ChangeTimes(NewFilePath, mtime, atime);
- if not ParamBool3 then SrcEngine.Remove(String(AName)); // Remove directory
+ if not ParamBool3 then SrcEngine.Remove(String(FName)); // Remove directory
Exit;
end;
@@ -851,13 +853,13 @@ var DefResponse: integer; // Global variables for this function
Res := 0;
if AFileRec^.ForceMove and (not ParamBool3)
then begin
- if TwoSameFiles(ExcludeTrailingPathDelimiter(string(AFileRec^.AName)), ExcludeTrailingPathDelimiter(string(AFileRec^.ADestination)), True) and (not
- TwoSameFiles(ExcludeTrailingPathDelimiter(string(AFileRec^.AName)), ExcludeTrailingPathDelimiter(string(AFileRec^.ADestination)), False)) then
+ if TwoSameFiles(ExcludeTrailingPathDelimiter(string(AFileRec^.FName)), ExcludeTrailingPathDelimiter(string(AFileRec^.ADestination)), True) and (not
+ TwoSameFiles(ExcludeTrailingPathDelimiter(string(AFileRec^.FName)), ExcludeTrailingPathDelimiter(string(AFileRec^.ADestination)), False)) then
begin
DebugMsg(['*** Activating double-rename due to renaming on case-insensitive FS']);
- ErrorKind := DestEngine.RenameFile(string(AFileRec^.AName), ExcludeTrailingPathDelimiter(string(AFileRec^.ADestination)) + '_tcmd');
+ ErrorKind := DestEngine.RenameFile(string(AFileRec^.FName), ExcludeTrailingPathDelimiter(string(AFileRec^.ADestination)) + '_tcmd');
if ErrorKind = 0 then ErrorKind := DestEngine.RenameFile(ExcludeTrailingPathDelimiter(string(AFileRec^.ADestination)) + '_tcmd', ExcludeTrailingPathDelimiter(string(AFileRec^.ADestination)));
- end else ErrorKind := DestEngine.RenameFile(string(AFileRec^.AName), string(AFileRec^.ADestination));
+ end else ErrorKind := DestEngine.RenameFile(string(AFileRec^.FName), string(AFileRec^.ADestination));
if ErrorKind <> 0 then Res := ERRCopyMove
else Res := 0;
end else
@@ -873,16 +875,16 @@ var DefResponse: integer; // Global variables for this function
CopyFilesWorker_ProgressFunc(SenderThread, 0);
Res := 0;
if DestEngine.FileExists(NewFilePath, True) and
- (not (not ParamBool3 and (not TwoSameFiles(NewFilePath, AFileRec^.AName, False)) and TwoSameFiles(NewFilePath, AFileRec^.AName, True)))
+ (not (not ParamBool3 and (not TwoSameFiles(NewFilePath, AFileRec^.FName, False)) and TwoSameFiles(NewFilePath, AFileRec^.FName, True)))
then begin
Response := DefResponse;
Item := DestEngine.GetFileInfoSL(NewFilePath);
if Response = 0 then begin
- Response := ShowOverwriteDialog(1 + Ord(ParamBool3), Format(LANGOverwriteS, [ANSIToUTF8(NewFilePath)]),
+ Response := ShowOverwriteDialog(1 + Ord(ParamBool3), Format(LANGOverwriteS, [StrToUTF8(NewFilePath)]),
Format(LANGOvewriteSBytesS, [FormatSize(Item^.Size, 0), FormatDateTime('ddddd t', Item^.ModifyTime)]),
- Format(LANGWithFileS, [ANSIToUTF8(AFileRec^.AName)]),
+ Format(LANGWithFileS, [AFileRec^.FDisplayName]),
Format(LANGOvewriteSBytesS, [FormatSize(AFileRec^.Size, 0), FormatDateTime('ddddd t', AFileRec^.ModifyTime)]),
- ANSIToUTF8(ExtractFileName(NewFilePath)), ExtractFileName(AFileRec^.AName), ExtractFileName(NewFilePath));
+ ExtractFileName(StrToUTF8(NewFilePath)), ExtractFileName(AFileRec^.FDisplayName), ExtractFileName(StrToUTF8(NewFilePath)));
s := FOverwriteRenameStr;
case Response of
// 1: Overwrite
@@ -907,8 +909,8 @@ var DefResponse: integer; // Global variables for this function
if (Response in [1, 2]) or ((Response = 5) and (Item^.ModifyTime < AFileRec^.ModifyTime)) then begin
r := DestEngine.Remove(NewFilePath);
while r <> 0 do begin
- Res := ShowDirDeleteDialog(1, LANGTheFile, ANSIToUTF8(String(NewFilePath)),
- Format(LANGCouldNotBeDeletedS, [ANSIToUTF8(GetErrorString(r))]), LANGCopyError);
+ Res := ShowDirDeleteDialog(1, LANGTheFile, StrToUTF8(String(NewFilePath)),
+ Format(LANGCouldNotBeDeletedS, [GetErrorString(r)]), LANGCopyError);
case Res of
1: begin
Result := True;
@@ -934,28 +936,28 @@ var DefResponse: integer; // Global variables for this function
ERRCreateLink: begin
s1 := LANGTheSymbolicLink;
if ErrorKind = 0 then s3 := LANGCouldNotBeCreated else
- s3 := Format(LANGCouldNotBeCreatedS, [ANSIToUTF8(GetErrorString(ErrorKind))]);
+ s3 := Format(LANGCouldNotBeCreatedS, [GetErrorString(ErrorKind)]);
end;
ERRMkDir: begin
s1 := LANGTheDirectory;
if ErrorKind = 0 then s3 := LANGCouldNotBeCreated else
- s3 := Format(LANGCouldNotBeCreatedS, [ANSIToUTF8(GetErrorString(ErrorKind))]);
+ s3 := Format(LANGCouldNotBeCreatedS, [GetErrorString(ErrorKind)]);
end;
ERRRemove: begin
if AFileRec^.IsDir then s1 := LANGTheDirectory else
if AFileRec^.IsLnk then s1 := LANGTheSymbolicLink else
s1 := LANGTheFile;
if ErrorKind = 0 then s3 := LANGCouldNotBeDeleted else
- s3 := Format(LANGCouldNotBeDeletedS, [ANSIToUTF8(GetErrorString(ErrorKind))]);
+ s3 := Format(LANGCouldNotBeDeletedS, [GetErrorString(ErrorKind)]);
end;
ERRCopyMove: begin
if ParamBool3 then s1 := LANGCannotCopyFile else
s1 := LANGCannotMoveFile;
if ErrorKind = 0 then s3 := '' else
- s3 := ANSIToUTF8(GetErrorString(ErrorKind));
+ s3 := GetErrorString(ErrorKind);
end;
end;
- Response := ShowDirDeleteDialog(1, s1, ANSIToUTF8(String(NewFilePath)), s3, cap);
+ Response := ShowDirDeleteDialog(1, s1, StrToUTF8(String(NewFilePath)), s3, cap);
case Response of
1 : Result := True; // Skip
2 : Result := HandleCopy(AFileRec, NewFilePath); // Retry
@@ -988,7 +990,7 @@ var DefResponse: integer; // Global variables for this function
end;
end else begin
s := ProcessPattern(DestEngine, ParamString1, CurrPath, ParamFileName, ParamDir);
- CaseInsensitiveRename := (AnsiCompareStr(ParamString1, ParamFileName) <> 0) and (AnsiCompareText(ParamString1, ParamFileName) = 0) and
+ CaseInsensitiveRename := (WideCompareStr(ParamString1, ParamFileName) <> 0) and (WideCompareText(ParamString1, ParamFileName) = 0) and
ParamDir and DestEngine.TwoSameFiles(IncludeTrailingPathDelimiter(CurrPath) + ParamString1, IncludeTrailingPathDelimiter(CurrPath) + ParamFileName);
// DebugMsg(['HandleProcessPattern: s = ', s]);
b := False;
@@ -1040,21 +1042,21 @@ begin
end else
if ParamBool4 then begin // Quick-Rename
with ParamDataItem1^ do
- HandleProcessPattern(List, CurrPath, CurrPath + String(AName), String(AName), IsDir and (not IsLnk), True);
+ HandleProcessPattern(List, CurrPath, CurrPath + String(FName), String(FName), IsDir and (not IsLnk), True);
end else begin // Not Quick-Rename
if not ExtractFromVFSMode then begin
if DataList.Count > 0 then
for i := 0 to DataList.Count - 1 do
with PDataItem(DataList[i])^ do
if (not UpDir) and Selected
- then HandleProcessPattern(List, CurrPath, CurrPath + String(AName), String(AName), IsDir and (not IsLnk), not ParamBool3);
+ then HandleProcessPattern(List, CurrPath, CurrPath + String(FName), String(FName), IsDir and (not IsLnk), not ParamBool3);
if (List.Count = 0) and Assigned(SelectedItem) and (not SelectedItem^.UpDir) then
with SelectedItem^ do
- HandleProcessPattern(List, CurrPath, CurrPath + String(AName), String(AName), IsDir and (not IsLnk), not ParamBool3);
+ HandleProcessPattern(List, CurrPath, CurrPath + String(FName), String(FName), IsDir and (not IsLnk), not ParamBool3);
end else begin // Extract from VFS mode
DebugMsg(['CopyFilesWorker: Should not be reached']);
if (not ExtractFromVFSAll) and Assigned(SelectedItem)
- then HandleProcessPattern(List, CurrPath, CurrPath + String(SelectedItem^.AName), String(SelectedItem^.AName), SelectedItem^.IsDir and (not SelectedItem^.IsLnk), not ParamBool3)
+ then HandleProcessPattern(List, CurrPath, CurrPath + String(SelectedItem^.FName), String(SelectedItem^.FName), SelectedItem^.IsDir and (not SelectedItem^.IsLnk), not ParamBool3)
else begin
SaveSrcPath := IncludeTrailingPathDelimiter(SrcEngine.Path);
SrcEngine.SetPath('/');
@@ -1096,20 +1098,20 @@ begin
then s := string(PDataItemSL(List[i])^.ADestination)
else
begin
- s := ProcessPattern(DestEngine, ParamString1, CurrPath, Copy(PDataItemSL(List[i])^.AName, Length(CurrPath) + 1, Length(PDataItemSL(List[i])^.AName) - Length(CurrPath)),
+ s := ProcessPattern(DestEngine, ParamString1, CurrPath, Copy(PDataItemSL(List[i])^.FName, Length(CurrPath) + 1, Length(PDataItemSL(List[i])^.FName) - Length(CurrPath)),
PDataItemSL(List[i])^.IsDir and (not PDataItemSL(List[i])^.IsLnk));
// DebugMsg(['s2 = ', Copy(PDataItemSL(List[i])^.AName, Length(CurrPath) + 1, Length(PDataItemSL(List[i])^.AName) - Length(CurrPath)), ', s = ', s]);
end;
- UpdateCaption1(Format(LANGFromS, [ANSIToUTF8(string(PDataItemSL(List[i])^.AName))]));
- UpdateCaption2(Format(LANGToS, [ANSIToUTF8(s)]));
+ UpdateCaption1(Format(LANGFromS, [string(PDataItemSL(List[i])^.FDisplayName)]));
+ UpdateCaption2(Format(LANGToS, [StrToUTF8(s)]));
CommitGUIUpdate;
- if TwoSameFiles(s, string(PDataItemSL(List[i])^.AName), ParamBool3) and (not PDataItemSL(List[i])^.IsDir) then begin
+ if TwoSameFiles(s, string(PDataItemSL(List[i])^.FName), ParamBool3) and (not PDataItemSL(List[i])^.IsDir) then begin
FCancelMessage := LANGCannotCopyFileToItself;
FShowCancelMessage := True;
ErrorHappened := True;
Break;
end;
- if s <> string(PDataItemSL(List[i])^.AName) then
+ if s <> string(PDataItemSL(List[i])^.FName) then
if not HandleCopy(List[i], s) then begin
ErrorHappened := True;
Break;
@@ -1172,7 +1174,7 @@ begin
WriteLn('**** List Item idx ', i, '; base @ ', integer(List[i]), '; sizeof = ', SizeOf(List[i]));
Item := List[i];
WriteLn(' Stage1: ', Item^.Stage1, ', Level: ', Item^.Level, ', IsDir: ', Item^.IsDir, ', IsLnk: ', Item^.IsLnk, ', ForceMove: ', Item^.ForceMove{, ', Size: ', Item^.Size});
- WriteLn(' AName: ', Item^.AName);
+ WriteLn(' FName: ', Item^.FName);
WriteLn(' LnkPointTo: ', Item^.LnkPointTo);
WriteLn(' ADestination: ', Item^.ADestination);
except
@@ -1201,7 +1203,7 @@ begin
WriteLn('**** List Item idx ', i, '; base @ ', integer(List[i]), '; sizeof = ', SizeOf(List[i]));
Item := List[i];
WriteLn(' IsDir: ', Item^.IsDir, ', IsLnk: ', Item^.IsLnk, ', Size: ', Item^.Size);
- WriteLn(' AName: ', Item^.AName);
+ WriteLn(' FName: ', Item^.FName);
WriteLn(' LnkPointTo: ', Item^.LnkPointTo);
except
on E: Exception do
@@ -1223,12 +1225,12 @@ begin
for i := 0 to DataList.Count - 1 do
with PDataItem(DataList[i])^ do
if Selected and (not UpDir) then Inc(SelCount);
- Item1 := string(PDataItem(ListView.Selected.Data)^.AName);
+ Item1 := string(PDataItem(ListView.Selected.Data)^.FDisplayName);
if (PDataItem(ListView.Selected.Data)^.Selected and (SelCount > 0)) or (SelCount = 0) then begin
if ListView.ConvertToSorted(ListView.Selected.Index) < ListView.Items.Count then
for i := ListView.ConvertToSorted(ListView.Selected.Index) + 1 to DataList.Count - 1 do
if not PDataItem(DataList[ListView.ConvertFromSorted(i)])^.Selected then begin
- Item2 := string(PDataItem(DataList[ListView.ConvertFromSorted(i)])^.AName);
+ Item2 := string(PDataItem(DataList[ListView.ConvertFromSorted(i)])^.FDisplayName);
Break;
end;
if (Item2 = '') and (ListView.ConvertToSorted(ListView.Selected.Index) > 0) then
@@ -1236,7 +1238,7 @@ begin
if (not PDataItem(DataList[ListView.ConvertFromSorted(i)])^.Selected) and
(not PDataItem(DataList[ListView.ConvertFromSorted(i)])^.UpDir) then
begin
- Item2 := string(PDataItem(DataList[ListView.ConvertFromSorted(i)])^.AName);
+ Item2 := string(PDataItem(DataList[ListView.ConvertFromSorted(i)])^.FDisplayName);
Break;
end;
end;
@@ -1266,7 +1268,7 @@ function CRCGetInfo(FileName: string; Engine: TPanelEngine; var TargetName: stri
try
TrimCRLFESC(Str);
if Length(Str) < 1 then Exit;
- UPS := AnsiUpperCase(Str);
+ UPS := WideUpperCase(Str);
if Pos('FILENAME', UPS) = 1 then TargetName := Trim(Copy(Str, Pos('=', Str) + 1, Length(Str) - Pos('=', Str))) else
if Pos('SIZE', UPS) = 1 then Size := StrToInt64Def(Trim(Copy(Str, Pos('=', Str) + 1, Length(Str) - Pos('=', Str))), 0) else
if Pos('CRC32', UPS) = 1 then TargetCRC := StrToInt64Def('$' + Trim(Copy(Str, Pos('=', Str) + 1, Length(Str) - Pos('=', Str))), 0);
@@ -1346,8 +1348,8 @@ var FD: TEngineFileDes;
begin
Result := False;
with SenderThread do begin
- if ParamBool1 then UpdateCaption2(Format(LANGToS, [ANSIToUTF8(FName)]))
- else UpdateCaption1(Format(LANGFromS, [ANSIToUTF8(FName)]));
+ if ParamBool1 then UpdateCaption2(Format(LANGToS, [StrToUTF8(FName)]))
+ else UpdateCaption1(Format(LANGFromS, [StrToUTF8(FName)]));
UpdateProgress1(0, '0 %');
CommitGUIUpdate;
Stat := Engine.GetFileInfoSL(FName);
@@ -1363,7 +1365,7 @@ var FD: TEngineFileDes;
end;
wCount := Engine.WriteFile(FD, Buffer, Count, Error);
if (Error <> 0) or (Count <> wCount) then begin
- FCancelMessage := Format(LANGAnErrorOccuredWhileWritingFileSS, [ANSIToUTF8(ExtractFileName(TargetName)), ANSIToUTF8(GetErrorString(Error))]);
+ FCancelMessage := Format(LANGAnErrorOccuredWhileWritingFileSS, [ExtractFileName(TargetName), GetErrorString(Error)]);
FShowCancelMessage := True;
PrivateCancel := True;
Result := True; // Fake this to don't show next disc dialog
@@ -1388,18 +1390,18 @@ begin
with SenderThread do begin
HasFinalCRC := ParamBool1;
TargetFinalName := ParamString3;
- if (Length(ParamString2) > 4) and (ANSIUpperCase(RightStr(ParamString2, 4)) = '.CRC')
+ if (Length(ParamString2) > 4) and (WideUpperCase(RightStr(ParamString2, 4)) = '.CRC')
then CurrFile := ChangeFileExt(ExtractFileName(ParamString2), '.001')
else CurrFile := ExtractFileName(ParamString2);
SourcePath := ExtractFilePath(ParamString2);
if ParamString3 = '' then ParamString3 := ChangeFileExt(ExtractFileName(ParamString2), '.out');
TargetName := ProcessPattern(Engine, ParamString1, Engine.Path, ParamString3, False);
if Engine.FileExists(TargetName, True) then
- if ShowMessageBox(Format(LANGTheTargetFileSAlreadyExistsDoYouWantToOverwriteIt, [ANSIToUTF8(TargetName)]), [mbYes, mbNo], mbQuestion, mbNone, mbNo) = mbYes then
+ if ShowMessageBox(Format(LANGTheTargetFileSAlreadyExistsDoYouWantToOverwriteIt, [StrToUTF8(TargetName)]), [mbYes, mbNo], mbQuestion, mbNone, mbNo) = mbYes then
begin
Error := Engine.Remove(TargetName);
if Error <> 0 then begin
- FCancelMessage := Format(LANGTheTargetFileSCannotBeRemovedS, [ANSIToUTF8(ExtractFileName(TargetName)), ANSIToUTF8(GetErrorString(Error))]);
+ FCancelMessage := Format(LANGTheTargetFileSCannotBeRemovedS, [StrToUTF8(ExtractFileName(TargetName)), GetErrorString(Error)]);
FShowCancelMessage := True;
Exit;
end;
@@ -1418,7 +1420,7 @@ begin
end;
FD := Engine.OpenFile(TargetName, omWrite, Error);
if Error <> 0 then begin
- FCancelMessage := Format(LANGAnErrorOccuredWhileOpeningFileSS, [ANSIToUTF8(TargetName), ANSIToUTF8(GetErrorString(Error))]);
+ FCancelMessage := Format(LANGAnErrorOccuredWhileOpeningFileSS, [StrToUTF8(TargetName), GetErrorString(Error)]);
FShowCancelMessage := True;
Libc.free(Buffer);
Exit;
@@ -1430,7 +1432,7 @@ begin
if ParamBool1 then begin
SetProgress2Params(ParamInt64);
UpdateProgress2(0, '0 %');
- UpdateCaption2(Format(LANGFromS, [ANSIToUTF8(TargetName)]));
+ UpdateCaption2(Format(LANGFromS, [StrToUTF8(TargetName)]));
CommitGUIUpdate;
end; { else begin
Label2.XAlign := 0;
@@ -1440,9 +1442,9 @@ begin
repeat
b := PasteFile(IncludeTrailingPathDelimiter(SourcePath) + CurrFile);
if not b then begin
- PrivateCancel := ShowNewDirDialog(LANGMergeCaption, LANGPleaseInsertNextDiskOrGiveDifferentLocation, ANSIToUTF8(SourcePath)) <> integer(mbOK);
+ PrivateCancel := ShowNewDirDialog(LANGMergeCaption, LANGPleaseInsertNextDiskOrGiveDifferentLocation, StrToUTF8(SourcePath)) <> integer(mbOK);
if not PrivateCancel then begin
- SourcePath := UTF8ToANSI(FNewDirEdit);
+ SourcePath := UTF8ToStr(FNewDirEdit);
if not HasFinalCRC then
HasFinalCRC := CRCGetInfo(IncludeTrailingPathDelimiter(SourcePath) + CurrFile, Engine, TargetFinalName, ParamLongWord1, ParamInt64);
Continue;
@@ -1463,9 +1465,9 @@ begin
if not (Cancelled or PrivateCancel) then
if HasFinalCRC then begin
if not CurrentCRC = ParamLongWord1
- then ShowMessageBox(Format(LANGMergeOfSSucceeded, [ANSIToUTF8(ExtractFileName(TargetFinalName))]), [mbOK], mbInfo, mbNone, mbOK)
+ then ShowMessageBox(Format(LANGMergeOfSSucceeded, [StrToUTF8(ExtractFileName(TargetFinalName))]), [mbOK], mbInfo, mbNone, mbOK)
else ShowMessageBox(LANGWarningCreatedFileFailsCRCCheck, [mbOK], mbWarning, mbNone, mbOK);
- end else ShowMessageBox(Format(LANGMergeOfSSucceeded_NoCRCFileAvailable, [ANSIToUTF8(ExtractFileName(TargetFinalName))]), [mbOK], mbInfo, mbNone, mbOK);
+ end else ShowMessageBox(Format(LANGMergeOfSSucceeded_NoCRCFileAvailable, [StrToUTF8(ExtractFileName(TargetFinalName))]), [mbOK], mbInfo, mbNone, mbOK);
Engine.CloseFile(FD);
end;
Libc.free(Buffer);
@@ -1483,13 +1485,13 @@ begin
else TargetFile := TargetFile + '.crc';
FD := Engine.OpenFile(TargetFile, omWrite, Error);
if Error <> 0 then begin
- Application.MessageBox(Format(LANGAnErrorOccuredWhileOpeningFileSS, [ANSIToUTF8(TargetFile), ANSIToUTF8(GetErrorString(Error))]), [mbOK], mbError, mbNone, mbOK);
+ Application.MessageBox(Format(LANGAnErrorOccuredWhileOpeningFileSS, [TargetFile, GetErrorString(Error)]), [mbOK], mbError, mbNone, mbOK);
Exit;
end;
- s := Format('filename=%s'#13#10'size=%d'#13#10'crc32=%s'#13#10, [SplitFileName, FileSize, ANSIUpperCase(IntToHex(FileCRC, 8))]);
+ s := Format('filename=%s'#13#10'size=%d'#13#10'crc32=%s'#13#10, [SplitFileName, FileSize, WideUpperCase(IntToHex(FileCRC, 8))]);
Count := Engine.WriteFile(FD, @s[1], Length(s), Error);
if (Error <> 0) or (Count <> Length(s)) then begin
- Application.MessageBox(Format(LANGAnErrorOccuredWhileWritingFileSS, [ANSIToUTF8(TargetFile), ANSIToUTF8(GetErrorString(Error))]), [mbOK], mbError, mbNone, mbOK);
+ Application.MessageBox(Format(LANGAnErrorOccuredWhileWritingFileSS, [TargetFile, GetErrorString(Error)]), [mbOK], mbError, mbNone, mbOK);
Exit;
end;
Engine.CloseFile(FD);
@@ -1524,10 +1526,10 @@ var FD: TEngineFileDes;
DebugMsg(['-- Opening file ', ExtractFileName(TargetFile), ', PartSize = ', PartSize]);
if Error <> 0 then Exit;
if ParamInt64 > 0 then begin
- UpdateCaption2(Format(LANGToS, [ANSIToUTF8(TargetFile)]));
+ UpdateCaption2(Format(LANGToS, [StrToUTF8(TargetFile)]));
SetProgress1Params(PartSize);
UpdateProgress1(0, '0 %');
- end else UpdateCaption1(Format(LANGToS, [ANSIToUTF8(TargetFile)]));
+ end else UpdateCaption1(Format(LANGToS, [StrToUTF8(TargetFile)]));
CommitGUIUpdate;
repeat
DebugMsg(['Seek to ', Engine.FileSeek(FD, SizeDone + Written, Error), ', Written = ', Written]);
@@ -1576,8 +1578,8 @@ var FD: TEngineFileDes;
DebugMsg(['-- New disk question']);
Engine.ExplicitChDir('/');
PrivateCancel := ShowNewDirDialog(LANGSplitCaption, LANGPleaseInsertNextDiskOrGiveDifferentLocation,
- ANSIToUTF8(FilePath)) <> integer(mbOK);
- if not PrivateCancel then FilePath := UTF8ToANSI(FNewDirEdit);
+ StrToUTF8(FilePath)) <> integer(mbOK);
+ if not PrivateCancel then FilePath := UTF8ToStr(FNewDirEdit);
Result := PrivateCancel;
end;
end;
@@ -1594,7 +1596,7 @@ begin
with SenderThread do begin
Stat := Engine.GetFileInfoSL(ParamString1);
if not Assigned(Stat) then begin
- FCancelMessage := Format(LANGCannotOpenFileS, [ANSIToUTF8(ParamString1)]);
+ FCancelMessage := Format(LANGCannotOpenFileS, [StrToUTF8(ParamString1)]);
FShowCancelMessage := True;
Exit;
end;
@@ -1618,7 +1620,7 @@ begin
end;
FD := Engine.OpenFile(ParamString1, omRead, Error);
if Error <> 0 then begin
- FCancelMessage := Format(LANGAnErrorOccuredWhileOpeningFileSS, [ANSIToUTF8(ParamString1), ANSIToUTF8(GetErrorString(Error))]);
+ FCancelMessage := Format(LANGAnErrorOccuredWhileOpeningFileSS, [StrToUTF8(ParamString1), GetErrorString(Error)]);
Libc.free(Buffer);
Exit;
end;
@@ -1636,7 +1638,7 @@ begin
SetProgress1Params(FileSize);
UpdateProgress1(0, '0 %');
end;
- UpdateCaption1(Format(LANGFromS, [ANSIToUTF8(IncludeTrailingPathDelimiter(FilePath) + OriginalFName)]));
+ UpdateCaption1(Format(LANGFromS, [StrToUTF8(IncludeTrailingPathDelimiter(FilePath) + OriginalFName)]));
CommitGUIUpdate;
repeat
@@ -1652,23 +1654,23 @@ begin
st := '';
if List.Count < 6 then begin
for i := 0 to List.Count - 1 do
- st := st + ' ' + AnsiToUTF8(string(PDataItem(List[i])^.AName)) + #10;
- b := ShowMessageBox(Format(LANGThereAreSomeFilesInTheTargetDirectorySDoYouWantToDeleteThem, [st]), [mbYes, mbNo], mbQuestion, mbNone, mbNo) = mbYes;
+ st := st + ' ' + string(PDataItem(List[i])^.FDisplayName) + #10;
+ b := ShowMessageBox(Format(LANGThereAreSomeFilesInTheTargetDirectorySDoYouWantToDeleteThem, [StrToUTF8(st)]), [mbYes, mbNo], mbQuestion, mbNone, mbNo) = mbYes;
end else b := ShowMessageBox(Format(LANGThereAreDFilesInTheTargetDirectoryDoYouWantToDeleteThem, [List.Count]), [mbYes, mbNo], mbQuestion, mbNone, mbNo) = mbYes;
if b then
for i := 0 to List.Count - 1 do begin
- Error := Engine.Remove(IncludeTrailingPathDelimiter(FilePath) + string(PDataItem(List[i])^.AName));
- if Error <> 0 then ShowMessageBox(Format(LANGTheTargetFileSCannotBeRemovedS, [ANSIToUTF8(IncludeTrailingPathDelimiter(FilePath) + string(PDataItem(List[i])^.AName)), ANSIToUTF8(GetErrorString(Error))]), [mbOK], mbError, mbNone, mbOK);
+ Error := Engine.Remove(IncludeTrailingPathDelimiter(FilePath) + string(PDataItem(List[i])^.FName));
+ if Error <> 0 then ShowMessageBox(Format(LANGTheTargetFileSCannotBeRemovedS, [StrToUTF8(IncludeTrailingPathDelimiter(FilePath)) + string(PDataItem(List[i])^.FDisplayName), GetErrorString(Error)]), [mbOK], mbError, mbNone, mbOK);
end;
end;
except end;
// Test for target file existence
if Engine.FileExists(IncludeTrailingPathDelimiter(FilePath) + FileName) then begin
- b := ShowMessageBox(Format(LANGTheTargetFileSAlreadyExistsDoYouWantToOverwriteIt, [ANSIToUTF8(IncludeTrailingPathDelimiter(FilePath) + FileName)]), [mbYes, mbNo], mbQuestion, mbNone, mbNo) = mbYes;
+ b := ShowMessageBox(Format(LANGTheTargetFileSAlreadyExistsDoYouWantToOverwriteIt, [StrToUTF8(IncludeTrailingPathDelimiter(FilePath) + FileName)]), [mbYes, mbNo], mbQuestion, mbNone, mbNo) = mbYes;
if b then begin
Error := Engine.Remove(IncludeTrailingPathDelimiter(FilePath) + FileName);
if Error <> 0 then begin
- FCancelMessage := Format(LANGTheTargetFileSCannotBeRemovedS, [ANSIToUTF8(IncludeTrailingPathDelimiter(FilePath) + FileName), ANSIToUTF8(GetErrorString(Error))]);
+ FCancelMessage := Format(LANGTheTargetFileSCannotBeRemovedS, [StrToUTF8(IncludeTrailingPathDelimiter(FilePath) + FileName), GetErrorString(Error)]);
FShowCancelMessage := True;
PrivateCancel := True;
Break;
@@ -1685,7 +1687,7 @@ begin
if (CurrSize >= 512) and (TDF >= CurrSize) then begin
b := WriteSplitPart(IncludeTrailingPathDelimiter(FilePath) + FileName, CurrSize, ws);
if (not b) and (ParamInt64 > 0) then begin
- FCancelMessage := Format(LANGAnErrorOccuredWhileOperationS, [ANSIToUTF8(GetErrorString(Error))]);
+ FCancelMessage := Format(LANGAnErrorOccuredWhileOperationS, [GetErrorString(Error)]);
FShowCancelMessage := True;
PrivateCancel := True;
Break;
@@ -1716,9 +1718,9 @@ begin
if (TDF < 512) and (not NewDiskQuestion) then Break;
until (TDF >= 512) or PrivateCancel or Cancelled;
if WriteCRCFile(Engine, IncludeTrailingPathDelimiter(FilePath) + FileName, OriginalFName, SizeDone, not FileCRC)
- then ShowMessageBox(Format(LANGSplitOfSSucceeded, [ANSIToUTF8(OriginalFName)]), [mbOK], mbInfo, mbNone, mbOK)
+ then ShowMessageBox(Format(LANGSplitOfSSucceeded, [StrToUTF8(OriginalFName)]), [mbOK], mbInfo, mbNone, mbOK)
else begin
- FCancelMessage := Format(LANGSplitOfSFailed, [ANSIToUTF8(OriginalFName)]);
+ FCancelMessage := Format(LANGSplitOfSFailed, [StrToUTF8(OriginalFName)]);
FShowCancelMessage := True;
end;
end;
@@ -1745,13 +1747,13 @@ var SkipAll: boolean;
if AFileRec^.IsDir and ParamBool1 and AFileRec^.Stage1 and (not AFileRec^.IsLnk) then Exit;
if (not AFileRec^.IsDir) and ParamBool1 and (ParamInt1 = 1) then Exit; // Directories only
if AFileRec^.IsDir and ParamBool1 and (ParamInt1 = 2) then Exit; // Files only
- Res := Engine.Chmod(String(AFileRec^.AName), ParamCardinal1);
+ Res := Engine.Chmod(String(AFileRec^.FName), ParamCardinal1);
// DebugMsg(['Result : ', Res]);
if Res <> 0 then
if SkipAll then Result := True else
begin
- Response := ShowDirDeleteDialog(1, LANGTheFileDirectory, ANSIToUTF8(String(AFileRec^.AName)), Format(LANGCouldNotBeChmoddedS,
- [ANSIToUTF8(GetErrorString(Res))]), LANGDialogChangePermissions);
+ Response := ShowDirDeleteDialog(1, LANGTheFileDirectory, String(AFileRec^.FDisplayName), Format(LANGCouldNotBeChmoddedS,
+ [GetErrorString(Res)]), LANGDialogChangePermissions);
case Response of
1 : Result := True;
3 : begin
@@ -1780,13 +1782,13 @@ begin
with PDataItem(DataList[i])^ do
if (not UpDir) and Selected then
if IsDir and (not IsLnk) and ParamBool1
- then Engine.FillDirFiles(CurrPath + String(AName), AList, 1)
- else AList.Add(Engine.GetFileInfoSL(CurrPath + String(AName)));
+ then Engine.FillDirFiles(CurrPath + String(FName), AList, 1)
+ else AList.Add(Engine.GetFileInfoSL(CurrPath + String(FName)));
if (AList.Count = 0) and Assigned(SelectedItem) and (not SelectedItem^.UpDir) then
with SelectedItem^ do
if IsDir and (not IsLnk) and ParamBool1
- then Engine.FillDirFiles(CurrPath + String(AName), AList, 1)
- else AList.Add(Engine.GetFileInfoSL(CurrPath + String(AName)));
+ then Engine.FillDirFiles(CurrPath + String(FName), AList, 1)
+ else AList.Add(Engine.GetFileInfoSL(CurrPath + String(FName)));
Engine.ExplicitChDir('/');
SetProgress1Params(AList.Count);
UpdateProgress1(0, '0 %');
@@ -1805,7 +1807,7 @@ begin
// Process chmod
if not HandleChmod(AList[i]) then Break;
UpdateProgress1(i, Format('%d%%', [Round(Fr * i)]));
- UpdateCaption1(ANSIToUTF8(PDataItemSL(AList[i])^.AName));
+ UpdateCaption1(PDataItemSL(AList[i])^.FDisplayName);
CommitGUIUpdate;
end;
@@ -1834,13 +1836,13 @@ var SkipAll: boolean;
// DebugMsg(['Chown Debug: IsDir: ', AFileRec^.IsDir, ', Stage1: ', AFileRec^.Stage1, ', IsLnk: ', AFileRec^.IsLnk, '; Result = ', AFileRec^.IsDir and AFileRec^.Stage1 and (not AFileRec^.IsLnk)]);
if (AFileRec^.IsDir and ParamBool1 and AFileRec^.Stage1 and (not AFileRec^.IsLnk)) or
((not AFileRec^.IsDir) and ParamBool1) then Exit;
- Res := Engine.Chown(String(AFileRec^.AName), ParamCardinal1, ParamCardinal2);
+ Res := Engine.Chown(String(AFileRec^.FName), ParamCardinal1, ParamCardinal2);
// DebugMsg(['Result : ', Res]);
if Res <> 0 then
if SkipAll then Result := True else
begin
- Response := ShowDirDeleteDialog(1, LANGTheFileDirectory, ANSIToUTF8(String(AFileRec^.AName)), Format(LANGCouldNotBeChownedS,
- [ANSIToUTF8(GetErrorString(Res))]), LANGDialogChangeOwner);
+ Response := ShowDirDeleteDialog(1, LANGTheFileDirectory, String(AFileRec^.FDisplayName), Format(LANGCouldNotBeChownedS,
+ [GetErrorString(Res)]), LANGDialogChangeOwner);
case Response of
1 : Result := True;
3 : begin
@@ -1869,13 +1871,13 @@ begin
with PDataItem(DataList[i])^ do
if (not UpDir) and Selected then
if IsDir and (not IsLnk) and ParamBool1
- then Engine.FillDirFiles(CurrPath + String(AName), AList, 1)
- else AList.Add(Engine.GetFileInfoSL(CurrPath + String(AName)));
+ then Engine.FillDirFiles(CurrPath + String(FName), AList, 1)
+ else AList.Add(Engine.GetFileInfoSL(CurrPath + String(FName)));
if (AList.Count = 0) and Assigned(SelectedItem) and (not SelectedItem^.UpDir) then
with SelectedItem^ do
if IsDir and (not IsLnk) and ParamBool1
- then Engine.FillDirFiles(CurrPath + String(AName), AList, 1)
- else AList.Add(Engine.GetFileInfoSL(CurrPath + String(AName)));
+ then Engine.FillDirFiles(CurrPath + String(FName), AList, 1)
+ else AList.Add(Engine.GetFileInfoSL(CurrPath + String(FName)));
Engine.ExplicitChDir('/');
SetProgress1Params(AList.Count);
UpdateProgress1(0, '0 %');
@@ -1894,7 +1896,7 @@ begin
// Process chmod
if not HandleChown(AList[i]) then Break;
UpdateProgress1(i, Format('%d%%', [Round(Fr * i)]));
- UpdateCaption1(ANSIToUTF8(PDataItemSL(AList[i])^.AName));
+ UpdateCaption1(PDataItemSL(AList[i])^.FDisplayName);
CommitGUIUpdate;
end;
@@ -1949,8 +1951,8 @@ var AFSymLink: TFSymlink;
FDirDelete.Caption := LANGDialogMakeSymlink;
FDirDelete.AddButtons(2);
FDirDelete.Label1.Caption := LANGTheSymbolicLink;
- FDirDelete.Label2.Caption := ANSIToUTF8(NewName);
- FDirDelete.Label3.Caption := Format(LANGCouldNotBeCreatedS, [ANSIToUTF8(GetErrorString(Res))]);
+ FDirDelete.Label2.Caption := NewName;
+ FDirDelete.Label3.Caption := Format(LANGCouldNotBeCreatedS, [GetErrorString(Res)]);
FDirDelete.Label3.Visible := True;
Response := Integer(FDirDelete.Run);
finally
@@ -1968,12 +1970,12 @@ begin
Result := False;
try
AFSymlink := TFSymlink.Create(Application.MainForm);
- AFSymlink.FromEntry.Text := ANSIToUTF8(FileName);
- AFSymlink.ToEntry.Text := ANSIToUTF8(PossibleNewName);
+ AFSymlink.FromEntry.Text := StrToUTF8(FileName);
+ AFSymlink.ToEntry.Text := StrToUTF8(PossibleNewName);
AFSymlink.ToEntry.SetFocus;
AFSymlink.ToEntry.SelectAll;
- if AFSymlink.Run = mbOK then Result := HandleCreateSymlink(UTF8ToANSI(AFSymlink.FromEntry.Text),
- ProcessPattern(Engine, UTF8ToANSI(AFSymlink.ToEntry.Text), Engine.Path, '', False));
+ if AFSymlink.Run = mbOK then Result := HandleCreateSymlink(UTF8ToStr(AFSymlink.FromEntry.Text),
+ ProcessPattern(Engine, UTF8ToStr(AFSymlink.ToEntry.Text), Engine.Path, '', False));
finally
AFSymlink.Free;
end;
@@ -1995,8 +1997,8 @@ var Data: PDataItemSL;
FDirDelete.Caption := LANGDialogEditSymlink;
FDirDelete.AddButtons(2);
FDirDelete.Label1.Caption := LANGTheSymbolicLink;
- FDirDelete.Label2.Caption := ANSIToUTF8(ExistingName);
- FDirDelete.Label3.Caption := Format(LANGCouldNotBeDeletedS, [ANSIToUTF8(GetErrorString(Res))]);
+ FDirDelete.Label2.Caption := StrToUTF8(ExistingName);
+ FDirDelete.Label3.Caption := Format(LANGCouldNotBeDeletedS, [GetErrorString(Res)]);
FDirDelete.Label3.Visible := True;
Response := Integer(FDirDelete.Run);
finally
@@ -2015,8 +2017,8 @@ var Data: PDataItemSL;
FDirDelete.Caption := LANGDialogMakeSymlink;
FDirDelete.AddButtons(2);
FDirDelete.Label1.Caption := LANGTheSymbolicLink;
- FDirDelete.Label2.Caption := ANSIToUTF8(ExistingName);
- FDirDelete.Label3.Caption := Format(LANGCouldNotBeCreatedS, [ANSIToUTF8(GetErrorString(Res))]);
+ FDirDelete.Label2.Caption := StrToUTF8(ExistingName);
+ FDirDelete.Label3.Caption := Format(LANGCouldNotBeCreatedS, [GetErrorString(Res)]);
FDirDelete.Label3.Visible := True;
Response := Integer(FDirDelete.Run);
finally
@@ -2035,15 +2037,15 @@ begin
try
AFSymlink := TFSymlink.Create(Application);
AFSymlink.Caption := LANGFEditSymlink_Caption;
- AFSymlink.FromEntry.Text := ANSIToUTF8(FileName);
+ AFSymlink.FromEntry.Text := StrToUTF8(FileName);
AFSymlink.Label1.Caption := LANGFEditSymlink_SymbolicLinkFilename;
AFSymlink.Label1.UseUnderline := True;
AFSymlink.Label2.Caption := LANGFEditSymlink_SymbolicLinkPointsTo;
AFSymlink.Label2.UseUnderline := True;
AFSymlink.FromEntry.Enabled := False;
- AFSymlink.ToEntry.Text := ANSIToUTF8(Data^.LnkPointTo);
+ AFSymlink.ToEntry.Text := StrToUTF8(Data^.LnkPointTo);
AFSymlink.ToEntry.SelectAll;
- if AFSymlink.Run = mbOK then Result := HandleEditSymlink(UTF8ToANSI(AFSymlink.FromEntry.Text), UTF8ToANSI(AFSymlink.ToEntry.Text));
+ if AFSymlink.Run = mbOK then Result := HandleEditSymlink(UTF8ToStr(AFSymlink.FromEntry.Text), UTF8ToStr(AFSymlink.ToEntry.Text));
finally
AFSymlink.Free;
end;
@@ -2140,7 +2142,7 @@ begin
AFOverwrite.SourceFile := SenderThread.FOverwriteSourceFile;
AFOverwrite.DestFile := SenderThread.FOverwriteDestFile;
SenderThread.FDialogResultOverwrite := Integer(AFOverwrite.Run);
- SenderThread.FOverwriteRenameStr := UTF8ToANSI(AFOverwrite.RenameStr);
+ SenderThread.FOverwriteRenameStr := UTF8ToStr(AFOverwrite.RenameStr);
finally
AFOverwrite.Free;
end;
@@ -2453,7 +2455,7 @@ begin
s := ReplaceStr(MountCommand, '%dev', Device);
s := ReplaceStr(s, '%dir', MountPath);
end;
- Result := HandleSystemCommand(s, Format(LANGErrorMount, [ANSIToUTF8(MountPath)]));
+ Result := HandleSystemCommand(s, Format(LANGErrorMount, [StrToUTF8(MountPath)]));
end;
function TMounterItem.Umount: boolean;
@@ -2466,7 +2468,7 @@ begin
s := ReplaceStr(UmountCommand, '%dev', Device);
s := ReplaceStr(s, '%dir', MountPath);
end;
- Result := HandleSystemCommand(s, Format(LANGErrorUmount, [ANSIToUTF8(MountPath)]));
+ Result := HandleSystemCommand(s, Format(LANGErrorUmount, [StrToUTF8(MountPath)]));
end;
function TMounterItem.Eject: boolean;
@@ -2479,7 +2481,7 @@ begin
s := ReplaceStr(UmountCommand, '%dev', Device);
s := ReplaceStr(s, '%dir', MountPath);
end;
- Result := HandleSystemCommand(s, Format(LANGErrorEject, [ANSIToUTF8(MountPath)]));
+ Result := HandleSystemCommand(s, Format(LANGErrorEject, [StrToUTF8(MountPath)]));
end;
(********************************************************************************************************************************)
@@ -2547,7 +2549,7 @@ var t: __time_t;
if not Assigned(Item) then Exit;
Data := Item.Data;
if (not Assigned(Data)) or (not Data^.IsDir) then Exit;
- APath := IncludeTrailingPathDelimiter(Engine.Path) + string(Data^.AName);
+ APath := IncludeTrailingPathDelimiter(Engine.Path) + string(Data^.FName);
{ List := TList.Create;
Engine.FillDirFiles(APath, List, 1);
@@ -2578,7 +2580,7 @@ var t: __time_t;
if (ASize < 0) or FMainEscPressed or (Assigned(FRemoteWait) and FRemoteWait.Cancelled) then Exit;
Data^.Size := ASize;
- s := ANSIToUTF8(FormatSize(ASize, 0));
+ s := FormatSize(ASize, 0);
Libc.free(Data^.ColumnData[3]);
// Data^.ColumnData[3] := Libc.malloc(Length(s) + 1);
// Libc.memset(Data^.ColumnData[3], 0, Length(s) + 1);