Merge branch 'qt-512' into 'material'

Qt 512

See merge request b0/spectral!33
This commit is contained in:
Black Hat 2018-12-15 02:56:10 +00:00
commit 076c501605
38 changed files with 172 additions and 186 deletions

View File

@ -1,4 +1,4 @@
import QtQuick 2.9 import QtQuick 2.12
ListView { ListView {
ScrollHelper { ScrollHelper {

View File

@ -1,4 +1,4 @@
import QtQuick 2.9 import QtQuick 2.12
import Spectral.Setting 0.1 import Spectral.Setting 0.1

View File

@ -1,5 +1,5 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
TextField { TextField {
selectByMouse: true selectByMouse: true

View File

@ -1,5 +1,5 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
Item { Item {

View File

@ -1,7 +1,7 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.4
import Spectral.Component 2.0 import Spectral.Component 2.0

View File

@ -1,7 +1,7 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.4
import Spectral.Setting 0.1 import Spectral.Setting 0.1
import Spectral.Font 0.1 import Spectral.Font 0.1

View File

@ -1,5 +1,5 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
MouseArea { MouseArea {
id: root id: root

View File

@ -37,8 +37,8 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import Spectral.Setting 0.1 import Spectral.Setting 0.1

View File

@ -1,6 +1,6 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.4
import Qt.labs.platform 1.0 import Qt.labs.platform 1.0
Item { Item {

View File

@ -1,7 +1,7 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.4
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import Spectral 0.1 import Spectral 0.1
@ -11,8 +11,6 @@ import Spectral.Component 2.0
import Spectral.Font 0.1 import Spectral.Font 0.1
ColumnLayout { ColumnLayout {
readonly property int alignment: sentByMe ? Qt.AlignRight : Qt.AlignLeft
readonly property bool avatarVisible: !sentByMe && (aboveAuthor !== author || aboveSection !== section || aboveEventType === "state" || aboveEventType === "emote" || aboveEventType === "other") readonly property bool avatarVisible: !sentByMe && (aboveAuthor !== author || aboveSection !== section || aboveEventType === "state" || aboveEventType === "emote" || aboveEventType === "other")
readonly property bool sentByMe: author === currentRoom.localUser readonly property bool sentByMe: author === currentRoom.localUser
@ -75,7 +73,6 @@ ColumnLayout {
source: "image://mxc/" + (content.thumbnail_url ? content.thumbnail_url : content.url) source: "image://mxc/" + (content.thumbnail_url ? content.thumbnail_url : content.url)
sourceSize.width: Math.min(256, messageListView.width) sourceSize.width: Math.min(256, messageListView.width)
sourceSize.height: 256
layer.enabled: true layer.enabled: true
layer.effect: OpacityMask { layer.effect: OpacityMask {

View File

@ -1,7 +1,7 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.4
import Spectral 0.1 import Spectral 0.1
import Spectral.Setting 0.1 import Spectral.Setting 0.1
@ -10,14 +10,14 @@ import Spectral.Component 2.0
import Spectral.Font 0.1 import Spectral.Font 0.1
ColumnLayout { ColumnLayout {
readonly property int alignment: sentByMe ? Qt.AlignRight : Qt.AlignLeft
readonly property bool avatarVisible: !sentByMe && (aboveAuthor !== author || aboveSection !== section || aboveEventType === "state" || aboveEventType === "emote" || aboveEventType === "other") readonly property bool avatarVisible: !sentByMe && (aboveAuthor !== author || aboveSection !== section || aboveEventType === "state" || aboveEventType === "emote" || aboveEventType === "other")
readonly property bool sentByMe: author === currentRoom.localUser readonly property bool sentByMe: author === currentRoom.localUser
signal saveFileAs() signal saveFileAs()
signal openExternally() signal openExternally()
Layout.alignment: sentByMe ? Qt.AlignRight : Qt.AlignLeft
id: root id: root
spacing: 0 spacing: 0
@ -34,8 +34,6 @@ ColumnLayout {
} }
RowLayout { RowLayout {
Layout.alignment: sentByMe ? Qt.AlignRight : Qt.AlignLeft
z: -5 z: -5
id: messageRow id: messageRow
@ -70,10 +68,8 @@ ColumnLayout {
Control { Control {
Layout.maximumWidth: messageListView.width - (!sentByMe ? 32 + messageRow.spacing : 0) - 48 Layout.maximumWidth: messageListView.width - (!sentByMe ? 32 + messageRow.spacing : 0) - 48
topPadding: 8 verticalPadding: 8
bottomPadding: 8 horizontalPadding: 16
leftPadding: 16
rightPadding: 16
background: Rectangle { background: Rectangle {
color: sentByMe ? "#009DC2" : eventType === "notice" ? "#4285F4" : "#673AB7" color: sentByMe ? "#009DC2" : eventType === "notice" ? "#4285F4" : "#673AB7"

View File

@ -1,5 +1,5 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
Label { Label {
text: section + " • " + Qt.formatTime(time, "hh:mm") text: section + " • " + Qt.formatTime(time, "hh:mm")

View File

@ -1,13 +1,11 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.4
import Spectral.Setting 0.1 import Spectral.Setting 0.1
Label { Label {
readonly property int alignment: Qt.AlignHCenter
text: "<b>" + author.displayName + "</b> " + display text: "<b>" + author.displayName + "</b> " + display
color: Material.accent color: Material.accent

View File

@ -1,34 +0,0 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
Item {
property alias source: baseImage.source
property alias sourceSize: baseImage.sourceSize.width
readonly property bool loading: baseImage.status == Image.Loading
signal clicked()
width: loading ? 128 : baseImage.implicitWidth
height: loading ? progressBar.height : baseImage.implicitHeight
id: rekt
Image { id: baseImage }
ProgressBar {
width: parent.width
visible: loading
id: progressBar
indeterminate: true
}
MouseArea {
anchors.fill: parent
propagateComposedEvents: true
onClicked: rekt.clicked()
}
}

View File

@ -1,17 +0,0 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.2
import Spectral.Setting 0.1
Label {
property bool coloredBackground
color: coloredBackground ? "white": Material.foreground
wrapMode: Label.Wrap
linkColor: coloredBackground ? "white" : Material.accent
textFormat: Text.RichText
onLinkActivated: Qt.openUrlExternally(link)
}

View File

@ -2,3 +2,4 @@ module Spectral.Component.Timeline
MessageDelegate 2.0 MessageDelegate.qml MessageDelegate 2.0 MessageDelegate.qml
StateDelegate 2.0 StateDelegate.qml StateDelegate 2.0 StateDelegate.qml
SectionDelegate 2.0 SectionDelegate.qml SectionDelegate 2.0 SectionDelegate.qml
ImageDelegate 2.0 ImageDelegate.qml

View File

@ -1,4 +1,4 @@
import QtQuick 2.9 import QtQuick 2.12
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
Item { Item {

View File

@ -1,4 +1,4 @@
import QtQuick 2.9 import QtQuick 2.12
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
/*! /*!

View File

@ -1,5 +1,5 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import Spectral.Component 2.0 import Spectral.Component 2.0

View File

@ -1,6 +1,6 @@
pragma Singleton pragma Singleton
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
Item { Item {
property alias font: materialLabel.font property alias font: materialLabel.font

View File

@ -1,5 +1,5 @@
pragma Singleton pragma Singleton
import QtQuick 2.9 import QtQuick 2.12
FontLoader { FontLoader {
source: "qrc:/assets/font/material.ttf" source: "qrc:/assets/font/material.ttf"

View File

@ -1,5 +1,5 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
Menu { Menu {
property var root: null property var root: null

View File

@ -1,5 +1,5 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import Spectral 0.1 import Spectral 0.1
Menu { Menu {

View File

@ -1,6 +1,6 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Spectral.Component 2.0 import Spectral.Component 2.0
@ -48,7 +48,7 @@ Drawer {
wrapMode: Label.Wrap wrapMode: Label.Wrap
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: room ? room.memberCount + " Members" : "No Member Count" text: room ? room.totalMemberCount + " Members" : "No Member Count"
} }
RowLayout { RowLayout {

View File

@ -1,7 +1,7 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.4
import Spectral 0.1 import Spectral 0.1
import Spectral.Effect 2.0 import Spectral.Effect 2.0

View File

@ -1,8 +1,8 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.4
import Spectral.Component 2.0 import Spectral.Component 2.0
import Spectral.Menu 2.0 import Spectral.Menu 2.0
@ -813,7 +813,11 @@ Rectangle {
inviteDialog.currentRoom = currentRoom inviteDialog.currentRoom = currentRoom
inviteDialog.open() inviteDialog.open()
} else { } else {
if (enteredRoom) {
enteredRoom.displayed = false
leaveRoom(enteredRoom) leaveRoom(enteredRoom)
}
currentRoom.displayed = true
enterRoom(currentRoom) enterRoom(currentRoom)
enteredRoom = currentRoom enteredRoom = currentRoom
} }

View File

@ -1,7 +1,8 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.4
import Qt.labs.qmlmodels 1.0
import Spectral.Component 2.0 import Spectral.Component 2.0
import Spectral.Component.Emoji 2.0 import Spectral.Component.Emoji 2.0
@ -121,12 +122,13 @@ Item {
} }
} }
delegate: DelegateChooser {
role: "eventType"
DelegateChoice {
roleValue: "state"
delegate: ColumnLayout { delegate: ColumnLayout {
width: parent.width width: messageListView.width
implicitHeight: 32
id: delegateColumn
spacing: 4 spacing: 4
SectionDelegate { SectionDelegate {
@ -136,51 +138,86 @@ Item {
visible: section !== aboveSection || Math.abs(time - aboveTime) > 600000 visible: section !== aboveSection || Math.abs(time - aboveTime) > 600000
} }
Loader { StateDelegate {
Layout.maximumWidth: delegateColumn.width Layout.maximumWidth: parent.width
Layout.alignment: item ? item.alignment : 0
source: {
switch (eventType) {
case "message":
case "notice":
return "qrc:/imports/Spectral/Component/Timeline/MessageDelegate.qml"
case "emote":
case "state":
return "qrc:/imports/Spectral/Component/Timeline/StateDelegate.qml"
case "image":
return "qrc:/imports/Spectral/Component/Timeline/ImageDelegate.qml"
default:
return ""
}
}
}
// Read marker
RowLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
}
visible: readMarker === true }
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 2
color: Material.accent
} }
Label { DelegateChoice {
text: "And Now" roleValue: "emote"
color: Material.accent delegate: ColumnLayout {
verticalAlignment: Text.AlignVCenter width: messageListView.width
spacing: 4
SectionDelegate {
Layout.alignment: Qt.AlignHCenter
Layout.margins: 4
visible: section !== aboveSection || Math.abs(time - aboveTime) > 600000
} }
Rectangle { StateDelegate {
Layout.fillWidth: true Layout.maximumWidth: parent.width
Layout.preferredHeight: 2 Layout.alignment: Qt.AlignHCenter
}
}
}
color: Material.accent DelegateChoice {
roleValue: "message"
delegate: ColumnLayout {
width: messageListView.width
spacing: 4
SectionDelegate {
Layout.alignment: Qt.AlignHCenter
Layout.margins: 4
visible: section !== aboveSection || Math.abs(time - aboveTime) > 600000
}
MessageDelegate {
}
}
}
DelegateChoice {
roleValue: "notice"
delegate: ColumnLayout {
width: messageListView.width
spacing: 4
SectionDelegate {
Layout.alignment: Qt.AlignHCenter
Layout.margins: 4
visible: section !== aboveSection || Math.abs(time - aboveTime) > 600000
}
MessageDelegate {
}
}
}
DelegateChoice {
roleValue: "image"
delegate: ColumnLayout {
width: messageListView.width
spacing: 4
SectionDelegate {
Layout.alignment: Qt.AlignHCenter
Layout.margins: 4
visible: section !== aboveSection || Math.abs(time - aboveTime) > 600000
}
ImageDelegate {
Layout.maximumWidth: parent.width
Layout.alignment: Qt.AlignHCenter
}
} }
} }
} }
@ -236,21 +273,19 @@ Item {
Popup { Popup {
property string sourceText property string sourceText
x: (window.width - width) / 2 anchors.centerIn: parent
y: (window.height - height) / 2
width: 480 width: 480
id: sourceDialog id: sourceDialog
parent: ApplicationWindow.overlay parent: ApplicationWindow.overlay
modal: true
padding: 16 padding: 16
closePolicy: Dialog.CloseOnEscape | Dialog.CloseOnPressOutside closePolicy: Dialog.CloseOnEscape | Dialog.CloseOnPressOutside
contentItem: ScrollView { contentItem: ScrollView {
clip: true
TextArea { TextArea {
readOnly: true readOnly: true
selectByMouse: true selectByMouse: true
@ -328,7 +363,7 @@ Item {
function goToEvent(eventID) { function goToEvent(eventID) {
var index = messageEventModel.eventIDToIndex(eventID) var index = messageEventModel.eventIDToIndex(eventID)
if (index === -1) return if (index === -1) return
// messageListView.currentIndex = sortedMessageEventModel.mapFromSource(index) // messageListView.currentIndex = sortedMessageEventModel.mapFromSource(index)
messageListView.positionViewAtIndex(sortedMessageEventModel.mapFromSource(index), ListView.Contain) messageListView.positionViewAtIndex(sortedMessageEventModel.mapFromSource(index), ListView.Contain)
} }

View File

@ -1,7 +1,7 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.4
import Spectral.Component 2.0 import Spectral.Component 2.0
import Spectral.Component.Emoji 2.0 import Spectral.Component.Emoji 2.0
@ -167,6 +167,8 @@ Control {
spacing: 0 spacing: 0
ToolButton { ToolButton {
Layout.preferredWidth: 48
Layout.preferredHeight: 48
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
id: uploadButton id: uploadButton
@ -186,6 +188,8 @@ Control {
} }
ToolButton { ToolButton {
Layout.preferredWidth: 48
Layout.preferredHeight: 48
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
id: cancelReplyButton id: cancelReplyButton
@ -364,6 +368,8 @@ Control {
} }
ToolButton { ToolButton {
Layout.preferredWidth: 48
Layout.preferredHeight: 48
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
id: emojiButton id: emojiButton

View File

@ -1,5 +1,5 @@
pragma Singleton pragma Singleton
import QtQuick 2.9 import QtQuick 2.12
import Qt.labs.settings 1.0 import Qt.labs.settings 1.0
Settings { Settings {

@ -1 +1 @@
Subproject commit 52081fe91724e5f2a82c55f0e6230d8841dd859a Subproject commit fcc8d2ca615fce6e42bf1cf6585d60f94a2db926

View File

@ -1,7 +1,7 @@
import QtQuick 2.9 import QtQuick 2.12
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.4
import Qt.labs.settings 1.0 import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as Platform import Qt.labs.platform 1.0 as Platform

View File

@ -7,6 +7,7 @@ Style=Material
[Material] [Material]
Theme=Light Theme=Light
Variant=Dense
Primary=#344955 Primary=#344955
Accent=#673AB7 Accent=#673AB7
Foreground=#1D333E Foreground=#1D333E

View File

@ -33,8 +33,6 @@
<file>imports/Spectral/Panel/RoomHeader.qml</file> <file>imports/Spectral/Panel/RoomHeader.qml</file>
<file>imports/Spectral/Component/ScrollHelper.qml</file> <file>imports/Spectral/Component/ScrollHelper.qml</file>
<file>imports/Spectral/Component/AutoListView.qml</file> <file>imports/Spectral/Component/AutoListView.qml</file>
<file>imports/Spectral/Component/Timeline/TimelineImage.qml</file>
<file>imports/Spectral/Component/Timeline/TimelineLabel.qml</file>
<file>imports/Spectral/Component/AutoTextField.qml</file> <file>imports/Spectral/Component/AutoTextField.qml</file>
<file>imports/Spectral/Panel/RoomPanelInput.qml</file> <file>imports/Spectral/Panel/RoomPanelInput.qml</file>
<file>imports/Spectral/Component/SplitView.qml</file> <file>imports/Spectral/Component/SplitView.qml</file>

View File

@ -42,7 +42,12 @@ Controller::Controller(QObject* parent)
QTimer::singleShot(0, this, SLOT(invokeLogin())); QTimer::singleShot(0, this, SLOT(invokeLogin()));
} }
Controller::~Controller() {} Controller::~Controller() {
for (Connection* c : m_connections) {
c->stopSync();
c->saveState();
}
}
inline QString accessTokenFileName(const AccountSettings& account) { inline QString accessTokenFileName(const AccountSettings& account) {
QString fileName = account.userId(); QString fileName = account.userId();
@ -107,6 +112,8 @@ void Controller::addConnection(Connection* c) {
m_connections.push_back(c); m_connections.push_back(c);
c->setLazyLoading(true);
connect(c, &Connection::syncDone, this, [=] { connect(c, &Connection::syncDone, this, [=] {
emit syncDone(); emit syncDone();
c->sync(30000); c->sync(30000);

View File

@ -29,6 +29,7 @@ QImage ImageProvider::requestImage(const QString& id, QSize* pSize,
QUrl mxcUri{id}; QUrl mxcUri{id};
QImage result = image(mxcUri, requestedSize); QImage result = image(mxcUri, requestedSize);
if (result.isNull()) return {};
if (!requestedSize.isEmpty() && result.size() != requestedSize) { if (!requestedSize.isEmpty() && result.size() != requestedSize) {
QImage scaled = result.scaled(requestedSize, Qt::KeepAspectRatio, QImage scaled = result.scaled(requestedSize, Qt::KeepAspectRatio,
Qt::SmoothTransformation); Qt::SmoothTransformation);

View File

@ -195,8 +195,6 @@ QDateTime SpectralRoom::lastActiveTime() {
return messageEvents().rbegin()->get()->timestamp(); return messageEvents().rbegin()->get()->timestamp();
} }
float SpectralRoom::orderForTag(QString name) { return tag(name).order; }
int SpectralRoom::savedTopVisibleIndex() const { int SpectralRoom::savedTopVisibleIndex() const {
return firstDisplayedMarker() == timelineEdge() return firstDisplayedMarker() == timelineEdge()
? 0 ? 0

View File

@ -66,7 +66,6 @@ class SpectralRoom : public Room {
} }
} }
Q_INVOKABLE float orderForTag(QString name);
Q_INVOKABLE int savedTopVisibleIndex() const; Q_INVOKABLE int savedTopVisibleIndex() const;
Q_INVOKABLE int savedBottomVisibleIndex() const; Q_INVOKABLE int savedBottomVisibleIndex() const;
Q_INVOKABLE void saveViewport(int topIndex, int bottomIndex); Q_INVOKABLE void saveViewport(int topIndex, int bottomIndex);

View File

@ -34,12 +34,8 @@ void UserListModel::setRoom(QMatrixClient::Room* room) {
connect(m_currentRoom, &Room::memberRenamed, this, connect(m_currentRoom, &Room::memberRenamed, this,
&UserListModel::userAdded); &UserListModel::userAdded);
{ {
QElapsedTimer et;
et.start();
m_users = m_currentRoom->users(); m_users = m_currentRoom->users();
std::sort(m_users.begin(), m_users.end(), room->memberSorter()); std::sort(m_users.begin(), m_users.end(), room->memberSorter());
qDebug() << "Sorting" << m_users.size() << "user(s) in"
<< m_currentRoom->displayName() << "took" << et;
} }
for (User* user : m_users) { for (User* user : m_users) {
connect(user, &User::avatarChanged, this, &UserListModel::avatarChanged); connect(user, &User::avatarChanged, this, &UserListModel::avatarChanged);