core/plugin: rename QuickshellPlugin to QsEnginePlugin

Fixes conflict with the autogenerated qml plugin of the same name.
This commit is contained in:
outfoxxed 2024-11-22 18:59:15 -08:00
parent afa1b6f88b
commit 2996e40ff9
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
8 changed files with 27 additions and 27 deletions

View file

@ -42,7 +42,7 @@ EngineGeneration::EngineGeneration(const QDir& rootPath, QmlScanner scanner)
this->engine->addImageProvider("qsimage", new QsImageProvider());
this->engine->addImageProvider("qspixmap", new QsPixmapProvider());
QuickshellPlugin::runConstructGeneration(*this);
QsEnginePlugin::runConstructGeneration(*this);
}
EngineGeneration::~EngineGeneration() {
@ -141,7 +141,7 @@ void EngineGeneration::postReload() {
// This can be called on a generation during its destruction.
if (this->engine == nullptr || this->root == nullptr) return;
QuickshellPlugin::runOnReload();
QsEnginePlugin::runOnReload();
PostReloadHook::postReloadTree(this->root);
this->singletonRegistry.onPostReload();
}

View file

@ -5,41 +5,41 @@
#include "generation.hpp"
static QVector<QuickshellPlugin*> plugins; // NOLINT
static QVector<QsEnginePlugin*> plugins; // NOLINT
void QuickshellPlugin::registerPlugin(QuickshellPlugin& plugin) { plugins.push_back(&plugin); }
void QsEnginePlugin::registerPlugin(QsEnginePlugin& plugin) { plugins.push_back(&plugin); }
void QuickshellPlugin::initPlugins() {
void QsEnginePlugin::initPlugins() {
plugins.erase(
std::remove_if(
plugins.begin(),
plugins.end(),
[](QuickshellPlugin* plugin) { return !plugin->applies(); }
[](QsEnginePlugin* plugin) { return !plugin->applies(); }
),
plugins.end()
);
std::sort(plugins.begin(), plugins.end(), [](QuickshellPlugin* a, QuickshellPlugin* b) {
std::sort(plugins.begin(), plugins.end(), [](QsEnginePlugin* a, QsEnginePlugin* b) {
return b->dependencies().contains(a->name());
});
for (QuickshellPlugin* plugin: plugins) {
for (QsEnginePlugin* plugin: plugins) {
plugin->init();
}
for (QuickshellPlugin* plugin: plugins) {
for (QsEnginePlugin* plugin: plugins) {
plugin->registerTypes();
}
}
void QuickshellPlugin::runConstructGeneration(EngineGeneration& generation) {
for (QuickshellPlugin* plugin: plugins) {
void QsEnginePlugin::runConstructGeneration(EngineGeneration& generation) {
for (QsEnginePlugin* plugin: plugins) {
plugin->constructGeneration(generation);
}
}
void QuickshellPlugin::runOnReload() {
for (QuickshellPlugin* plugin: plugins) {
void QsEnginePlugin::runOnReload() {
for (QsEnginePlugin* plugin: plugins) {
plugin->onReload();
}
}

View file

@ -6,14 +6,14 @@
class EngineGeneration;
class QuickshellPlugin {
class QsEnginePlugin {
public:
QuickshellPlugin() = default;
virtual ~QuickshellPlugin() = default;
QuickshellPlugin(QuickshellPlugin&&) = delete;
QuickshellPlugin(const QuickshellPlugin&) = delete;
void operator=(QuickshellPlugin&&) = delete;
void operator=(const QuickshellPlugin&) = delete;
QsEnginePlugin() = default;
virtual ~QsEnginePlugin() = default;
QsEnginePlugin(QsEnginePlugin&&) = delete;
QsEnginePlugin(const QsEnginePlugin&) = delete;
void operator=(QsEnginePlugin&&) = delete;
void operator=(const QsEnginePlugin&) = delete;
virtual QString name() { return QString(); }
virtual QList<QString> dependencies() { return {}; }
@ -23,7 +23,7 @@ public:
virtual void constructGeneration(EngineGeneration& /*unused*/) {} // NOLINT
virtual void onReload() {}
static void registerPlugin(QuickshellPlugin& plugin);
static void registerPlugin(QsEnginePlugin& plugin);
static void initPlugins();
static void runConstructGeneration(EngineGeneration& generation);
static void runOnReload();
@ -33,6 +33,6 @@ public:
#define QS_REGISTER_PLUGIN(clazz) \
[[gnu::constructor]] void qsInitPlugin() { \
static clazz plugin; \
QuickshellPlugin::registerPlugin(plugin); \
QsEnginePlugin::registerPlugin(plugin); \
}
// NOLINTEND

View file

@ -3,7 +3,7 @@
namespace {
class IoPlugin: public QuickshellPlugin {
class IoPlugin: public QsEnginePlugin {
void onReload() override { DisownedProcessContext::destroyInstance(); }
};

View file

@ -212,7 +212,7 @@ int launch(const LaunchArgs& args, char** argv, QCoreApplication* coreApplicatio
QQmlDebuggingEnabler::startTcpDebugServer(args.debugPort, wait);
}
QuickshellPlugin::initPlugins();
QsEnginePlugin::initPlugins();
// Base window transparency appears to be additive.
// Use a fully transparent window with a colored rect.

View file

@ -15,7 +15,7 @@ void installPopupPositioner();
namespace {
class WaylandPlugin: public QuickshellPlugin {
class WaylandPlugin: public QsEnginePlugin {
QList<QString> dependencies() override { return {"window"}; }
bool applies() override {

View file

@ -5,7 +5,7 @@
namespace {
class WindowPlugin: public QuickshellPlugin {
class WindowPlugin: public QsEnginePlugin {
// _Window has to be registered before wayland or x11 modules, otherwise module overlays
// will apply in the wrong order.
QString name() override { return "window"; }

View file

@ -9,7 +9,7 @@
namespace {
class X11Plugin: public QuickshellPlugin {
class X11Plugin: public QsEnginePlugin {
QList<QString> dependencies() override { return {"window"}; }
bool applies() override { return QGuiApplication::platformName() == "xcb"; }