Add action to search in room directory when search is empty in roomlist
This commit is contained in:
@@ -20,7 +20,7 @@ Kirigami.ScrollablePage {
|
||||
id: root
|
||||
property var connection
|
||||
|
||||
property string keyword
|
||||
property alias keyword: identifierField.text
|
||||
property string server
|
||||
|
||||
signal joinRoom(string room)
|
||||
@@ -40,10 +40,6 @@ Kirigami.ScrollablePage {
|
||||
id: identifierField
|
||||
|
||||
placeholderText: i18n("Find a room...")
|
||||
|
||||
onEditingFinished: {
|
||||
keyword = text
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
|
||||
@@ -44,9 +44,9 @@ Kirigami.ScrollablePage {
|
||||
visible: listView.count == 0
|
||||
text: sortFilterRoomListModel.filterText.length > 0 ? i18n("No room found.") : i18n("You didn't join any room yet.")
|
||||
helpfulAction: Kirigami.Action {
|
||||
icon.name: "list-add"
|
||||
text: i18n("Explore rooms")
|
||||
onTriggered: pageStack.layers.push("qrc:/imports/NeoChat/Page/JoinRoomPage.qml", {"connection": activeConnection})
|
||||
icon.name: sortFilterRoomListModel.filterText.length > 0 ? "search" : "list-add"
|
||||
text: sortFilterRoomListModel.filterText.length > 0 ? i18n("Search in room directory") : i18n("Explore rooms")
|
||||
onTriggered: pageStack.layers.push("qrc:/imports/NeoChat/Page/JoinRoomPage.qml", {"connection": activeConnection, "keyword": sortFilterRoomListModel.filterText})
|
||||
}
|
||||
}
|
||||
model: SortFilterRoomListModel {
|
||||
|
||||
@@ -53,6 +53,7 @@ if(ANDROID)
|
||||
"configure"
|
||||
"rating"
|
||||
"rating-unrated"
|
||||
"search"
|
||||
)
|
||||
else()
|
||||
target_link_libraries(neochat PRIVATE Qt5::Widgets ${QTKEYCHAIN_LIBRARIES})
|
||||
|
||||
@@ -111,9 +111,6 @@ void PublicRoomListModel::next(int count)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hasMore())
|
||||
return;
|
||||
|
||||
job = m_connection->callApi<QueryPublicRoomsJob>(m_server, count, nextBatch, QueryPublicRoomsJob::Filter {m_keyword});
|
||||
|
||||
connect(job, &BaseJob::finished, this, [=] {
|
||||
|
||||
Reference in New Issue
Block a user