add initial support of tag suggestion

This commit is contained in:
2016-10-24 08:12:14 +03:00
parent d520f55afc
commit 87406f70c4
6 changed files with 65 additions and 11 deletions

View File

@ -72,15 +72,21 @@ int DPAdds::currentDesktop() const
}
QStringList DPAdds::dictKeys(const bool, const QString) const
QStringList DPAdds::dictKeys(const bool sorted, const QString regexp) const
{
qCDebug(LOG_DP) << "Should be sorted" << sorted << "and filter applied"
<< regexp;
QStringList allKeys;
allKeys.append(QString("mark"));
allKeys.append(QString("name"));
allKeys.append(QString("number"));
allKeys.append(QString("total"));
return allKeys;
if (sorted)
allKeys.sort();
return allKeys.filter(QRegExp(regexp));
}

View File

@ -45,8 +45,8 @@ public:
virtual ~DPAdds();
Q_INVOKABLE bool isDebugEnabled() const;
Q_INVOKABLE int currentDesktop() const;
Q_INVOKABLE QStringList dictKeys(const bool = true,
const QString = QString()) const;
Q_INVOKABLE QStringList dictKeys(const bool sorted = true,
const QString regexp = QString()) const;
Q_INVOKABLE int numberOfDesktops() const;
Q_INVOKABLE QString toolTipImage(const int desktop) const;
Q_INVOKABLE QString parsePattern(const QString pattern,