mirror of
https://github.com/quickshell-mirror/quickshell.git
synced 2026-10-29 03:05:05 +00:00
For some reason, QtWayland crashes we work around trigger in this path. This was previously masked when the crash reporter didn't unmask signals, as long as the original process crashed with SIGSEGV.
55 lines
1.3 KiB
C++
55 lines
1.3 KiB
C++
#include "plugin.hpp"
|
|
#include <algorithm>
|
|
|
|
#include <qvector.h> // NOLINT (what??)
|
|
|
|
#include "generation.hpp"
|
|
|
|
static QVector<QsEnginePlugin*> plugins; // NOLINT
|
|
|
|
void QsEnginePlugin::registerPlugin(QsEnginePlugin& plugin) { plugins.push_back(&plugin); }
|
|
|
|
void QsEnginePlugin::preinitPluginsOnly() {
|
|
plugins.removeIf([](QsEnginePlugin* plugin) { return !plugin->applies(); });
|
|
|
|
std::ranges::sort(plugins, [](QsEnginePlugin* a, QsEnginePlugin* b) {
|
|
return b->dependencies().contains(a->name());
|
|
});
|
|
|
|
for (QsEnginePlugin* plugin: plugins) {
|
|
plugin->preinit();
|
|
}
|
|
}
|
|
|
|
void QsEnginePlugin::initPlugins() {
|
|
plugins.removeIf([](QsEnginePlugin* plugin) { return !plugin->applies(); });
|
|
|
|
std::ranges::sort(plugins, [](QsEnginePlugin* a, QsEnginePlugin* b) {
|
|
return b->dependencies().contains(a->name());
|
|
});
|
|
|
|
for (QsEnginePlugin* plugin: plugins) {
|
|
plugin->preinit();
|
|
}
|
|
|
|
for (QsEnginePlugin* plugin: plugins) {
|
|
plugin->init();
|
|
}
|
|
|
|
for (QsEnginePlugin* plugin: plugins) {
|
|
plugin->registerTypes();
|
|
}
|
|
}
|
|
|
|
void QsEnginePlugin::runConstructGeneration(EngineGeneration& generation) {
|
|
for (QsEnginePlugin* plugin: plugins) {
|
|
plugin->constructGeneration(generation);
|
|
}
|
|
}
|
|
|
|
void QsEnginePlugin::runOnReload() {
|
|
for (QsEnginePlugin* plugin: plugins) {
|
|
plugin->onReload();
|
|
}
|
|
}
|