mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Fix rooms failing to load over dbus if image can't be downloaded
This commit is contained in:
parent
af03138527
commit
6ead7b0ba2
1 changed files with 3 additions and 1 deletions
|
@ -21,6 +21,8 @@ NhekoDBusBackend::NhekoDBusBackend(RoomlistModel *parent)
|
|||
QVector<nheko::dbus::RoomInfoItem>
|
||||
NhekoDBusBackend::rooms(const QDBusMessage &message)
|
||||
{
|
||||
message.setDelayedReply(true);
|
||||
|
||||
const auto roomListModel = m_parent->models;
|
||||
QSharedPointer<QVector<nheko::dbus::RoomInfoItem>> model{
|
||||
new QVector<nheko::dbus::RoomInfoItem>};
|
||||
|
@ -43,8 +45,8 @@ NhekoDBusBackend::rooms(const QDBusMessage &message)
|
|||
room->roomId(), alias, room->roomName(), image, room->notificationCount()});
|
||||
|
||||
if (model->length() == roomListModelSize) {
|
||||
auto reply = message.createReply();
|
||||
nhlog::ui()->debug("Sending {} rooms over D-Bus...", model->size());
|
||||
auto reply = message.createReply();
|
||||
reply << QVariant::fromValue(*model);
|
||||
QDBusConnection::sessionBus().send(reply);
|
||||
nhlog::ui()->debug("Rooms successfully sent to D-Bus.");
|
||||
|
|
Loading…
Reference in a new issue