mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-01 03:19:23 +00:00
feat(Linphone/Chat): format correcly sections
This commit is contained in:
parent
5f4e3cf350
commit
0c7387f84f
2 changed files with 5 additions and 5 deletions
|
|
@ -21,10 +21,10 @@ QVariant ChatModel::data (const QModelIndex &index, int role) const {
|
|||
return QVariant();
|
||||
|
||||
switch (role) {
|
||||
case: Roles::ChatEntry
|
||||
case Roles::ChatEntry:
|
||||
return QVariant::fromValue(m_entries[row]);
|
||||
case: Roles::SectionDate
|
||||
return QVariant::fromValue(m_entries[row]["sectionDate"]);
|
||||
case Roles::SectionDate:
|
||||
return QVariant::fromValue(m_entries[row]["timestamp"].toDate());
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
|
|
@ -58,7 +58,7 @@ void ChatModel::setSipAddress (const QString &sip_address) {
|
|||
for (auto &message : chat_room->getHistory(0)) {
|
||||
QVariantMap map;
|
||||
|
||||
map["sectionDate"] = 1465389121;
|
||||
// UTC format.
|
||||
map["timestamp"] = QDateTime::fromTime_t(message->getTime());
|
||||
map["type"] = "message";
|
||||
map["content"] = Utils::linphoneStringToQString(
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ ColumnLayout {
|
|||
|
||||
// Cast section to integer because Qt converts the
|
||||
// sectionDate in string!!!
|
||||
text: new Date(+section).toLocaleDateString(
|
||||
text: new Date(section).toLocaleDateString(
|
||||
Qt.locale(App.locale())
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue