Commit 6a308a6a authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Remove check if result conains query string

This essentially overrides the runner relevance and match type.

An example is my custom runner for the nordvpn cli, having the query string in the
result text would be unneeded, because one already has the category set.

This is also a perquisite for


parent 19dc0f02
Pipeline #189074 passed with stage
in 52 seconds
......@@ -48,40 +48,9 @@ public:
bool categoryHasMatchWithAllWords(const QModelIndex &categoryIdx) const
for (int i = 0; i < sourceModel()->rowCount(categoryIdx); ++i) {
const QModelIndex idx = sourceModel()->index(i, 0, categoryIdx);
const QString display =;
bool containsAllWords = true;
for (const QString &word : m_words) {
if (!display.contains(word, Qt::CaseInsensitive)) {
containsAllWords = false;
if (containsAllWords) {
return true;
return false;
bool lessThan(const QModelIndex &sourceA, const QModelIndex &sourceB) const override
// prefer categories that have a match containing the query string in the display role
if (!sourceA.parent().isValid() && !sourceB.parent().isValid()) {
const bool hasMatchWithAllWordsA = categoryHasMatchWithAllWords(sourceA);
const bool hasMatchWithAllWordsB = categoryHasMatchWithAllWords(sourceB);
if (hasMatchWithAllWordsA != hasMatchWithAllWordsB) {
return !hasMatchWithAllWordsA && hasMatchWithAllWordsB;
const int typeA =;
const int typeB =;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment