1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix: Call 'tr' in place, where text is accessible

This commit is contained in:
Diadlo 2019-04-17 09:52:54 +03:00
parent 8e13d96aa6
commit 15d72a9610
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
2 changed files with 6 additions and 12 deletions

View File

@ -72,12 +72,6 @@ const QString ChatForm::ACTION_PREFIX = QStringLiteral("/me ");
namespace
{
QString statusToString(const Status status)
{
QString result;
return ChatForm::tr(Widget::getStatusTitle(status).toLatin1().data(), "contact status");
}
QString secondsToDHMS(quint32 duration)
{
QString res;
@ -635,7 +629,7 @@ void ChatForm::onFriendStatusChanged(uint32_t friendId, Status status)
updateCallButtons();
if (Settings::getInstance().getStatusChangeNotificationEnabled()) {
QString fStatus = statusToString(status);
QString fStatus = Widget::getStatusTitle(status);
addSystemInfoMessage(tr("%1 is now %2", "e.g. \"Dubslow is now online\"")
.arg(f->getDisplayedName())
.arg(fStatus),

View File

@ -2266,15 +2266,15 @@ QString Widget::getStatusTitle(Status status)
{
switch (status) {
case Status::Online:
return QStringLiteral("online");
return tr("online", "contact status");
case Status::Away:
return QStringLiteral("away");
return tr("away", "contact status");
case Status::Busy:
return QStringLiteral("busy");
return tr("busy", "contact status");
case Status::Offline:
return QStringLiteral("offline");
return tr("offline", "contact status");
case Status::Blocked:
return QStringLiteral("blocked");
return tr("blocked", "contact status");
}
assert(false);