diff --git a/autotests/knewstuffentrytest.cpp b/autotests/knewstuffentrytest.cpp --- a/autotests/knewstuffentrytest.cpp +++ b/autotests/knewstuffentrytest.cpp @@ -44,7 +44,7 @@ "https://testpreview" "http://testpayload" "" "" "installed" "" "" -"ghns_exclude=1" +"ghns_excluded=1" ""; const QString name = QStringLiteral("Name"); diff --git a/src/core/engine.h b/src/core/engine.h --- a/src/core/engine.h +++ b/src/core/engine.h @@ -187,13 +187,19 @@ * setDownloadTagFilter(QStringList). * * @note The default filter if one is not set from your knsrc file will filter - * out entries marked as ghns_exclude=1. To retain this when setting a custom - * filter, add "ghns_exclude!=1" as one of the filters. + * out entries marked as ghns_excluded=1. To retain this when setting a custom + * filter, add "ghns_excluded!=1" as one of the filters. * * @note Some tags provided by OCS do not supply a value (and are simply passed * as a key). These will be interpreted as having the value 1 for filtering - * purposes. An example of this might be ghns_exclude, which in reality will - * generally be passed through ocs as "ghns_exclude" rather than "ghns_exclude=1" + * purposes. An example of this might be ghns_excluded, which in reality will + * generally be passed through ocs as "ghns_excluded" rather than "ghns_excluded=1" + * + * @note As tags are metadata, they are provided in the form of adjectives. They + * are never supplied as action verbs or instructions (as an example, a good tag + * to suggest that for example a wallpaper is painted would be "painted" as opposed + * to "paint", and another example might be that an item should be "excluded" as + * opposed to "exclude"). * * == Examples of use == * Value for tag "tagname" must be exactly "tagdata": @@ -206,7 +212,7 @@ * A tag filter line in a .knsrc file, which is a comma semarated list of * tag/value pairs, might look like: * - * TagFilter=ghns_exclude!=1,data##mimetype==application/cbr+zip,data##mimetype==application/cbr+rar + * TagFilter=ghns_excluded!=1,data##mimetype==application/cbr+zip,data##mimetype==application/cbr+rar * which would honour the exclusion and filter out anything that does not * include a comic book archive in either zip or rar format in one or more * of the download items. @@ -249,7 +255,7 @@ * * For an entry to be accepted when a download tag filter is set, it must also * be accepted by the entry filter (so, for example, while a list of downloads - * might be accepted, if the entry has ghns_exclude set, and the default entry + * might be accepted, if the entry has ghns_excluded set, and the default entry * filter is set, the entry will still be filtered out). * * In your knsrc file, set DownloadTagFilter to the filter you wish to apply, diff --git a/src/core/engine.cpp b/src/core/engine.cpp --- a/src/core/engine.cpp +++ b/src/core/engine.cpp @@ -132,7 +132,7 @@ d->tagFilter = group.readEntry("TagFilter", QStringList()); if (d->tagFilter.isEmpty()) { - d->tagFilter.append(QStringLiteral("ghns_exclude!=1")); + d->tagFilter.append(QStringLiteral("ghns_excluded!=1")); } d->downloadTagFilter = group.readEntry("DownloadTagFilter", QStringList()); diff --git a/src/core/tagsfilterchecker.h b/src/core/tagsfilterchecker.h --- a/src/core/tagsfilterchecker.h +++ b/src/core/tagsfilterchecker.h @@ -37,11 +37,11 @@ * A tag filter list is a string list of filters as shown above, and a combination * of which might look like: * - * - ghns_exclude!=1 + * - ghns_excluded!=1 * - data##mimetype==application/cbr+zip * - data##mimetype==application/cbr+rar * - * which would filter out anything which has ghns_exclude set to 1, and + * which would filter out anything which has ghns_excluded set to 1, and * anything where the value of data##mimetype does not equal either * "application/cbr+zip" or "application/cbr+rar". * Notice in particular the two data##mimetype entries. Use this diff --git a/src/core/tagsfilterchecker.cpp b/src/core/tagsfilterchecker.cpp --- a/src/core/tagsfilterchecker.cpp +++ b/src/core/tagsfilterchecker.cpp @@ -67,6 +67,7 @@ { bool result = true; if (tag == m_tag && !m_acceptedValues.contains(value)) { + qCDebug(KNEWSTUFFCORE) << "Item excluded by filter on" << m_tag << "because" << value << "was not included in" << m_acceptedValues; result = false; } return result; @@ -85,6 +86,7 @@ { bool result = true; if (tag == m_tag && m_acceptedValues.contains(value)) { + qCDebug(KNEWSTUFFCORE) << "Item excluded by filter on" << m_tag << "because" << value << "was included in" << m_acceptedValues; result = false; } return result; diff --git a/tests/testdata/entry.xml b/tests/testdata/entry.xml --- a/tests/testdata/entry.xml +++ b/tests/testdata/entry.xml @@ -11,7 +11,7 @@ http://some.http.server/coolstuff.tar.gz 10 0 - ghns_exclude=1 + ghns_excluded=1 Entry 2 (ghns included) @@ -37,7 +37,7 @@ http://some.http.server/coolstuff.tar.gz 10 0 - ghns_exclude=1 + ghns_excluded=1 Entry 4 (ghns included)