summaryrefslogtreecommitdiff
path: root/plugin/src/Caelestia/filesystemmodel.hpp
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-02 14:52:47 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-02 14:52:47 +1000
commit2601955dfd356cc8643159bb17f0ec3e41cf75a4 (patch)
tree54a5b41ec785e63653444976385076d312315b5b /plugin/src/Caelestia/filesystemmodel.hpp
parentplugin/fsm: sort dirs first (diff)
downloadcaelestia-shell-2601955dfd356cc8643159bb17f0ec3e41cf75a4.tar.gz
caelestia-shell-2601955dfd356cc8643159bb17f0ec3e41cf75a4.tar.bz2
caelestia-shell-2601955dfd356cc8643159bb17f0ec3e41cf75a4.zip
plugin/fsm: only update changed dir
Also add added and removed signals
Diffstat (limited to 'plugin/src/Caelestia/filesystemmodel.hpp')
-rw-r--r--plugin/src/Caelestia/filesystemmodel.hpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugin/src/Caelestia/filesystemmodel.hpp b/plugin/src/Caelestia/filesystemmodel.hpp
index e12b26a..e7e1cf2 100644
--- a/plugin/src/Caelestia/filesystemmodel.hpp
+++ b/plugin/src/Caelestia/filesystemmodel.hpp
@@ -78,7 +78,7 @@ public:
, m_recursive(true)
, m_filter(NoFilter) {
connect(&m_watcher, &QFileSystemWatcher::directoryChanged, this, &FileSystemModel::watchDirIfRecursive);
- connect(&m_watcher, &QFileSystemWatcher::directoryChanged, this, &FileSystemModel::updateEntries);
+ connect(&m_watcher, &QFileSystemWatcher::directoryChanged, this, &FileSystemModel::updateEntriesForDir);
}
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
@@ -102,6 +102,9 @@ signals:
void filterChanged();
void entriesChanged();
+ void added(const FileSystemEntry* entry);
+ void removed(const QString& path);
+
private:
QDir m_dir;
QFileSystemWatcher m_watcher;
@@ -115,4 +118,5 @@ private:
void update();
void updateWatcher();
void updateEntries();
+ void updateEntriesForDir(const QString& dir);
};