LCL/ShellCtrl: ShellListView can display file size in GB.

This commit is contained in:
wp_xyz 2025-01-19 16:40:41 +01:00
parent 8c094c3349
commit 8e3b710abb
29 changed files with 148 additions and 4 deletions

View File

@ -1530,6 +1530,11 @@ msgstr ""
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1470,6 +1470,11 @@ msgstr "%s ottetti"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1557,6 +1557,11 @@ msgstr "%s bajtů"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format, fuzzy
#| msgid ""

View File

@ -1523,6 +1523,11 @@ msgstr "%s Bytes"
msgid "Folder"
msgstr "Ordner"
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"
@ -1580,3 +1585,4 @@ msgstr "Größe"
#: lclstrconsts.sshellctrlstype
msgid "Type"
msgstr "Typ"

View File

@ -1463,6 +1463,11 @@ msgstr ""
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1548,6 +1548,11 @@ msgstr "%s bytes"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1545,6 +1545,11 @@ msgstr "%s tavua"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format, fuzzy
#| msgid ""

View File

@ -1557,6 +1557,11 @@ msgstr "%s octets"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1579,6 +1579,11 @@ msgstr ""
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1555,6 +1555,11 @@ msgstr "%s bájt"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1529,6 +1529,11 @@ msgstr ""
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1561,6 +1561,11 @@ msgstr ""
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1556,6 +1556,11 @@ msgstr "%s バイト"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format, fuzzy
#| msgid ""

View File

@ -1560,6 +1560,11 @@ msgstr "%s 바이트"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format, fuzzy
#| msgid ""

View File

@ -1558,6 +1558,11 @@ msgstr "%s baitų"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format, fuzzy
#| msgid ""

View File

@ -1563,6 +1563,11 @@ msgstr "%s bytes"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format, fuzzy
#| msgid ""

View File

@ -1528,6 +1528,11 @@ msgstr ""
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1558,6 +1558,11 @@ msgstr "%s bajtów"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format, fuzzy
#| msgid ""

View File

@ -1460,6 +1460,11 @@ msgstr ""
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1567,6 +1567,11 @@ msgstr "%s bytes"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format, fuzzy
#| msgid ""

View File

@ -1537,6 +1537,11 @@ msgstr "%s bytes"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1467,6 +1467,11 @@ msgstr "%s байт"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1469,6 +1469,11 @@ msgstr "%s bytov"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1537,6 +1537,11 @@ msgstr "%s byte"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1540,6 +1540,11 @@ msgstr "%s байтів"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1469,6 +1469,11 @@ msgstr "%s字节"
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -1467,6 +1467,11 @@ msgstr ""
msgid "Folder"
msgstr ""
#: lclstrconsts.sshellctrlsgb
#, object-pascal-format
msgid "%.1n GB"
msgstr ""
#: lclstrconsts.sshellctrlsinvalidpath
#, object-pascal-format
msgctxt "lclstrconsts.sshellctrlsinvalidpath"

View File

@ -319,6 +319,7 @@ resourceString
sShellCtrlsName = 'Name';
sShellCtrlsSize = 'Size';
sShellCtrlsType = 'Type';
sShellCtrlsGB = '%.1n GB';
sShellCtrlsMB = '%s MB';
sShellCtrlsKB = '%s kB';
sShellCtrlsBytes = '%s bytes';

View File

@ -447,14 +447,21 @@ begin
end;
function FileSizeToStr(AFileSize: Int64): String;
const
ONE_KB = 1024;
ONE_MB = 1024 * 1024;
ONE_GB = 1024 * 1024 * 1024;
begin
if AFileSize < 1024 then
if AFileSize < ONE_KB then
Result := Format(sShellCtrlsBytes, [IntToStr(AFileSize)])
else
if AFileSize < 1024 * 1024 then
Result := Format(sShellCtrlsKB, [IntToStr(AFileSize div 1024)])
if AFileSize < ONE_MB then
Result := Format(sShellCtrlsKB, [IntToStr(AFileSize div ONE_KB)])
else
Result := Format(sShellCtrlsMB, [IntToStr(AFileSize div (1024 * 1024))]);
if AFileSize < ONE_GB then
Result := Format(sShellCtrlsMB, [IntToStr(AFileSize div (ONE_MB))])
else
Result := Format(sShellCtrlsGB, [AFileSize / ONE_GB]);
end;
operator = (const A, B: TMethod): Boolean;