Initial support of templates and so on (#71)

* Initial syntax is the following:

    * $template{{ some JS code here }} - simple template based on JS
      code inside. It works the same as lambda functions, but calculates
      only once.
    * aw_count(regex) - keys count found for given regex
    * aw_keys(regex, [separator]) - keys found for given regex and
      joined by using given separator
    * aw_names(regex, [separator]) - key names found for given regex and
      joined by using given separator (the same as previous but w\o $)

  The template and function syntax may be changed before release.

* replace `foreach` to `for (auto foo : bar)` and update CONTRIBUTING.md
  accordingly
This commit is contained in:
2016-01-30 00:07:47 +07:00
parent fba58c27e8
commit 1c78e0d779
23 changed files with 224 additions and 106 deletions

View File

@ -102,7 +102,7 @@ QString AWKeysAggregator::formater(const QVariant &data,
case TimeCustom:
output = m_customTime;
[&output, loc, this](const QDateTime dt) {
foreach (QString key, timeKeys)
for (auto key : timeKeys)
output.replace(QString("$%1").arg(key), loc.toString(dt, key));
}(data.toDateTime());
break;