refactor: simplify Config::readSectionOptions to look for only keystroke mousepress and end

This commit is contained in:
sithlord48 2026-07-11 08:05:13 -04:00 committed by Nick Bolton
parent 06b7fe1691
commit 8acf76c5d1
2 changed files with 3 additions and 20 deletions

View file

@ -484,9 +484,11 @@ void Config::readSectionOptions(ConfigReadContext &s)
std::string line; std::string line;
while (s.readLine(line)) { while (s.readLine(line)) {
// check for end of section
if (line == "end") { if (line == "end") {
return; return;
} else if (const auto l = QString::fromStdString(line).simplified();
!l.startsWith(QStringLiteral("keystroke")) && !l.startsWith(QStringLiteral("mousepress"))) {
continue;
} }
// parse argument: `nameAndArgs = [values][;[values]]' // parse argument: `nameAndArgs = [values][;[values]]'
@ -502,9 +504,6 @@ void Config::readSectionOptions(ConfigReadContext &s)
++i; ++i;
s.parseNameWithArgs("value", line, ",;\n", i, value, valueArgs); s.parseNameWithArgs("value", line, ",;\n", i, value, valueArgs);
if (m_oldNames.contains(name))
continue;
// make filter rule // make filter rule
InputFilter::Rule rule(parseCondition(s, name, nameArgs)); InputFilter::Rule rule(parseCondition(s, name, nameArgs));

View file

@ -419,22 +419,6 @@ private:
InputFilter m_inputFilter; InputFilter m_inputFilter;
bool m_hasLockToScreenAction = false; bool m_hasLockToScreenAction = false;
IEventQueue *m_events; 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 //! Configuration read context