Move the various room models into RoomManager. This means the same room models are always used and is a base from which further logic can be moved from QML to cpp.
35 lines
788 B
QML
35 lines
788 B
QML
// SPDX-FileCopyrightText: 2023 Tobias Fella <tobias.fella@kde.org>
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
import QtQuick
|
|
import QtQuick.Controls
|
|
|
|
import org.kde.kirigami as Kirigami
|
|
|
|
import org.kde.neochat
|
|
|
|
Kirigami.ScrollablePage {
|
|
id: root
|
|
|
|
title: i18nc("@title", "Choose a Room")
|
|
|
|
signal chosen(string roomId)
|
|
|
|
required property NeoChatConnection connection
|
|
|
|
header: Kirigami.SearchField {
|
|
onTextChanged: RoomManager.sortFilterRoomListModel.filterText = text
|
|
}
|
|
|
|
ListView {
|
|
model: RoomManager.sortFilterRoomListModel
|
|
delegate: RoomDelegate {
|
|
id: roomDelegate
|
|
onClicked: {
|
|
root.chosen(roomDelegate.currentRoom.id);
|
|
}
|
|
connection: root.connection
|
|
}
|
|
}
|
|
}
|