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
24
src/cpp/watcher.hpp
Normal file
24
src/cpp/watcher.hpp
Normal 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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue