Remove external room window feature

At its best, this worked ok-ish, though it was always missing basic features.

It's also a massive memory leak and significantly complicates the codebase.
(Which is not yet cleaned up by this commit)

Currently, it is entirely broken and noone noticed or cared enough to report or fix that.

BUG: 455984
This commit is contained in:
Tobias Fella
2024-03-27 22:34:40 +01:00
parent ab4519dedd
commit 882ead5715
6 changed files with 0 additions and 104 deletions

View File

@@ -188,7 +188,6 @@ qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
qml/UserInfo.qml
qml/UserInfoDesktop.qml
qml/RoomPage.qml
qml/RoomWindow.qml
qml/ExploreRoomsPage.qml
qml/ManualRoomDialog.qml
qml/ExplorerDelegate.qml

View File

@@ -27,18 +27,6 @@ Loader {
Component {
id: regularMenu
QQC2.Menu {
QQC2.MenuItem {
id: newWindow
text: i18n("Open in New Window")
icon.name: "window-new"
onTriggered: RoomManager.openWindow(room)
visible: !Kirigami.Settings.isMobile
}
QQC2.MenuSeparator {
visible: newWindow.visible
}
QQC2.MenuItem {
text: room.isFavourite ? i18n("Remove from Favorites") : i18n("Add to Favorites")
icon.name: room.isFavourite ? "bookmark-remove" : "bookmark-new"

View File

@@ -1,64 +0,0 @@
// SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick
import QtQuick.Controls as QQC2
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.neochat
Kirigami.ApplicationWindow {
id: root
required property NeoChatRoom currentRoom
required property NeoChatConnection connection
minimumWidth: Kirigami.Units.gridUnit * 10
minimumHeight: Kirigami.Units.gridUnit * 15
Shortcut {
sequence: StandardKey.Cancel
onActivated: root.close()
}
pageStack.initialPage: RoomPage {
id: roomPage
visible: true
currentRoom: root.currentRoom
disableCancelShortcut: true
connection: root.connection
timelineModel: TimelineModel {
room: currentRoom
}
messageFilterModel: MessageFilterModel {
sourceModel: roomPage.messageEventModel
}
mediaMessageFilterModel: MediaMessageFilterModel {
sourceModel: roomPage.messageFilterModel
}
}
onCurrentRoomChanged: if (!currentRoom) {
root.close();
}
property Item hoverLinkIndicator: QQC2.Control {
parent: overlay.parent
property string text
opacity: linkText.text.length > 0 ? 1 : 0
z: 20
x: 0
y: parent.height - implicitHeight
contentItem: QQC2.Label {
id: linkText
text: parent.text.startsWith("https://matrix.to/") ? "" : parent.text
}
Kirigami.Theme.colorSet: Kirigami.Theme.View
background: Rectangle {
color: Kirigami.Theme.backgroundColor
}
}
}

View File

@@ -186,15 +186,6 @@ Kirigami.ApplicationWindow {
roomItem.forceActiveFocus();
}
function onOpenRoomInNewWindow(room) {
const secondaryWindow = roomWindow.createObject(undefined, {
currentRoom: room,
connection: root.connection
});
secondaryWindow.width = root.width - pageStack.get(0).width;
secondaryWindow.show();
}
function onAskDirectChatConfirmation(user) {
askDirectChatConfirmationComponent.createObject(QQC2.ApplicationWindow.overlay, {
user: user
@@ -415,11 +406,6 @@ Kirigami.ApplicationWindow {
}
}
Component {
id: roomWindow
RoomWindow {}
}
Component {
id: joinRoomDialog
JoinRoomDialog {}

View File

@@ -250,12 +250,6 @@ void RoomManager::openRoomForActiveConnection()
}
}
void RoomManager::openWindow(NeoChatRoom *room)
{
// forward the call to QML
Q_EMIT openRoomInNewWindow(room);
}
UriResolveResult RoomManager::visitUser(User *user, const QString &action)
{
if (action == "mention"_ls || action.isEmpty()) {

View File

@@ -148,13 +148,6 @@ public:
*/
Q_INVOKABLE void loadInitialRoom();
/**
* @brief Open a new window with the given room.
*
* The open window will have its own message list for the given room.
*/
Q_INVOKABLE void openWindow(NeoChatRoom *room);
/**
* @brief Leave the room and close it if it is open.
*/