plugin/appdb: forward signals
This commit is contained in:
parent
229eaa284d
commit
a08b5daf96
4 changed files with 32 additions and 15 deletions
|
|
@ -33,13 +33,13 @@ Searcher {
|
|||
keys = ["categories", "name"];
|
||||
weights = [0.9, 0.1];
|
||||
} else if (search.startsWith(`${prefix}d `)) {
|
||||
keys = ["desc", "name"];
|
||||
keys = ["comment", "name"];
|
||||
weights = [0.9, 0.1];
|
||||
} else if (search.startsWith(`${prefix}e `)) {
|
||||
keys = ["execString", "name"];
|
||||
weights = [0.9, 0.1];
|
||||
} else if (search.startsWith(`${prefix}w `)) {
|
||||
keys = ["wmClass", "name"];
|
||||
keys = ["startupClass", "name"];
|
||||
weights = [0.9, 0.1];
|
||||
} else if (search.startsWith(`${prefix}g `)) {
|
||||
keys = ["genericName", "name"];
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue