Fix some qml warnings

This commit is contained in:
Tobias Fella
2025-09-02 15:06:58 +02:00
parent 95617e3210
commit a2d64d2955
2 changed files with 11 additions and 11 deletions

View File

@@ -233,7 +233,7 @@ Kirigami.ApplicationWindow {
RoomListPage { RoomListPage {
id: roomList id: roomList
onSearch: quickSwitcher.open() onSearch: root.quickSwitcher.open()
connection: root.connection connection: root.connection

View File

@@ -2,6 +2,8 @@
// SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu> // SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
pragma ComponentBehavior: Bound
import QtQuick import QtQuick
import QtQuick.Controls as QQC2 import QtQuick.Controls as QQC2
import QtQuick.Window import QtQuick.Window
@@ -107,9 +109,8 @@ Kirigami.Page {
Loader { Loader {
id: timelineViewLoader id: timelineViewLoader
anchors.fill: parent anchors.fill: parent
active: root.currentRoom && !root.currentRoom.isInvite && !root.currentRoom.isSpace
// We need the loader to be active but invisible while the room is loading messages so signals in TimelineView work. // We need the loader to be active but invisible while the room is loading messages so signals in TimelineView work.
visible: !root.loading active: root.currentRoom && !root.currentRoom.isInvite && !root.currentRoom.isSpace
sourceComponent: TimelineView { sourceComponent: TimelineView {
id: timelineView id: timelineView
messageFilterModel: root.messageFilterModel messageFilterModel: root.messageFilterModel
@@ -155,13 +156,13 @@ Kirigami.Page {
footer: Loader { footer: Loader {
id: chatBarLoader id: chatBarLoader
height: active ? item.implicitHeight : 0 height: active ? (item as ChatBar).implicitHeight : 0
active: timelineViewLoader.active && !root.currentRoom.readOnly active: timelineViewLoader.active && !root.currentRoom.readOnly
sourceComponent: ChatBar { sourceComponent: ChatBar {
id: chatBar id: chatBar
width: parent.width width: parent.width
currentRoom: root.currentRoom currentRoom: root.currentRoom
connection: root.currentRoom.connection connection: root.currentRoom.connection as NeoChatConnection
} }
} }
@@ -216,15 +217,14 @@ Kirigami.Page {
} }
function onShowDelegateMenu(eventId: string, author, messageComponentType, plainText: string, richText: string, mimeType: string, progressInfo, isThread: bool, selectedText: string, hoveredLink: string) { function onShowDelegateMenu(eventId: string, author, messageComponentType, plainText: string, richText: string, mimeType: string, progressInfo, isThread: bool, selectedText: string, hoveredLink: string) {
const contextMenu = delegateContextMenu.createObject(root, { (delegateContextMenu.createObject(root, {
author: author, author: author,
eventId: eventId, eventId: eventId,
plainText: plainText, plainText: plainText,
mimeType: mimeType, mimeType: mimeType,
progressInfo: progressInfo, progressInfo: progressInfo,
messageComponentType: messageComponentType, messageComponentType: messageComponentType,
}); }) as DelegateContextMenu).popup();
contextMenu.popup();
} }
function onShowMaximizedMedia(index) { function onShowMaximizedMedia(index) {
@@ -239,12 +239,12 @@ Kirigami.Page {
} }
function onShowMaximizedCode(author, time, codeText, language) { function onShowMaximizedCode(author, time, codeText, language) {
let popup = Qt.createComponent('org.kde.neochat', 'CodeMaximizeComponent').createObject(QQC2.Overlay.overlay, { (Qt.createComponent('org.kde.neochat', 'CodeMaximizeComponent').createObject(QQC2.Overlay.overlay, {
author: author, author: author,
time: time, time: time,
codeText: codeText, codeText: codeText,
language: language language: language
}).open(); }) as CodeMaximizeComponent).open();
} }
} }
@@ -252,7 +252,7 @@ Kirigami.Page {
id: delegateContextMenu id: delegateContextMenu
DelegateContextMenu { DelegateContextMenu {
room: root.currentRoom room: root.currentRoom
connection: root.currentRoom.connection connection: root.currentRoom.connection as NeoChatConnection
} }
} }