Updates based on comments

This commit is contained in:
James Graham
2023-07-31 17:48:00 +01:00
parent 980211f36a
commit 648fff20f2
6 changed files with 20 additions and 5 deletions

View File

@@ -651,5 +651,5 @@ void TextHandlerTest::linkPreviewsReject()
QCOMPARE(testTextHandler.getLinkPreviews(), testOutputLinks); QCOMPARE(testTextHandler.getLinkPreviews(), testOutputLinks);
} }
QTEST_MAIN(TextHandlerTest) QTEST_APPLESS_MAIN(TextHandlerTest)
#include "texthandlertest.moc" #include "texthandlertest.moc"

View File

@@ -60,7 +60,6 @@ Controller::Controller(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
Connection::setRoomType<NeoChatRoom>(); Connection::setRoomType<NeoChatRoom>();
Connection::setUserType<User>();
setApplicationProxy(); setApplicationProxy();

View File

@@ -3,6 +3,8 @@
#include "locationsmodel.h" #include "locationsmodel.h"
#include <QGuiApplication>
using namespace Quotient; using namespace Quotient;
LocationsModel::LocationsModel(QObject *parent) LocationsModel::LocationsModel(QObject *parent)
@@ -43,6 +45,10 @@ LocationsModel::LocationsModel(QObject *parent)
}); });
connect(this, &LocationsModel::rowsInserted, this, &LocationsModel::boundingBoxChanged); connect(this, &LocationsModel::rowsInserted, this, &LocationsModel::boundingBoxChanged);
connect(static_cast<QGuiApplication *>(QGuiApplication::instance()), &QGuiApplication::paletteChanged, this, [this] {
Q_EMIT dataChanged(index(0, 0), index(rowCount() - 1, 0), {AuthorRole});
});
} }
void LocationsModel::addLocation(const RoomMessageEvent *event) void LocationsModel::addLocation(const RoomMessageEvent *event)

View File

@@ -77,7 +77,7 @@ MessageEventModel::MessageEventModel(QObject *parent)
: QAbstractListModel(parent) : QAbstractListModel(parent)
{ {
connect(static_cast<QGuiApplication *>(QGuiApplication::instance()), &QGuiApplication::paletteChanged, this, [this] { connect(static_cast<QGuiApplication *>(QGuiApplication::instance()), &QGuiApplication::paletteChanged, this, [this] {
Q_EMIT dataChanged(index(0, 0), index(rowCount() - 1, 0), {AuthorRole, ReplyRole}); Q_EMIT dataChanged(index(0, 0), index(rowCount() - 1, 0), {AuthorRole, ReplyAuthor, ReadMarkersRole});
}); });
} }

View File

@@ -5,12 +5,14 @@
#include "messageeventmodel.h" #include "messageeventmodel.h"
#include "neochatroom.h" #include "neochatroom.h"
#include <QGuiApplication>
#include <Quotient/connection.h>
#include <Quotient/events/stickerevent.h> #include <Quotient/events/stickerevent.h>
#include <KLocalizedString> #include <KLocalizedString>
#include <Quotient/connection.h>
using namespace Quotient; using namespace Quotient;
// TODO search only in the current room // TODO search only in the current room
@@ -18,6 +20,9 @@ using namespace Quotient;
SearchModel::SearchModel(QObject *parent) SearchModel::SearchModel(QObject *parent)
: QAbstractListModel(parent) : QAbstractListModel(parent)
{ {
connect(static_cast<QGuiApplication *>(QGuiApplication::instance()), &QGuiApplication::paletteChanged, this, [this] {
Q_EMIT dataChanged(index(0, 0), index(rowCount() - 1, 0), {AuthorRole, ReadMarkersRole});
});
} }
QString SearchModel::searchText() const QString SearchModel::searchText() const

View File

@@ -3,6 +3,8 @@
#include "userlistmodel.h" #include "userlistmodel.h"
#include <QGuiApplication>
#include <Quotient/connection.h> #include <Quotient/connection.h>
#include <Quotient/events/roompowerlevelsevent.h> #include <Quotient/events/roompowerlevelsevent.h>
@@ -14,6 +16,9 @@ UserListModel::UserListModel(QObject *parent)
: QAbstractListModel(parent) : QAbstractListModel(parent)
, m_currentRoom(nullptr) , m_currentRoom(nullptr)
{ {
connect(static_cast<QGuiApplication *>(QGuiApplication::instance()), &QGuiApplication::paletteChanged, this, [this]() {
refreshAllUsers();
});
} }
void UserListModel::setRoom(NeoChatRoom *room) void UserListModel::setRoom(NeoChatRoom *room)