Commit c560b3dd authored by Ismael Asensio's avatar Ismael Asensio
Browse files

kcm/kwinrules: Restore method textOfValue()

This convenience invokable method was removed in 66ee8985
by mistake, since it's still used in RulesEditor.qml
parent 5193658a
......@@ -69,6 +69,15 @@ int OptionsModel::indexOf(QVariant value) const
return -1;
}
QString OptionsModel::textOfValue(QVariant value) const
{
int index = indexOf(value);
if (index < 0 || index >= m_data.count()) {
return QString();
}
return m_data.at(index).text;
}
QVariant OptionsModel::value() const
{
if (m_data.isEmpty()) {
......
......@@ -56,7 +56,7 @@ public:
void updateModelData(const QList<Data> &data);
Q_INVOKABLE int indexOf(QVariant value) const;
Q_INVOKABLE QString textOfValue(QVariant value) const;
int selectedIndex() const;
signals:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment