From 6030b083b131cb367971eb205403d80764c2564e Mon Sep 17 00:00:00 2001 From: a68366 Date: Thu, 7 Jul 2016 00:55:23 +0300 Subject: [PATCH] fix(groupinviteform): consider dateTime format in group invites Closes #3058 --- src/widget/form/groupinviteform.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/widget/form/groupinviteform.cpp b/src/widget/form/groupinviteform.cpp index c0675d0d8..34778f904 100644 --- a/src/widget/form/groupinviteform.cpp +++ b/src/widget/form/groupinviteform.cpp @@ -29,6 +29,7 @@ #include #include #include "ui_mainwindow.h" +#include "src/persistence/settings.h" #include "src/widget/tool/croppinglabel.h" #include "src/widget/translator.h" #include "src/nexus.h" @@ -107,8 +108,10 @@ void GroupInviteForm::addGroupInvite(int32_t friendId, uint8_t type, QByteArray CroppingLabel* groupLabel = new CroppingLabel(this); groupLabels.insert(groupLabel); QString name = Nexus::getCore()->getFriendUsername(friendId); - QString time = QDateTime::currentDateTime().toString(); - groupLabel->setText(tr("Invited by %1 on %2.").arg(name, time)); + QDateTime currentDateTime = QDateTime::currentDateTime(); + QString date = currentDateTime.toString(Settings::getInstance().getDateFormat()); + QString time = currentDateTime.toString(Settings::getInstance().getTimestampFormat()); + groupLabel->setText(tr("Invited by %1 on %2 at %3.").arg(name, date, time)); groupLayout->addWidget(groupLabel); QPushButton* acceptButton = new QPushButton(this); @@ -206,8 +209,11 @@ void GroupInviteForm::retranslateGroupLabel(CroppingLabel* label) GroupInvite invite = groupInvites.at(index); QString name = Nexus::getCore()->getFriendUsername(invite.friendId); - QString date = invite.time.toString(); - label->setText(tr("Invited by %1 on %2.").arg(name, date)); + + QString date = invite.time.toString(Settings::getInstance().getDateFormat()); + QString time = invite.time.toString(Settings::getInstance().getTimestampFormat()); + + label->setText(tr("Invited by %1 on %2 at %3.").arg(name, date, time)); } void GroupInviteForm::retranslateAcceptButton(QPushButton* acceptButton)