mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-04 08:55:31 -05:00
parent
35af1c6695
commit
880621c1fb
@ -138,7 +138,9 @@ namespace Tools
|
||||
i++;
|
||||
}
|
||||
|
||||
return QString("%1 %2").arg(QLocale().toString(size, 'f', precision), units.at(i));
|
||||
// do not display decimals for smallest unit bytes identified by index i==0
|
||||
const quint32 displayPrecision = (i == 0 ? 0 : precision);
|
||||
return QString("%1 %2").arg(QLocale().toString(size, 'f', displayPrecision), units.at(i));
|
||||
}
|
||||
|
||||
QString humanReadableTimeDifference(qint64 seconds)
|
||||
|
@ -2113,7 +2113,7 @@ void TestCli::testShow()
|
||||
"Tags: \n"
|
||||
"\n"
|
||||
"Attachments:\n"
|
||||
" Sample attachment.txt (15.0 B)\n"));
|
||||
" Sample attachment.txt (15 B)\n"));
|
||||
|
||||
setInput("a");
|
||||
execCmd(showCmd, {"show", m_dbFile->fileName(), "--show-attachments", "/Homebanking/Subgroup/Subgroup Entry"});
|
||||
|
@ -38,7 +38,7 @@ void TestTools::testHumanReadableFileSize()
|
||||
constexpr auto kibibyte = 1024u;
|
||||
using namespace Tools;
|
||||
|
||||
QCOMPARE(createDecimal("1", "00", "B"), humanReadableFileSize(1));
|
||||
QCOMPARE(QString("1 B"), humanReadableFileSize(1));
|
||||
QCOMPARE(createDecimal("1", "00", "KiB"), humanReadableFileSize(kibibyte));
|
||||
QCOMPARE(createDecimal("1", "00", "MiB"), humanReadableFileSize(kibibyte * kibibyte));
|
||||
QCOMPARE(createDecimal("1", "00", "GiB"), humanReadableFileSize(kibibyte * kibibyte * kibibyte));
|
||||
|
Loading…
x
Reference in New Issue
Block a user