From 9b6c9242f6c4a2a84618511650f992e1e29de9ab Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 14 Feb 2023 18:36:50 +0200 Subject: [PATCH] scripting: Drop "Item" word in WindowThumbnailItem and DesktopBackgroundItem Drop the "Item" word to be more consistent with QtQuick coding conventions, where C++ usually include the Item word, but QML types don't. --- src/effects/desktopgrid/qml/DesktopView.qml | 2 +- src/effects/overview/qml/DesktopView.qml | 2 +- src/effects/overview/qml/ScreenView.qml | 4 ++-- src/effects/private/qml/WindowHeap.qml | 4 ++-- src/effects/private/qml/WindowHeapDelegate.qml | 2 +- src/effects/tileseditor/qml/main.qml | 2 +- src/effects/windowview/qml/main.qml | 4 ++-- src/kcms/tabbox/layoutpreview.cpp | 2 +- src/scripting/scripting.cpp | 4 ++-- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/effects/desktopgrid/qml/DesktopView.qml b/src/effects/desktopgrid/qml/DesktopView.qml index 4fb48ff1a5..2f10f63b56 100644 --- a/src/effects/desktopgrid/qml/DesktopView.qml +++ b/src/effects/desktopgrid/qml/DesktopView.qml @@ -73,7 +73,7 @@ FocusScope { windowType: KWinComponents.WindowFilterModel.Dock | KWinComponents.WindowFilterModel.Desktop } - KWinComponents.WindowThumbnailItem { + KWinComponents.WindowThumbnail { wId: model.window.internalId x: model.window.x - targetScreen.geometry.x y: model.window.y - targetScreen.geometry.y diff --git a/src/effects/overview/qml/DesktopView.qml b/src/effects/overview/qml/DesktopView.qml index 21984d59e7..08d329fe59 100644 --- a/src/effects/overview/qml/DesktopView.qml +++ b/src/effects/overview/qml/DesktopView.qml @@ -21,7 +21,7 @@ Item { windowModel: desktopView.windowModel } - KWinComponents.WindowThumbnailItem { + KWinComponents.WindowThumbnail { wId: model.window.internalId x: model.window.x - targetScreen.geometry.x y: model.window.y - targetScreen.geometry.y diff --git a/src/effects/overview/qml/ScreenView.qml b/src/effects/overview/qml/ScreenView.qml index 4463f64b35..c2a8d0afa9 100644 --- a/src/effects/overview/qml/ScreenView.qml +++ b/src/effects/overview/qml/ScreenView.qml @@ -74,7 +74,7 @@ FocusScope { } } - KWinComponents.DesktopBackgroundItem { + KWinComponents.DesktopBackground { id: backgroundItem activity: KWinComponents.Workspace.currentActivity desktop: KWinComponents.Workspace.currentDesktop @@ -301,7 +301,7 @@ FocusScope { windowType: KWinComponents.WindowFilterModel.Dock } - KWinComponents.WindowThumbnailItem { + KWinComponents.WindowThumbnail { id: windowThumbnail visible: !model.window.hidden && opacity > 0 wId: model.window.internalId diff --git a/src/effects/private/qml/WindowHeap.qml b/src/effects/private/qml/WindowHeap.qml index e29d49b8e2..7cd2db3c35 100644 --- a/src/effects/private/qml/WindowHeap.qml +++ b/src/effects/private/qml/WindowHeap.qml @@ -74,10 +74,10 @@ FocusScope { delete dndManagerStore[key]; } - KWinComponents.WindowThumbnailItem { + KWinComponents.WindowThumbnail { id: otherScreenThumbnail z: 2 - property KWinComponents.WindowThumbnailItem cloneOf + property KWinComponents.WindowThumbnail cloneOf visible: false client: cloneOf ? cloneOf.client : null width: cloneOf ? cloneOf.width : 0 diff --git a/src/effects/private/qml/WindowHeapDelegate.qml b/src/effects/private/qml/WindowHeapDelegate.qml index e0c0b9f99a..2371b16bb3 100644 --- a/src/effects/private/qml/WindowHeapDelegate.qml +++ b/src/effects/private/qml/WindowHeapDelegate.qml @@ -89,7 +89,7 @@ Item { TweenBehavior on width {} TweenBehavior on height {} - KWinComponents.WindowThumbnailItem { + KWinComponents.WindowThumbnail { id: thumbSource wId: thumb.window.internalId diff --git a/src/effects/tileseditor/qml/main.qml b/src/effects/tileseditor/qml/main.qml index 75167e98f2..a53fff3168 100644 --- a/src/effects/tileseditor/qml/main.qml +++ b/src/effects/tileseditor/qml/main.qml @@ -58,7 +58,7 @@ FocusScope { windowModel: KWinComponents.WindowModel {} } - KWinComponents.WindowThumbnailItem { + KWinComponents.WindowThumbnail { wId: model.window.internalId x: model.window.x - targetScreen.geometry.x y: model.window.y - targetScreen.geometry.y diff --git a/src/effects/windowview/qml/main.qml b/src/effects/windowview/qml/main.qml index caefb04506..2f52c2bdb9 100644 --- a/src/effects/windowview/qml/main.qml +++ b/src/effects/windowview/qml/main.qml @@ -62,7 +62,7 @@ Item { } } - KWinComponents.DesktopBackgroundItem { + KWinComponents.DesktopBackground { activity: KWinComponents.Workspace.currentActivity desktop: KWinComponents.Workspace.currentDesktop outputName: targetScreen.name @@ -225,7 +225,7 @@ Item { windowType: KWinComponents.WindowFilterModel.Dock } - KWinComponents.WindowThumbnailItem { + KWinComponents.WindowThumbnail { id: windowThumbnail wId: model.window.internalId x: model.window.x - targetScreen.geometry.x diff --git a/src/kcms/tabbox/layoutpreview.cpp b/src/kcms/tabbox/layoutpreview.cpp index eb62c9bce9..5a94dd9a5d 100644 --- a/src/kcms/tabbox/layoutpreview.cpp +++ b/src/kcms/tabbox/layoutpreview.cpp @@ -31,7 +31,7 @@ LayoutPreview::LayoutPreview(const QString &path, bool showDesktopThumbnail, QOb { QQmlEngine *engine = new QQmlEngine(this); QQmlComponent *component = new QQmlComponent(engine, this); - qmlRegisterType("org.kde.kwin", 3, 0, "WindowThumbnailItem"); + qmlRegisterType("org.kde.kwin", 3, 0, "WindowThumbnail"); qmlRegisterType("org.kde.kwin", 3, 0, "TabBoxSwitcher"); qmlRegisterAnonymousType("org.kde.kwin", 3); component->loadUrl(QUrl::fromLocalFile(path)); diff --git a/src/scripting/scripting.cpp b/src/scripting/scripting.cpp index ef21bf1591..5374c8aa6a 100644 --- a/src/scripting/scripting.cpp +++ b/src/scripting/scripting.cpp @@ -673,8 +673,8 @@ KWin::Scripting::Scripting(QObject *parent) void KWin::Scripting::init() { - qmlRegisterType("org.kde.kwin", 3, 0, "DesktopBackgroundItem"); - qmlRegisterType("org.kde.kwin", 3, 0, "WindowThumbnailItem"); + qmlRegisterType("org.kde.kwin", 3, 0, "DesktopBackground"); + qmlRegisterType("org.kde.kwin", 3, 0, "WindowThumbnail"); qmlRegisterType("org.kde.kwin", 3, 0, "DBusCall"); qmlRegisterType("org.kde.kwin", 3, 0, "ScreenEdgeItem"); qmlRegisterType("org.kde.kwin", 3, 0, "WindowModel");