Commit 8c4049fe authored by Adriaan de Groot's avatar Adriaan de Groot 💬
Browse files

Update value (of application-used-memory) before using it.

The *used* and *total* values are computed before the answer
has been processed; then those values are used for writing
the strings to the UI, so they always reflect the **previous**
value of mUsedApplication. This is slightly suprising (only when
reading the code, though, since you're unlikely to notice these
memory variations from watching the UI).

Move the update-from-answer code up a bit.
parent 97811cdd
......@@ -477,9 +477,9 @@ void TopLevel::answerReceived( int id, const QList<QByteArray> &answerList )
case 4:
mUsedApplication = answer.toLongLong();
const auto used = KFormat().formatByteSize( mUsedApplication*1024);
const auto total = KFormat().formatByteSize( (mFree+mUsedTotal)*1024 );
mUsedApplication = answer.toLongLong();
//Use a multi-length string
s = i18nc( "Arguments are formatted byte sizes (used/total)", "Memory: %1 / %2", used, total );
s += "\xc2\x9c";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment