refactor: move reload function to QtShellGlobal

This commit is contained in:
outfoxxed 2024-02-04 05:17:18 -08:00
parent 7a18ce8a55
commit 767500b466
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
4 changed files with 17 additions and 21 deletions

View file

@ -1,26 +1,9 @@
#include "shell.hpp"
#include <utility>
#include <qlogging.h>
#include <qobject.h>
#include <qqmlcontext.h>
#include <qqmlengine.h>
#include <qqmllist.h>
#include "rootwrapper.hpp"
void QtShell::reload(bool hard) {
auto* rootobj = QQmlEngine::contextForObject(this)->engine()->parent();
auto* root = qobject_cast<RootWrapper*>(rootobj);
if (root == nullptr) {
qWarning() << "cannot find RootWrapper for reload, ignoring request";
return;
}
root->reloadGraph(hard);
}
void QtShell::earlyInit(QObject* old) {
auto* oldshell = qobject_cast<QtShell*>(old);