Move currentRoom/timeline handling to roomlist
This commit is contained in:
parent
e2765212fb
commit
298822baea
30 changed files with 349 additions and 345 deletions
|
|
@ -341,6 +341,8 @@ RoomlistModel::clear()
|
|||
models.clear();
|
||||
invites.clear();
|
||||
roomids.clear();
|
||||
currentRoom_ = nullptr;
|
||||
emit currentRoomChanged();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
|
|
@ -390,6 +392,17 @@ RoomlistModel::leave(QString roomid)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
RoomlistModel::setCurrentRoom(QString roomid)
|
||||
{
|
||||
nhlog::ui()->debug("Trying to switch to: {}", roomid.toStdString());
|
||||
if (models.contains(roomid)) {
|
||||
currentRoom_ = models.value(roomid);
|
||||
emit currentRoomChanged();
|
||||
nhlog::ui()->debug("Switched to: {}", roomid.toStdString());
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
enum NotificationImportance : short
|
||||
{
|
||||
|
|
@ -463,6 +476,11 @@ FilteredRoomlistModel::FilteredRoomlistModel(RoomlistModel *model, QObject *pare
|
|||
invalidate();
|
||||
});
|
||||
|
||||
connect(roomlistmodel,
|
||||
&RoomlistModel::currentRoomChanged,
|
||||
this,
|
||||
&FilteredRoomlistModel::currentRoomChanged);
|
||||
|
||||
sort(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue