Skip to content
Snippets Groups Projects
Verified Commit 6ead7b0b authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Fix rooms failing to load over dbus if image can't be downloaded

parent af031385
No related branches found
No related tags found
No related merge requests found
Pipeline #3346 passed
...@@ -21,6 +21,8 @@ NhekoDBusBackend::NhekoDBusBackend(RoomlistModel *parent) ...@@ -21,6 +21,8 @@ NhekoDBusBackend::NhekoDBusBackend(RoomlistModel *parent)
QVector<nheko::dbus::RoomInfoItem> QVector<nheko::dbus::RoomInfoItem>
NhekoDBusBackend::rooms(const QDBusMessage &message) NhekoDBusBackend::rooms(const QDBusMessage &message)
{ {
message.setDelayedReply(true);
const auto roomListModel = m_parent->models; const auto roomListModel = m_parent->models;
QSharedPointer<QVector<nheko::dbus::RoomInfoItem>> model{ QSharedPointer<QVector<nheko::dbus::RoomInfoItem>> model{
new QVector<nheko::dbus::RoomInfoItem>}; new QVector<nheko::dbus::RoomInfoItem>};
...@@ -43,8 +45,8 @@ NhekoDBusBackend::rooms(const QDBusMessage &message) ...@@ -43,8 +45,8 @@ NhekoDBusBackend::rooms(const QDBusMessage &message)
room->roomId(), alias, room->roomName(), image, room->notificationCount()}); room->roomId(), alias, room->roomName(), image, room->notificationCount()});
if (model->length() == roomListModelSize) { if (model->length() == roomListModelSize) {
auto reply = message.createReply();
nhlog::ui()->debug("Sending {} rooms over D-Bus...", model->size()); nhlog::ui()->debug("Sending {} rooms over D-Bus...", model->size());
auto reply = message.createReply();
reply << QVariant::fromValue(*model); reply << QVariant::fromValue(*model);
QDBusConnection::sessionBus().send(reply); QDBusConnection::sessionBus().send(reply);
nhlog::ui()->debug("Rooms successfully sent to D-Bus."); nhlog::ui()->debug("Rooms successfully sent to D-Bus.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment