feat: add filesystem watcher and rename QtShell object

This commit is contained in:
outfoxxed 2024-02-04 23:00:59 -08:00
parent cab5ffc65e
commit c0d6e63f6c
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
9 changed files with 142 additions and 42 deletions

View file

@ -1,31 +1,31 @@
#pragma once
#include <qobject.h>
#include <qobjectdefs.h>
#include <qqmlengine.h>
#include <qtmetamacros.h>
#include <qurl.h>
#include "scavenge.hpp"
#include "shell.hpp"
#include "watcher.hpp"
class RootWrapper: public QObject, virtual public Scavengeable {
Q_OBJECT;
public:
explicit RootWrapper(QUrl rootUrl);
void reloadGraph(bool hard);
void changeRoot(QtShell* newRoot);
explicit RootWrapper(QString rootPath);
QObject* scavengeTargetFor(QObject* child) override;
void reloadGraph(bool hard);
private slots:
void destroy();
void onConfigChanged();
void onWatchedFilesChanged();
private:
QUrl rootUrl;
QString rootPath;
QQmlEngine engine;
QtShell* activeRoot = nullptr;
QMetaObject::Connection destroyConnection;
ShellRoot* root = nullptr;
FiletreeWatcher* configWatcher = nullptr;
};