1 files changed, 14 insertions, 4 deletions
diff --git a/src/dialogs/ReadReceipts.cpp b/src/dialogs/ReadReceipts.cpp
index 0edd1ebf..7dcffc28 100644
--- a/src/dialogs/ReadReceipts.cpp
+++ b/src/dialogs/ReadReceipts.cpp
@@ -1,5 +1,6 @@
#include <QDebug>
#include <QIcon>
+#include <QLabel>
#include <QListWidgetItem>
#include <QPainter>
#include <QPushButton>
@@ -74,15 +75,17 @@ ReceiptItem::dateFormat(const QDateTime &then) const
auto days = then.daysTo(now);
if (days == 0)
- return tr("Today %1").arg(then.time().toString(Qt::DefaultLocaleShortDate));
+ return tr("Today %1")
+ .arg(QLocale::system().toString(then.time(), QLocale::ShortFormat));
else if (days < 2)
- return tr("Yesterday %1").arg(then.time().toString(Qt::DefaultLocaleShortDate));
+ return tr("Yesterday %1")
+ .arg(QLocale::system().toString(then.time(), QLocale::ShortFormat));
else if (days < 7)
return QString("%1 %2")
.arg(then.toString("dddd"))
- .arg(then.time().toString(Qt::DefaultLocaleShortDate));
+ .arg(QLocale::system().toString(then.time(), QLocale::ShortFormat));
- return then.toString(Qt::DefaultLocaleShortDate);
+ return QLocale::system().toString(then.time(), QLocale::ShortFormat);
}
ReadReceipts::ReadReceipts(QWidget *parent)
@@ -163,3 +166,10 @@ ReadReceipts::paintEvent(QPaintEvent *)
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
+
+void
+ReadReceipts::hideEvent(QHideEvent *event)
+{
+ userList_->clear();
+ QFrame::hideEvent(event);
+}
|