Merge branch 'Plasma/5.19'
This commit is contained in:
commit
eb6e439335
1 changed files with 10 additions and 5 deletions
|
@ -653,7 +653,6 @@ void RulesModel::populateRuleList()
|
|||
const QHash<QString, QString> RulesModel::x11PropertyHash()
|
||||
{
|
||||
static const auto propertyToRule = QHash<QString, QString> {
|
||||
{ "resourceName", "wmclass" },
|
||||
{ "caption", "title" },
|
||||
{ "role", "windowrole" },
|
||||
{ "clientMachine", "clientmachine" },
|
||||
|
@ -692,12 +691,18 @@ void RulesModel::setWindowProperties(const QVariantMap &info, bool forceValue)
|
|||
}
|
||||
m_rules["types"]->setSuggestedValue(1 << window_type, forceValue);
|
||||
|
||||
// Store "complete window class" as "resourceName" + " " + "resourceClass"
|
||||
// Do not force the value, we want it only as a suggested value for the user to select
|
||||
const QString wmcompleteclass = QStringLiteral("%1 %2").arg(info.value("resourceName").toString())
|
||||
.arg(info.value("resourceClass").toString());
|
||||
const QString wmsimpleclass = info.value("resourceClass").toString();
|
||||
const QString wmcompleteclass = QStringLiteral("%1 %2").arg(info.value("resourceName").toString(),
|
||||
info.value("resourceClass").toString());
|
||||
const bool isComplete = m_rules.value("wmclasscomplete")->value().toBool();
|
||||
|
||||
m_rules["wmclass"]->setSuggestedValue(wmsimpleclass);
|
||||
m_rules["wmclasshelper"]->setSuggestedValue(wmcompleteclass);
|
||||
|
||||
if (forceValue) {
|
||||
m_rules["wmclass"]->setValue(isComplete ? wmcompleteclass : wmsimpleclass);
|
||||
}
|
||||
|
||||
const auto ruleForProperty = x11PropertyHash();
|
||||
for (QString &property : info.keys()) {
|
||||
if (!ruleForProperty.contains(property)) {
|
||||
|
|
Loading…
Reference in a new issue