diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 47e4db639f..72d6805bfa 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -99,12 +99,12 @@ set(kwin_SRCS screenedge.cpp screenlockerwatcher.cpp screens.cpp + scripting/v2/clientmodel.cpp scripting/dbuscall.cpp scripting/screenedgeitem.cpp scripting/scriptedeffect.cpp scripting/scripting.cpp scripting/scripting_logging.cpp - scripting/scripting_model.cpp scripting/scriptingutils.cpp scripting/thumbnailitem.cpp scripting/workspace_wrapper.cpp diff --git a/src/scripting/scripting.cpp b/src/scripting/scripting.cpp index 326e55522c..4162f4a699 100644 --- a/src/scripting/scripting.cpp +++ b/src/scripting/scripting.cpp @@ -15,10 +15,11 @@ #include "scriptingutils.h" #include "workspace_wrapper.h" #include "screenedgeitem.h" -#include "scripting_model.h" #include "scripting_logging.h" #include "thumbnailitem.h" +#include "v2/clientmodel.h" + #include "input.h" #include "options.h" #include "screenedge.h" @@ -634,12 +635,13 @@ void KWin::Scripting::init() qmlRegisterType("org.kde.kwin", 2, 0, "ThumbnailItem"); qmlRegisterType("org.kde.kwin", 2, 0, "DBusCall"); qmlRegisterType("org.kde.kwin", 2, 0, "ScreenEdgeItem"); - qmlRegisterType(); - qmlRegisterType("org.kde.kwin", 2, 0, "ClientModel"); - qmlRegisterType("org.kde.kwin", 2, 0, "ClientModelByScreen"); - qmlRegisterType("org.kde.kwin", 2, 0, "ClientModelByScreenAndDesktop"); - qmlRegisterType("org.kde.kwin", 2, 1, "ClientModelByScreenAndActivity"); - qmlRegisterType("org.kde.kwin", 2, 0, "ClientFilterModel"); + qmlRegisterType(); + qmlRegisterType("org.kde.kwin", 2, 0, "ClientModel"); + qmlRegisterType("org.kde.kwin", 2, 0, "ClientModelByScreen"); + qmlRegisterType("org.kde.kwin", 2, 0, "ClientModelByScreenAndDesktop"); + qmlRegisterType("org.kde.kwin", 2, 1, "ClientModelByScreenAndActivity"); + qmlRegisterType("org.kde.kwin", 2, 0, "ClientFilterModel"); + qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); diff --git a/src/scripting/scripting_model.cpp b/src/scripting/v2/clientmodel.cpp similarity index 99% rename from src/scripting/scripting_model.cpp rename to src/scripting/v2/clientmodel.cpp index c1d2f06227..d7a1d379f4 100644 --- a/src/scripting/scripting_model.cpp +++ b/src/scripting/v2/clientmodel.cpp @@ -6,7 +6,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -#include "scripting_model.h" +#include "clientmodel.h" #include #include "abstract_client.h" #ifdef KWIN_BUILD_ACTIVITIES @@ -16,8 +16,7 @@ #include "virtualdesktops.h" #include "workspace.h" -namespace KWin { -namespace ScriptingClientModel { +namespace KWin::ScriptingModels::V2 { static quint32 nextId() { static quint32 counter = 0; @@ -904,5 +903,4 @@ bool ClientFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourc return false; } -} // namespace Scripting } // namespace KWin diff --git a/src/scripting/scripting_model.h b/src/scripting/v2/clientmodel.h similarity index 97% rename from src/scripting/scripting_model.h rename to src/scripting/v2/clientmodel.h index 1a10de27ec..b181ed402e 100644 --- a/src/scripting/scripting_model.h +++ b/src/scripting/v2/clientmodel.h @@ -17,7 +17,7 @@ namespace KWin { class AbstractClient; class Client; -namespace ScriptingClientModel { +namespace ScriptingModels::V2 { class AbstractLevel; @@ -272,7 +272,7 @@ public: class ClientFilterModel : public QSortFilterProxyModel { Q_OBJECT - Q_PROPERTY(KWin::ScriptingClientModel::ClientModel *clientModel READ clientModel WRITE setClientModel NOTIFY clientModelChanged) + Q_PROPERTY(KWin::ScriptingModels::V2::ClientModel *clientModel READ clientModel WRITE setClientModel NOTIFY clientModelChanged) Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged) public: ClientFilterModel(QObject *parent = nullptr); @@ -371,7 +371,7 @@ const QString &ClientFilterModel::filter() const } // namespace Scripting } // namespace KWin -Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::ScriptingClientModel::ClientModel::Exclusions) -Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::ScriptingClientModel::ClientModel::LevelRestrictions) +Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::ScriptingModels::V2::ClientModel::Exclusions) +Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::ScriptingModels::V2::ClientModel::LevelRestrictions) #endif // KWIN_SCRIPTING_MODEL_H