refactor(Action): move methods impls to cpp file

This commit is contained in:
sithlord48 2026-08-16 23:31:45 -04:00 committed by Nick Bolton
parent b8d230ef5f
commit 41fb627876
2 changed files with 114 additions and 76 deletions

View file

@ -57,6 +57,11 @@ QString Action::text() const
return text; return text;
} }
const KeySequence &Action::keySequence() const
{
return m_keySequence;
}
void Action::loadSettings(QSettings &settings) void Action::loadSettings(QSettings &settings)
{ {
keySequence().loadSettings(settings); keySequence().loadSettings(settings);
@ -98,6 +103,96 @@ void Action::saveSettings(QSettings &settings) const
settings.setValue(SettingsKeys::RestartServer, restartServer()); settings.setValue(SettingsKeys::RestartServer, restartServer());
} }
int Action::type() const
{
return m_type;
}
const QStringList &Action::typeScreenNames() const
{
return m_typeScreenNames;
}
const QString &Action::switchScreenName() const
{
return m_switchScreenName;
}
int Action::switchDirection() const
{
return m_switchDirection;
}
int Action::lockCursorMode() const
{
return m_lockCursorMode;
}
bool Action::activeOnRelease() const
{
return m_activeOnRelease;
}
bool Action::haveScreens() const
{
return m_hasScreens;
}
bool Action::restartServer() const
{
return m_restartServer;
}
KeySequence &Action::keySequence()
{
return m_keySequence;
}
void Action::setKeySequence(const KeySequence &seq)
{
m_keySequence = seq;
}
void Action::setType(int t)
{
m_type = t;
}
QStringList &Action::typeScreenNames()
{
return m_typeScreenNames;
}
void Action::setSwitchScreenName(const QString &n)
{
m_switchScreenName = n;
}
void Action::setSwitchDirection(int d)
{
m_switchDirection = d;
}
void Action::setLockCursorMode(int m)
{
m_lockCursorMode = m;
}
void Action::setActiveOnRelease(bool b)
{
m_activeOnRelease = b;
}
void Action::setHaveScreens(bool b)
{
m_hasScreens = b;
}
void Action::setRestartServer(bool b)
{
m_restartServer = b;
}
QTextStream &operator<<(QTextStream &outStream, const Action &action) QTextStream &operator<<(QTextStream &outStream, const Action &action)
{ {
if (action.activeOnRelease()) if (action.activeOnRelease())

View file

@ -69,88 +69,31 @@ public:
Action() = default; Action() = default;
QString text() const; QString text() const;
const KeySequence &keySequence() const const KeySequence &keySequence() const;
{
return m_keySequence;
}
void loadSettings(QSettings &settings); void loadSettings(QSettings &settings);
void saveSettings(QSettings &settings) const; void saveSettings(QSettings &settings) const;
int type() const int type() const;
{ const QStringList &typeScreenNames() const;
return m_type; const QString &switchScreenName() const;
} int switchDirection() const;
const QStringList &typeScreenNames() const int lockCursorMode() const;
{ bool activeOnRelease() const;
return m_typeScreenNames; bool haveScreens() const;
} bool restartServer() const;
const QString &switchScreenName() const
{
return m_switchScreenName;
}
int switchDirection() const
{
return m_switchDirection;
}
int lockCursorMode() const
{
return m_lockCursorMode;
}
bool activeOnRelease() const
{
return m_activeOnRelease;
}
bool haveScreens() const
{
return m_hasScreens;
}
bool restartServer() const
{
return m_restartServer;
}
bool operator==(const Action &a) const = default; bool operator==(const Action &a) const = default;
protected: protected:
KeySequence &keySequence() KeySequence &keySequence();
{ void setKeySequence(const KeySequence &seq);
return m_keySequence; void setType(int t);
} QStringList &typeScreenNames();
void setKeySequence(const KeySequence &seq) void setSwitchScreenName(const QString &n);
{ void setSwitchDirection(int d);
m_keySequence = seq; void setLockCursorMode(int m);
} void setActiveOnRelease(bool b);
void setType(int t) void setHaveScreens(bool b);
{ void setRestartServer(bool b);
m_type = t;
}
QStringList &typeScreenNames()
{
return m_typeScreenNames;
}
void setSwitchScreenName(const QString &n)
{
m_switchScreenName = n;
}
void setSwitchDirection(int d)
{
m_switchDirection = d;
}
void setLockCursorMode(int m)
{
m_lockCursorMode = m;
}
void setActiveOnRelease(bool b)
{
m_activeOnRelease = b;
}
void setHaveScreens(bool b)
{
m_hasScreens = b;
}
void setRestartServer(bool b)
{
m_restartServer = b;
}
private: private:
KeySequence m_keySequence; KeySequence m_keySequence;