Show new messages on the bottom

Summary: Like every messaging app I know does

Test Plan: Compare message order with phone

Reviewers: #kde_connect, sredman

Reviewed By: #kde_connect, sredman

Subscribers: sredman, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D14638
This commit is contained in:
Nicolas Fella 2018-08-06 00:19:13 +02:00
parent 21b52d7dcf
commit 5f63f78f77
2 changed files with 10 additions and 5 deletions

View file

@ -44,6 +44,8 @@ public:
DateRole, DateRole,
}; };
Q_ENUMS(Roles)
QString threadId() const; QString threadId() const;
void setThreadId(const QString &threadId); void setThreadId(const QString &threadId);

View file

@ -39,11 +39,14 @@ Kirigami.ScrollablePage
title: person && person.name ? i18n("%1: %2", person.name, phoneNumber) : phoneNumber title: person && person.name ? i18n("%1: %2", person.name, phoneNumber) : phoneNumber
ListView { ListView {
model: QSortFilterProxyModel {
model: ConversationModel {
id: model id: model
deviceId: device.id() sortOrder: Qt.AscendingOrder
threadId: page.conversationId sortRole: ConversationModel.DateRole
sourceModel: ConversationModel {
deviceId: device.id()
threadId: page.conversationId
}
} }
spacing: Kirigami.Units.largeSpacing spacing: Kirigami.Units.largeSpacing
@ -62,7 +65,7 @@ Kirigami.ScrollablePage
placeholderText: i18n("Say hi...") placeholderText: i18n("Say hi...")
onAccepted: { onAccepted: {
console.log("sending sms", page.phoneNumber) console.log("sending sms", page.phoneNumber)
model.sendReplyToConversation(message.text) model.sourceModel.sendReplyToConversation(message.text)
text = "" text = ""
} }
} }