scripting: Flatten source tree

It makes source tree tidier.
This commit is contained in:
Vlad Zahorodnii 2023-02-06 21:56:05 +02:00
parent 87c510328e
commit d6315bebd0
6 changed files with 11 additions and 20 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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<WindowThumbnailItem>("org.kde.kwin", 3, 0, "WindowThumbnailItem");
qmlRegisterType<DBusCall>("org.kde.kwin", 3, 0, "DBusCall");
qmlRegisterType<ScreenEdgeItem>("org.kde.kwin", 3, 0, "ScreenEdgeItem");
qmlRegisterType<ScriptingModels::V3::ClientModel>("org.kde.kwin", 3, 0, "ClientModel");
qmlRegisterType<ScriptingModels::V3::ClientFilterModel>("org.kde.kwin", 3, 0, "ClientFilterModel");
qmlRegisterType<ScriptingModels::V3::VirtualDesktopModel>("org.kde.kwin", 3, 0, "VirtualDesktopModel");
qmlRegisterType<ClientModel>("org.kde.kwin", 3, 0, "ClientModel");
qmlRegisterType<ClientFilterModel>("org.kde.kwin", 3, 0, "ClientFilterModel");
qmlRegisterType<VirtualDesktopModel>("org.kde.kwin", 3, 0, "VirtualDesktopModel");
qmlRegisterUncreatableType<KWin::QuickSceneView>("org.kde.kwin", 3, 0, "SceneView", QStringLiteral("Can't instantiate an object of type SceneView"));
qmlRegisterSingletonType<DeclarativeScriptWorkspaceWrapper>("org.kde.kwin", 3, 0, "Workspace", [](QQmlEngine *qmlEngine, QJSEngine *jsEngine) {

View file

@ -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

View file

@ -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<KWin::VirtualDesktop *> m_virtualDesktops;
};
} // namespace ScriptingModels::V3
} // namespace KWin