Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/xwindowtasksmodel.cpp
Show First 20 Lines • Show All 586 Lines • ▼ Show 20 Line(s) | 565 | for (const QString &rule : rules) { | |||
---|---|---|---|---|---|
587 | const auto match = regExp.match(matchProperty); | 587 | const auto match = regExp.match(matchProperty); | ||
588 | 588 | | |||
589 | if (match.hasMatch()) { | 589 | if (match.hasMatch()) { | ||
590 | const QString actualMatch = match.captured(QStringLiteral("match")); | 590 | const QString actualMatch = match.captured(QStringLiteral("match")); | ||
591 | if (actualMatch.isEmpty()) { | 591 | if (actualMatch.isEmpty()) { | ||
592 | continue; | 592 | continue; | ||
593 | } | 593 | } | ||
594 | 594 | | |||
595 | const QString rewrittenString = ruleGroup.readEntry(QStringLiteral("Target")).arg(actualMatch); | 595 | QString rewrittenString = ruleGroup.readEntry(QStringLiteral("Target")).arg(actualMatch); | ||
596 | // If no "Target" is provided, instead assume the matched property (ClassClass/ClassName). | ||||
597 | if (rewrittenString.isEmpty()) { | ||||
598 | rewrittenString = matchProperty; | ||||
599 | } | ||||
596 | 600 | | |||
597 | services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' =~ %2)").arg(rewrittenString, serviceSearchIdentifier)); | 601 | services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' =~ %2)").arg(rewrittenString, serviceSearchIdentifier)); | ||
598 | 602 | | |||
599 | if (!services.isEmpty()) { | 603 | if (!services.isEmpty()) { | ||
600 | break; | 604 | break; | ||
601 | } | 605 | } | ||
602 | } | 606 | } | ||
603 | } | 607 | } | ||
▲ Show 20 Lines • Show All 744 Lines • Show Last 20 Lines |