mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Use less operations when building strings
This commit is contained in:
parent
0fe9cd05c4
commit
49df1cd3c7
3 changed files with 23 additions and 22 deletions
|
@ -402,11 +402,9 @@ void AddNewTorrentDialog::updateDiskSpaceLabel()
|
|||
}
|
||||
}
|
||||
|
||||
QString sizeString = torrentSize ? Utils::Misc::friendlyUnit(torrentSize) : QString(tr("Not Available", "This size is unavailable."));
|
||||
sizeString += " (";
|
||||
sizeString += tr("Free space on disk: %1").arg(Utils::Misc::friendlyUnit(Utils::Fs::freeDiskSpaceOnPath(
|
||||
m_ui->savePath->selectedPath())));
|
||||
sizeString += ')';
|
||||
const QString sizeString = tr("%1 (Free space on disk: %2)").arg(
|
||||
((torrentSize > 0) ? Utils::Misc::friendlyUnit(torrentSize) : tr("Not available", "This size is unavailable."))
|
||||
, Utils::Misc::friendlyUnit(Utils::Fs::freeDiskSpaceOnPath(m_ui->savePath->selectedPath())));
|
||||
m_ui->labelSizeData->setText(sizeString);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue