refactor: Fingerprint, KeyMap, KeySequence and Action use default == operator

This commit is contained in:
sithlord48
2025-08-05 22:06:06 -04:00
committed by Nick Bolton
parent 24480ce946
commit 4955e8c2ba
8 changed files with 4 additions and 35 deletions

View File

@ -1210,19 +1210,6 @@ void KeyMap::initKeyNameMaps()
}
}
//
// KeyMap::KeyItem
//
bool KeyMap::KeyItem::operator==(const KeyItem &x) const
{
return (
m_id == x.m_id && m_group == x.m_group && m_button == x.m_button && m_required == x.m_required &&
m_sensitive == x.m_sensitive && m_generates == x.m_generates && m_dead == x.m_dead && m_lock == x.m_lock &&
m_client == x.m_client
);
}
//
// KeyMap::Keystroke
//

View File

@ -52,7 +52,7 @@ public:
uint32_t m_client{}; //!< Client data
public:
bool operator==(const KeyItem &) const;
bool operator==(const KeyItem &) const = default;
};
//! The KeyButtons needed to synthesize a KeyID

View File

@ -96,14 +96,6 @@ void Action::saveSettings(QSettings &settings) const
settings.setValue(SettingsKeys::RestartServer, restartServer());
}
bool Action::operator==(const Action &a) const
{
return m_keySequence == a.m_keySequence && m_type == a.m_type && m_typeScreenNames == a.m_typeScreenNames &&
m_switchScreenName == a.m_switchScreenName && m_switchDirection == a.m_switchDirection &&
m_lockCursorMode == a.m_lockCursorMode && m_activeOnRelease == a.m_activeOnRelease &&
m_hasScreens == a.m_hasScreens && m_restartServer == a.m_restartServer;
}
QTextStream &operator<<(QTextStream &outStream, const Action &action)
{
if (action.activeOnRelease())

View File

@ -105,7 +105,7 @@ public:
return m_restartServer;
}
bool operator==(const Action &a) const;
bool operator==(const Action &a) const = default;
protected:
KeySequence &keySequence()

View File

@ -218,8 +218,3 @@ QString KeySequence::keyToString(int key)
// give up, deskflow probably won't handle this
return "";
}
bool KeySequence::operator==(const KeySequence &ks) const
{
return m_Sequence == ks.m_Sequence && m_Modifiers == ks.m_Modifiers && m_IsValid == ks.m_IsValid;
}

View File

@ -36,7 +36,7 @@ public:
return m_Sequence;
}
bool operator==(const KeySequence &ks) const;
bool operator==(const KeySequence &ks) const = default;
private:
void setValid(bool b)

View File

@ -24,11 +24,6 @@ bool Fingerprint::isValid() const
}
}
bool Fingerprint::operator==(const Fingerprint &other) const
{
return type == other.type && data == other.data;
}
QString Fingerprint::toDbLine() const
{
if (!isValid()) {

View File

@ -29,7 +29,7 @@ public:
bool isValid() const;
bool operator==(const Fingerprint &other) const;
bool operator==(const Fingerprint &other) const = default;
QString toDbLine() const;
static Fingerprint fromDbLine(const QString &line);
static QString typeToString(Fingerprint::Type type);