refactor: simplify Config::readSectionOptions to look for only keystroke mousepress and end
This commit is contained in:
parent
06b7fe1691
commit
8acf76c5d1
2 changed files with 3 additions and 20 deletions
|
|
@ -484,9 +484,11 @@ void Config::readSectionOptions(ConfigReadContext &s)
|
|||
|
||||
std::string line;
|
||||
while (s.readLine(line)) {
|
||||
// check for end of section
|
||||
if (line == "end") {
|
||||
return;
|
||||
} else if (const auto l = QString::fromStdString(line).simplified();
|
||||
!l.startsWith(QStringLiteral("keystroke")) && !l.startsWith(QStringLiteral("mousepress"))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// parse argument: `nameAndArgs = [values][;[values]]'
|
||||
|
|
@ -502,9 +504,6 @@ void Config::readSectionOptions(ConfigReadContext &s)
|
|||
++i;
|
||||
s.parseNameWithArgs("value", line, ",;\n", i, value, valueArgs);
|
||||
|
||||
if (m_oldNames.contains(name))
|
||||
continue;
|
||||
|
||||
// make filter rule
|
||||
InputFilter::Rule rule(parseCondition(s, name, nameArgs));
|
||||
|
||||
|
|
|
|||
|
|
@ -419,22 +419,6 @@ private:
|
|||
InputFilter m_inputFilter;
|
||||
bool m_hasLockToScreenAction = false;
|
||||
IEventQueue *m_events;
|
||||
inline static const QStringList m_oldNames = {
|
||||
QStringLiteral("clipboardSharing"),
|
||||
QStringLiteral("clipboardSharingSize"),
|
||||
QStringLiteral("switchCornerSize"),
|
||||
QStringLiteral("switchCorners"),
|
||||
QStringLiteral("switchNeeds"),
|
||||
QStringLiteral("protocol"),
|
||||
QStringLiteral("heartbeat"),
|
||||
QStringLiteral("switchDelay"),
|
||||
QStringLiteral("switchDoubleTap"),
|
||||
QStringLiteral("relativeMouseMoves"),
|
||||
QStringLiteral("win32KeepForeground"),
|
||||
QStringLiteral("disableLockToScreen"),
|
||||
QStringLiteral("defaultLockToScreenState"),
|
||||
QStringLiteral("address")
|
||||
};
|
||||
};
|
||||
|
||||
//! Configuration read context
|
||||
|
|
|
|||
Loading…
Reference in a new issue