forked from quickshell/quickshell
feat: add filesystem watcher and rename QtShell object
This commit is contained in:
parent
cab5ffc65e
commit
c0d6e63f6c
9 changed files with 142 additions and 42 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue