From c55f8bd045d3512a2eceb97e9736514e2aab8bea Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 23 Sep 2025 15:20:13 +1000 Subject: plugin/fsm: update relativePath when path changed --- plugin/src/Caelestia/Models/filesystemmodel.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'plugin/src/Caelestia/Models/filesystemmodel.hpp') diff --git a/plugin/src/Caelestia/Models/filesystemmodel.hpp b/plugin/src/Caelestia/Models/filesystemmodel.hpp index cd2240d..07fb1a1 100644 --- a/plugin/src/Caelestia/Models/filesystemmodel.hpp +++ b/plugin/src/Caelestia/Models/filesystemmodel.hpp @@ -17,7 +17,7 @@ class FileSystemEntry : public QObject { QML_UNCREATABLE("FileSystemEntry instances can only be retrieved from a FileSystemModel") Q_PROPERTY(QString path READ path CONSTANT) - Q_PROPERTY(QString relativePath READ relativePath CONSTANT) + Q_PROPERTY(QString relativePath READ relativePath NOTIFY relativePathChanged) Q_PROPERTY(QString name READ name CONSTANT) Q_PROPERTY(QString baseName READ baseName CONSTANT) Q_PROPERTY(QString parentDir READ parentDir CONSTANT) @@ -41,11 +41,16 @@ public: [[nodiscard]] bool isImage() const; [[nodiscard]] QString mimeType() const; + void updateRelativePath(const QDir& dir); + +signals: + void relativePathChanged(); + private: const QFileInfo m_fileInfo; const QString m_path; - const QString m_relativePath; + QString m_relativePath; mutable bool m_isImage; mutable bool m_isImageInitialised; -- cgit v1.2.3-freya