mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-10 04:15:51 +00:00
massive qml controls replacement (#114)
This commit is contained in:
@ -153,12 +153,21 @@ QStringList AWKeys::dictKeys(const bool sorted, const QString regexp) const
|
||||
}
|
||||
|
||||
|
||||
QStringList AWKeys::getHddDevices() const
|
||||
QVariantList AWKeys::getHddDevices() const
|
||||
{
|
||||
QStringList devices = m_keyOperator->devices(QString("hdd"));
|
||||
QStringList hddDevices = m_keyOperator->devices(QString("hdd"));
|
||||
// required by selector in the UI
|
||||
devices.insert(0, QString("disable"));
|
||||
devices.insert(0, QString("auto"));
|
||||
hddDevices.insert(0, QString("disable"));
|
||||
hddDevices.insert(0, QString("auto"));
|
||||
|
||||
// build model
|
||||
QVariantList devices;
|
||||
for (auto device : hddDevices) {
|
||||
QVariantMap model;
|
||||
model[QString("label")] = device;
|
||||
model[QString("name")] = device;
|
||||
devices.append(model);
|
||||
}
|
||||
|
||||
return devices;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
// keys
|
||||
Q_INVOKABLE QStringList dictKeys(const bool sorted = false,
|
||||
const QString regexp = QString()) const;
|
||||
Q_INVOKABLE QStringList getHddDevices() const;
|
||||
Q_INVOKABLE QVariantList getHddDevices() const;
|
||||
// values
|
||||
Q_INVOKABLE QString infoByKey(QString key) const;
|
||||
Q_INVOKABLE QString valueByKey(QString key) const;
|
||||
|
Reference in New Issue
Block a user