- // If term has sub terms, then the sub terms are always "rating" and "modified" terms.
- // If term has no sub terms, then the term itself is either a "rating" term or a "modified"
- // term. To avoid code duplication we add term to subTerms list, if the list is empty.
- QStringList subTerms = term.split(' ', QString::SkipEmptyParts);
-
- foreach (const QString& subTerm, subTerms) {
- if (subTerm.startsWith(QLatin1String("modified>="))) {
- const QString value = subTerm.mid(10);
- const QDate date = QDate::fromString(value, Qt::ISODate);
- setTimespan(date);
- } else if (subTerm.startsWith(QLatin1String("rating>="))) {
- const QString value = subTerm.mid(8);
- const int stars = value.toInt() / 2;
- setRating(stars);
- } else if (subTerm.startsWith(QLatin1String("tag:")) ||
- subTerm.startsWith(QLatin1String("tag="))) {
- const QString value = subTerm.mid(4);
- addSearchTag(value);
- }
+ if (term.startsWith(QLatin1String("modified>="))) {
+ const QString value = term.mid(10);
+ const QDate date = QDate::fromString(value, Qt::ISODate);
+ setTimespan(date);
+ } else if (term.startsWith(QLatin1String("rating>="))) {
+ const QString value = term.mid(8);
+ const int stars = value.toInt() / 2;
+ setRating(stars);
+ } else if (term.startsWith(QLatin1String("tag:")) ||
+ term.startsWith(QLatin1String("tag="))) {
+ const QString value = term.mid(4);
+ addSearchTag(value);