possible fix #75

I've added 'optimize' option (by default true). If it options is set
then sources will be checked if they are required (with dependencies if
any). And if they are not required they will be dropped by using common
mechanism.

Please note that if this option enabled the following features (at the
    moment) will be unavailable:

* key request from context menu (from configuration interface it still works)
* notifications event if sources on which notification is not connected

I suppose this commit will increase performance in about 4-5 times.
This commit is contained in:
2016-02-05 11:08:09 +03:00
parent 54e1545bb1
commit d856fa8e97
23 changed files with 522 additions and 374 deletions

View File

@ -40,7 +40,7 @@ public:
virtual ~AWKeys();
Q_INVOKABLE void initDataAggregator(const QVariantMap tooltipParams);
Q_INVOKABLE void initKeys(const QString currentPattern, const int interval,
const int limit);
const int limit, const bool optimize);
Q_INVOKABLE void setAggregatorProperty(const QString key,
const QVariant value);
Q_INVOKABLE void setWrapNewLines(const bool wrap = false);
@ -84,8 +84,10 @@ private:
AWKeysAggregator *aggregator = nullptr;
AWKeyOperations *keyOperator = nullptr;
// variables
QStringList m_foundBars, m_foundKeys, m_foundLambdas;
QVariantMap m_tooltipParams;
QStringList m_foundBars, m_foundKeys, m_foundLambdas, m_requiredKeys;
QHash<QString, QString> values;
bool m_optimize = false;
bool m_wrapNewLines = false;
// multithread features
QThreadPool *m_threadPool = nullptr;