diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-09-03 19:34:17 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-09-16 23:49:17 +0200 |
commit | 77e241b9e57a3248e2efb16e6cb081a19a666db7 (patch) | |
tree | e1f44e5b252ce2931d41dc57b10671efee58e58c /src/MainWindow.cpp | |
parent | Port top bar to Qml (diff) | |
download | nheko-77e241b9e57a3248e2efb16e6cb081a19a666db7.tar.xz |
Reenable top bar room settings menus on avatar or title clicks
Also fixes a bug with an empty room settings window introduced in the port.
Diffstat (limited to 'src/MainWindow.cpp')
-rw-r--r-- | src/MainWindow.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 90bffa70..29abed86 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -340,9 +340,7 @@ MainWindow::openUserProfile(const QString &user_id, const QString &room_id) void MainWindow::openRoomSettings(const QString &room_id) { - const auto roomToSearch = room_id.isEmpty() ? chat_page_->currentRoom() : ""; - - auto dialog = new dialogs::RoomSettings(roomToSearch, this); + auto dialog = new dialogs::RoomSettings(room_id, this); showDialog(dialog); } @@ -350,8 +348,7 @@ MainWindow::openRoomSettings(const QString &room_id) void MainWindow::openMemberListDialog(const QString &room_id) { - const auto roomToSearch = room_id.isEmpty() ? chat_page_->currentRoom() : ""; - auto dialog = new dialogs::MemberList(roomToSearch, this); + auto dialog = new dialogs::MemberList(room_id, this); showDialog(dialog); } @@ -359,11 +356,9 @@ MainWindow::openMemberListDialog(const QString &room_id) void MainWindow::openLeaveRoomDialog(const QString &room_id) { - auto roomToLeave = room_id.isEmpty() ? chat_page_->currentRoom() : room_id; - auto dialog = new dialogs::LeaveRoom(this); - connect(dialog, &dialogs::LeaveRoom::leaving, this, [this, roomToLeave]() { - chat_page_->leaveRoom(roomToLeave); + connect(dialog, &dialogs::LeaveRoom::leaving, this, [this, room_id]() { + chat_page_->leaveRoom(room_id); }); showDialog(dialog); |