diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3cb2863a66..0e303ff1ef 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -137,6 +137,7 @@ target_sources(kwin PRIVATE scene/workspacescene_opengl.cpp scene/workspacescene_qpainter.cpp screenedge.cpp + scripting/clientmodel.cpp scripting/dbuscall.cpp scripting/desktopbackgrounditem.cpp scripting/screenedgeitem.cpp @@ -145,8 +146,7 @@ target_sources(kwin PRIVATE scripting/scripting_logging.cpp scripting/scriptingutils.cpp scripting/tilemodel.cpp - scripting/v3/clientmodel.cpp - scripting/v3/virtualdesktopmodel.cpp + scripting/virtualdesktopmodel.cpp scripting/windowthumbnailitem.cpp scripting/workspace_wrapper.cpp shadow.cpp diff --git a/src/scripting/v3/clientmodel.cpp b/src/scripting/clientmodel.cpp similarity index 99% rename from src/scripting/v3/clientmodel.cpp rename to src/scripting/clientmodel.cpp index 20899bc7f7..f1ccf42488 100644 --- a/src/scripting/v3/clientmodel.cpp +++ b/src/scripting/clientmodel.cpp @@ -11,7 +11,7 @@ #include "window.h" #include "workspace.h" -namespace KWin::ScriptingModels::V3 +namespace KWin { ClientModel::ClientModel(QObject *parent) @@ -327,4 +327,4 @@ ClientFilterModel::WindowTypes ClientFilterModel::windowTypeMask(Window *client) return mask; } -} // namespace KWin::ScriptingModels::V3 +} // namespace KWin diff --git a/src/scripting/v3/clientmodel.h b/src/scripting/clientmodel.h similarity index 98% rename from src/scripting/v3/clientmodel.h rename to src/scripting/clientmodel.h index 48fc104c9e..0c98876abb 100644 --- a/src/scripting/v3/clientmodel.h +++ b/src/scripting/clientmodel.h @@ -19,9 +19,6 @@ namespace KWin class Window; class Output; -namespace ScriptingModels::V3 -{ - class ClientModel : public QAbstractListModel { Q_OBJECT @@ -124,5 +121,4 @@ private: bool m_showMinimizedWindows = true; }; -} // namespace ScriptingModels::V3 } // namespace KWin diff --git a/src/scripting/scripting.cpp b/src/scripting/scripting.cpp index 5384945db4..e627dfa9fa 100644 --- a/src/scripting/scripting.cpp +++ b/src/scripting/scripting.cpp @@ -11,18 +11,17 @@ #include "scripting.h" // own +#include "clientmodel.h" #include "dbuscall.h" #include "desktopbackgrounditem.h" #include "kwinquickeffect.h" #include "screenedgeitem.h" #include "scripting_logging.h" #include "scriptingutils.h" +#include "virtualdesktopmodel.h" #include "windowthumbnailitem.h" #include "workspace_wrapper.h" -#include "v3/clientmodel.h" -#include "v3/virtualdesktopmodel.h" - #include "input.h" #include "options.h" #include "screenedge.h" @@ -675,9 +674,9 @@ void KWin::Scripting::init() qmlRegisterType("org.kde.kwin", 3, 0, "WindowThumbnailItem"); qmlRegisterType("org.kde.kwin", 3, 0, "DBusCall"); qmlRegisterType("org.kde.kwin", 3, 0, "ScreenEdgeItem"); - qmlRegisterType("org.kde.kwin", 3, 0, "ClientModel"); - qmlRegisterType("org.kde.kwin", 3, 0, "ClientFilterModel"); - qmlRegisterType("org.kde.kwin", 3, 0, "VirtualDesktopModel"); + qmlRegisterType("org.kde.kwin", 3, 0, "ClientModel"); + qmlRegisterType("org.kde.kwin", 3, 0, "ClientFilterModel"); + qmlRegisterType("org.kde.kwin", 3, 0, "VirtualDesktopModel"); qmlRegisterUncreatableType("org.kde.kwin", 3, 0, "SceneView", QStringLiteral("Can't instantiate an object of type SceneView")); qmlRegisterSingletonType("org.kde.kwin", 3, 0, "Workspace", [](QQmlEngine *qmlEngine, QJSEngine *jsEngine) { diff --git a/src/scripting/v3/virtualdesktopmodel.cpp b/src/scripting/virtualdesktopmodel.cpp similarity index 97% rename from src/scripting/v3/virtualdesktopmodel.cpp rename to src/scripting/virtualdesktopmodel.cpp index 2fae387f23..7de2379e48 100644 --- a/src/scripting/v3/virtualdesktopmodel.cpp +++ b/src/scripting/virtualdesktopmodel.cpp @@ -7,7 +7,7 @@ #include "virtualdesktopmodel.h" #include "virtualdesktops.h" -namespace KWin::ScriptingModels::V3 +namespace KWin { VirtualDesktopModel::VirtualDesktopModel(QObject *parent) @@ -88,4 +88,4 @@ int VirtualDesktopModel::rowCount(const QModelIndex &parent) const return parent.isValid() ? 0 : m_virtualDesktops.count(); } -} // namespace KWin::ScriptingModels::V3 +} // namespace KWin diff --git a/src/scripting/v3/virtualdesktopmodel.h b/src/scripting/virtualdesktopmodel.h similarity index 94% rename from src/scripting/v3/virtualdesktopmodel.h rename to src/scripting/virtualdesktopmodel.h index 0ba286c958..a2a7ee0589 100644 --- a/src/scripting/v3/virtualdesktopmodel.h +++ b/src/scripting/virtualdesktopmodel.h @@ -12,9 +12,6 @@ namespace KWin { class VirtualDesktop; -namespace ScriptingModels::V3 -{ - /** * The VirtualDesktopModel class provides a data model for the virtual desktops. */ @@ -46,5 +43,4 @@ private: QVector m_virtualDesktops; }; -} // namespace ScriptingModels::V3 } // namespace KWin