diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2013-05-01 02:42:50 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2013-05-01 02:42:50 +0200 |
commit | 5c3ba8460a9784acb784337a2c11b5175fd7c011 (patch) | |
tree | 119f4c0010bba0383adced817ef921a986754bf8 /forummodel.cpp | |
parent | c6f60740cc4ca2db17b415e77008cbc5c347f9d7 (diff) | |
download | tapasboard-5c3ba8460a9784acb784337a2c11b5175fd7c011.tar.gz tapasboard-5c3ba8460a9784acb784337a2c11b5175fd7c011.zip |
rewrite date/time formatting
Diffstat (limited to 'forummodel.cpp')
-rw-r--r-- | forummodel.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/forummodel.cpp b/forummodel.cpp index 73482e4..193df46 100644 --- a/forummodel.cpp +++ b/forummodel.cpp @@ -18,7 +18,7 @@ ForumModel::ForumModel(QObject *parent) : roles[TopicTypeRole] = QByteArray("topicType"); roles[LastReplyTimeRole] = QByteArray("lastReplyTime"); roles[NumRepliesRole] = QByteArray("numReplies"); - roles[HumanDateRole] = QByteArray("humanDate"); + roles[RelativeDateRole] = QByteArray("relativeDate"); roles[UnreadRole] = QByteArray("unread"); setRoleNames(roles); } @@ -99,14 +99,15 @@ QVariant ForumModel::data(const QModelIndex &index, int role) const return _data[row].last_reply_time; case NumRepliesRole: return _data[row].num_replies; - case HumanDateRole: + case RelativeDateRole: switch (_data[row].type) { case Board::Announcement: return tr("Announcement"); case Board::Sticky: return tr("Sticky"); default: - return _board->renderHumanDate(_data[row].last_reply_time, true); + return _board->formatDateTime(_data[row].last_reply_time, + Board::RelativeDate); } case UnreadRole: return _data[row].unread; |