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

24
src/cpp/watcher.hpp Normal file
View file

@ -0,0 +1,24 @@
#pragma once
#include <qdir.h>
#include <qfilesystemwatcher.h>
#include <qobject.h>
class FiletreeWatcher: public QObject {
Q_OBJECT;
public:
explicit FiletreeWatcher(QObject* parent = nullptr);
void addPath(const QString& path);
signals:
void fileChanged(const QString& path);
private slots:
void onDirectoryChanged(const QString& path);
void onFileChanged(const QString& path);
private:
QFileSystemWatcher watcher;
};