mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 13:19:21 +02:00
Fixes for TShellListView
git-svn-id: trunk@19773 -
This commit is contained in:
parent
7902442395
commit
fd610ecf4b
@ -553,7 +553,7 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
Files: TStringList;
|
Files: TStringList;
|
||||||
NewItem: TListItem;
|
NewItem: TListItem;
|
||||||
CurFileName: string;
|
CurFileName, CurFilePath: string;
|
||||||
CurFileSize: Int64;
|
CurFileSize: Int64;
|
||||||
begin
|
begin
|
||||||
// Check inputs
|
// Check inputs
|
||||||
@ -567,16 +567,17 @@ begin
|
|||||||
begin
|
begin
|
||||||
NewItem := Items.Add;
|
NewItem := Items.Add;
|
||||||
CurFileName := Files.Strings[i];
|
CurFileName := Files.Strings[i];
|
||||||
|
CurFilePath := IncludeTrailingPathDelimiter(FRoot) + CurFileName;
|
||||||
// First column - Name
|
// First column - Name
|
||||||
NewItem.Caption := CurFileName;
|
NewItem.Caption := CurFileName;
|
||||||
// Second column - Size
|
// Second column - Size
|
||||||
CurFileSize := FileSize(FRoot + CurFileName); // in Bytes
|
CurFileSize := FileSize(CurFilePath); // in Bytes
|
||||||
if CurFileSize < 1024 then
|
if CurFileSize < 1024 then
|
||||||
NewItem.SubItems.Add(IntToStr(CurFileSize) + ' bytes')
|
NewItem.SubItems.Add(IntToStr(CurFileSize) + ' bytes')
|
||||||
else if CurFileSize < 1024 * 1024 then
|
else if CurFileSize < 1024 * 1024 then
|
||||||
NewItem.SubItems.Add(IntToStr(CurFileSize div 1024) + ' kB')
|
NewItem.SubItems.Add(IntToStr(CurFileSize div 1024) + ' kB')
|
||||||
else
|
else
|
||||||
NewItem.SubItems.Add(IntToStr(CurFileSize div 1024) + ' MB');
|
NewItem.SubItems.Add(IntToStr(CurFileSize div (1024 * 1024)) + ' MB');
|
||||||
// Third column - Type
|
// Third column - Type
|
||||||
NewItem.SubItems.Add(ExtractFileExt(CurFileName));
|
NewItem.SubItems.Add(ExtractFileExt(CurFileName));
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user