feat: add Process.manageLifetime

This commit is contained in:
outfoxxed 2024-03-03 23:17:15 -08:00
parent 4cfe6ee0a1
commit 62f99f5754
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
8 changed files with 90 additions and 6 deletions

View file

@ -12,6 +12,7 @@
#include <qtimer.h>
#include <qurl.h>
#include "plugin.hpp"
#include "qmlglobal.hpp"
#include "reload.hpp"
#include "shell.hpp"
@ -41,9 +42,8 @@ RootWrapper::~RootWrapper() {
}
void RootWrapper::reloadGraph(bool hard) {
QuickshellGlobal::deleteInstance();
if (this->root != nullptr) {
QuickshellGlobal::deleteInstance();
this->engine.clearComponentCache();
}
@ -77,10 +77,14 @@ void RootWrapper::reloadGraph(bool hard) {
oldRoot->deleteLater();
QTimer::singleShot(0, [this, newRoot]() {
if (this->root == newRoot) PostReloadHook::postReloadTree(this->root);
if (this->root == newRoot) {
QuickshellPlugin::runOnReload();
PostReloadHook::postReloadTree(this->root);
}
});
} else {
PostReloadHook::postReloadTree(newRoot);
QuickshellPlugin::runOnReload();
}
this->onConfigChanged();