diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-22 13:56:21 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-22 13:56:21 +1000 |
| commit | a08b5daf962c265e642306e33e3044650cc860ce (patch) | |
| tree | 5c0dad24f2ce20a7c262cf8486053cd685d655d3 /plugin/src/Caelestia | |
| parent | drawers: fix input mask on special ws (diff) | |
| download | caelestia-shell-a08b5daf962c265e642306e33e3044650cc860ce.tar.gz caelestia-shell-a08b5daf962c265e642306e33e3044650cc860ce.tar.bz2 caelestia-shell-a08b5daf962c265e642306e33e3044650cc860ce.zip | |
plugin/appdb: forward signals
Diffstat (limited to 'plugin/src/Caelestia')
| -rw-r--r-- | plugin/src/Caelestia/Models/filesystemmodel.cpp | 2 | ||||
| -rw-r--r-- | plugin/src/Caelestia/appdb.cpp | 16 | ||||
| -rw-r--r-- | plugin/src/Caelestia/appdb.hpp | 25 |
3 files changed, 30 insertions, 13 deletions
diff --git a/plugin/src/Caelestia/Models/filesystemmodel.cpp b/plugin/src/Caelestia/Models/filesystemmodel.cpp index 536f14b..2740cbd 100644 --- a/plugin/src/Caelestia/Models/filesystemmodel.cpp +++ b/plugin/src/Caelestia/Models/filesystemmodel.cpp @@ -8,7 +8,7 @@ namespace caelestia { FileSystemEntry::FileSystemEntry(const QString& path, const QString& relativePath, QObject* parent) : QObject(parent) - , m_fileInfo(QFileInfo(path)) + , m_fileInfo(path) , m_path(path) , m_relativePath(relativePath) , m_isImageInitialised(false) diff --git a/plugin/src/Caelestia/appdb.cpp b/plugin/src/Caelestia/appdb.cpp index f55b4db..a81019b 100644 --- a/plugin/src/Caelestia/appdb.cpp +++ b/plugin/src/Caelestia/appdb.cpp @@ -9,7 +9,17 @@ namespace caelestia { AppEntry::AppEntry(QObject* entry, unsigned int frequency, QObject* parent) : QObject(parent) , m_entry(entry) - , m_frequency(frequency) {} + , m_frequency(frequency) { + const auto mo = m_entry->metaObject(); + const auto tmo = metaObject(); + + for (const auto& prop : + { "name", "comment", "execString", "startupClass", "genericName", "categories", "keywords" }) { + const auto metaProp = mo->property(mo->indexOfProperty(prop)); + const auto thisMetaProp = tmo->property(tmo->indexOfProperty(prop)); + connect(m_entry, metaProp.notifySignal(), this, thisMetaProp.notifySignal()); + } +} QObject* AppEntry::entry() const { return m_entry; @@ -39,7 +49,7 @@ QString AppEntry::name() const { return m_entry->property("name").toString(); } -QString AppEntry::desc() const { +QString AppEntry::comment() const { return m_entry->property("comment").toString(); } @@ -47,7 +57,7 @@ QString AppEntry::execString() const { return m_entry->property("execString").toString(); } -QString AppEntry::wmClass() const { +QString AppEntry::startupClass() const { return m_entry->property("startupClass").toString(); } diff --git a/plugin/src/Caelestia/appdb.hpp b/plugin/src/Caelestia/appdb.hpp index dfedcc6..46aed59 100644 --- a/plugin/src/Caelestia/appdb.hpp +++ b/plugin/src/Caelestia/appdb.hpp @@ -16,13 +16,13 @@ class AppEntry : public QObject { Q_PROPERTY(quint32 frequency READ frequency NOTIFY frequencyChanged) Q_PROPERTY(QString id READ id CONSTANT) - Q_PROPERTY(QString name READ name CONSTANT) - Q_PROPERTY(QString desc READ desc CONSTANT) - Q_PROPERTY(QString execString READ execString CONSTANT) - Q_PROPERTY(QString wmClass READ wmClass CONSTANT) - Q_PROPERTY(QString genericName READ genericName CONSTANT) - Q_PROPERTY(QString categories READ categories CONSTANT) - Q_PROPERTY(QString keywords READ keywords CONSTANT) + Q_PROPERTY(QString name READ name NOTIFY nameChanged) + Q_PROPERTY(QString comment READ comment NOTIFY commentChanged) + Q_PROPERTY(QString execString READ execString NOTIFY execStringChanged) + Q_PROPERTY(QString startupClass READ startupClass NOTIFY startupClassChanged) + Q_PROPERTY(QString genericName READ genericName NOTIFY genericNameChanged) + Q_PROPERTY(QString categories READ categories NOTIFY categoriesChanged) + Q_PROPERTY(QString keywords READ keywords NOTIFY keywordsChanged) public: explicit AppEntry(QObject* entry, quint32 frequency, QObject* parent = nullptr); @@ -35,15 +35,22 @@ public: [[nodiscard]] QString id() const; [[nodiscard]] QString name() const; - [[nodiscard]] QString desc() const; + [[nodiscard]] QString comment() const; [[nodiscard]] QString execString() const; - [[nodiscard]] QString wmClass() const; + [[nodiscard]] QString startupClass() const; [[nodiscard]] QString genericName() const; [[nodiscard]] QString categories() const; [[nodiscard]] QString keywords() const; signals: void frequencyChanged(); + void nameChanged(); + void commentChanged(); + void execStringChanged(); + void startupClassChanged(); + void genericNameChanged(); + void categoriesChanged(); + void keywordsChanged(); private: QObject* m_entry; |