refactor(core): wrap everything with Bismuth NS

This commit is contained in:
Mikhail Zolotukhin 2022-06-23 21:14:31 +03:00
parent cbb674c89e
commit e6cd2da97d
5 changed files with 22 additions and 3 deletions

View File

@ -16,10 +16,9 @@
#include "plasma-api/api.hpp"
#include "plasma-api/client.hpp"
class TSProxy;
namespace Bismuth
{
class TSProxy;
struct Action {
Action(const QString &id, const QString &description, const QString &defaultKeybinding, std::function<void()> callback);

View File

@ -24,9 +24,12 @@ void CorePlugin::registerTypes(const char *uri)
Q_ASSERT(uri == QLatin1String("org.kde.bismuth.core"));
qmlRegisterModule(uri, 1, 0);
qmlRegisterType<Core>(uri, 1, 0, "Core");
qmlRegisterType<Bismuth::Core>(uri, 1, 0, "Core");
}
namespace Bismuth
{
Core::Core(QQuickItem *parent)
: QQuickItem(parent)
, m_qmlEngine() // We cannot get engine from the pointer in the constructor
@ -54,3 +57,5 @@ TSProxy *Core::tsProxy() const
{
return m_tsProxy.get();
}
}

View File

@ -26,6 +26,9 @@ public:
void registerTypes(const char *uri) override;
};
namespace Bismuth
{
class Core : public QQuickItem
{
Q_OBJECT
@ -53,3 +56,5 @@ private:
std::unique_ptr<PlasmaApi::Api> m_plasmaApi;
std::unique_ptr<Bismuth::Engine> m_engine;
};
}

View File

@ -12,6 +12,9 @@
#include "logger.hpp"
#include "plasma-api/api.hpp"
namespace Bismuth
{
TSProxy::TSProxy(QQmlEngine *engine, Bismuth::Controller &controller, PlasmaApi::Api &plasmaApi, Bismuth::Config &config)
: QObject()
, m_engine(engine)
@ -147,3 +150,5 @@ QJSValue TSProxy::jsController()
{
return m_jsController;
}
}

View File

@ -11,6 +11,9 @@
#include "controller.hpp"
#include "plasma-api/api.hpp"
namespace Bismuth
{
/**
* Proxy object for the legacy TS backend.
*/
@ -51,3 +54,5 @@ private:
PlasmaApi::Api &m_plasmaApi;
QJSValue m_jsController;
};
}