remove unnecessary calls to formaters

This commit is contained in:
simplepad 2024-04-28 22:14:53 +08:00
parent 18712f4855
commit acfa9a8dbd
No known key found for this signature in database
GPG Key ID: 00DB76DD9FB623EC
2 changed files with 4 additions and 4 deletions

View File

@ -1019,7 +1019,7 @@ void DetailsDialog::Impl::refreshInfo(std::vector<tr_torrent*> const& torrents)
if (failed != 0)
{
str = fmt::format(
_("{downloaded_size} (+{discarded_size} discarded after failed checksum)"),
_("{downloaded_size} verified (+{discarded_size} discarded after failed checksum)"),
fmt::arg("downloaded_size", downloaded_str),
fmt::arg("discarded_size", tr_strlsize(failed)));
}
@ -1068,7 +1068,7 @@ void DetailsDialog::Impl::refreshInfo(std::vector<tr_torrent*> const& torrents)
std::end(stats),
uint64_t{},
[](auto sum, auto const* st) { return sum + st->uploadedThisSession; });
str = fmt::format(_("{uploaded_size}"), fmt::arg("uploaded_size", tr_strlsize(uploaded)));
str = tr_strlsize(uploaded);
}
ul_ts_lb_->set_text(str);

View File

@ -669,10 +669,10 @@ void DetailsDialog::refreshUI()
}
QString const dstr = Formatter::storage_to_string(d);
QString const fstr = Formatter::storage_to_string(f);
if (f != 0)
{
QString const fstr = Formatter::storage_to_string(f);
string = tr("%1 (+%2 discarded after failed checksum)").arg(dstr).arg(fstr);
}
else
@ -720,7 +720,7 @@ void DetailsDialog::refreshUI()
uploaded_this_session += t->uploadedThisSession();
}
string = tr("%1").arg(Formatter::storage_to_string(uploaded_this_session));
string = Formatter::storage_to_string(uploaded_this_session);
}
ui_.uploadedThisSessionValueLabel->setText(string);