Changeset View
Changeset View
Standalone View
Standalone View
rules.cpp
Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Line(s) | |||||
136 | 136 | | |||
137 | void Rules::readFromCfg(const KConfigGroup& cfg) | 137 | void Rules::readFromCfg(const KConfigGroup& cfg) | ||
138 | { | 138 | { | ||
139 | description = cfg.readEntry("Description"); | 139 | description = cfg.readEntry("Description"); | ||
140 | if (description.isEmpty()) // capitalized first, lowercase for backwards compatibility | 140 | if (description.isEmpty()) // capitalized first, lowercase for backwards compatibility | ||
141 | description = cfg.readEntry("description"); | 141 | description = cfg.readEntry("description"); | ||
142 | READ_MATCH_STRING(wmclass, .toLower().toLatin1()); | 142 | READ_MATCH_STRING(wmclass, .toLower().toLatin1()); | ||
143 | wmclasscomplete = cfg.readEntry("wmclasscomplete" , false); | 143 | wmclasscomplete = cfg.readEntry("wmclasscomplete" , false); | ||
144 | READ_MATCH_STRING(windowrole, .toLatin1()); | 144 | READ_MATCH_STRING(windowrole, .toLower().toLatin1()); | ||
145 | READ_MATCH_STRING(title,); | 145 | READ_MATCH_STRING(title,); | ||
146 | READ_MATCH_STRING(clientmachine, .toLower().toLatin1()); | 146 | READ_MATCH_STRING(clientmachine, .toLower().toLatin1()); | ||
147 | types = NET::WindowTypeMask(cfg.readEntry<uint>("types", NET::AllTypesMask)); | 147 | types = NET::WindowTypeMask(cfg.readEntry<uint>("types", NET::AllTypesMask)); | ||
148 | READ_FORCE_RULE2(placement, QString(), Placement::policyFromString, false); | 148 | READ_FORCE_RULE2(placement, QString(), Placement::policyFromString, false); | ||
149 | READ_SET_RULE_DEF(position, , invalidPoint); | 149 | READ_SET_RULE_DEF(position, , invalidPoint); | ||
150 | READ_SET_RULE(size, , QSize()); | 150 | READ_SET_RULE(size, , QSize()); | ||
151 | if (size.isEmpty() && sizerule != (SetRule)Remember) | 151 | if (size.isEmpty() && sizerule != (SetRule)Remember) | ||
152 | sizerule = UnusedSetRule; | 152 | sizerule = UnusedSetRule; | ||
▲ Show 20 Lines • Show All 293 Lines • ▼ Show 20 Line(s) | |||||
446 | 446 | | |||
447 | #ifndef KCMRULES | 447 | #ifndef KCMRULES | ||
448 | bool Rules::match(const Client* c) const | 448 | bool Rules::match(const Client* c) const | ||
449 | { | 449 | { | ||
450 | if (!matchType(c->windowType(true))) | 450 | if (!matchType(c->windowType(true))) | ||
451 | return false; | 451 | return false; | ||
452 | if (!matchWMClass(c->resourceClass(), c->resourceName())) | 452 | if (!matchWMClass(c->resourceClass(), c->resourceName())) | ||
453 | return false; | 453 | return false; | ||
454 | if (!matchRole(c->windowRole())) | 454 | if (!matchRole(c->windowRole().toLower())) | ||
455 | return false; | 455 | return false; | ||
456 | if (!matchClientMachine(c->clientMachine()->hostName(), c->clientMachine()->isLocal())) | 456 | if (!matchClientMachine(c->clientMachine()->hostName(), c->clientMachine()->isLocal())) | ||
457 | return false; | 457 | return false; | ||
458 | if (titlematch != UnimportantMatch) // track title changes to rematch rules | 458 | if (titlematch != UnimportantMatch) // track title changes to rematch rules | ||
459 | QObject::connect(c, &Client::captionChanged, c, &Client::evaluateWindowRules, | 459 | QObject::connect(c, &Client::captionChanged, c, &Client::evaluateWindowRules, | ||
460 | // QueuedConnection, because title may change before | 460 | // QueuedConnection, because title may change before | ||
461 | // the client is ready (could segfault!) | 461 | // the client is ready (could segfault!) | ||
462 | static_cast<Qt::ConnectionType>(Qt::QueuedConnection|Qt::UniqueConnection)); | 462 | static_cast<Qt::ConnectionType>(Qt::QueuedConnection|Qt::UniqueConnection)); | ||
▲ Show 20 Lines • Show All 670 Lines • Show Last 20 Lines |