refactor: Fingerprint, KeyMap, KeySequence and Action use default == operator
This commit is contained in:
parent
24480ce946
commit
4955e8c2ba
8 changed files with 4 additions and 35 deletions
|
|
@ -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
|
// KeyMap::Keystroke
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ public:
|
||||||
uint32_t m_client{}; //!< Client data
|
uint32_t m_client{}; //!< Client data
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool operator==(const KeyItem &) const;
|
bool operator==(const KeyItem &) const = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! The KeyButtons needed to synthesize a KeyID
|
//! The KeyButtons needed to synthesize a KeyID
|
||||||
|
|
|
||||||
|
|
@ -96,14 +96,6 @@ void Action::saveSettings(QSettings &settings) const
|
||||||
settings.setValue(SettingsKeys::RestartServer, restartServer());
|
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)
|
QTextStream &operator<<(QTextStream &outStream, const Action &action)
|
||||||
{
|
{
|
||||||
if (action.activeOnRelease())
|
if (action.activeOnRelease())
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ public:
|
||||||
return m_restartServer;
|
return m_restartServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const Action &a) const;
|
bool operator==(const Action &a) const = default;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
KeySequence &keySequence()
|
KeySequence &keySequence()
|
||||||
|
|
|
||||||
|
|
@ -218,8 +218,3 @@ QString KeySequence::keyToString(int key)
|
||||||
// give up, deskflow probably won't handle this
|
// give up, deskflow probably won't handle this
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KeySequence::operator==(const KeySequence &ks) const
|
|
||||||
{
|
|
||||||
return m_Sequence == ks.m_Sequence && m_Modifiers == ks.m_Modifiers && m_IsValid == ks.m_IsValid;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public:
|
||||||
return m_Sequence;
|
return m_Sequence;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const KeySequence &ks) const;
|
bool operator==(const KeySequence &ks) const = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setValid(bool b)
|
void setValid(bool b)
|
||||||
|
|
|
||||||
|
|
@ -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
|
QString Fingerprint::toDbLine() const
|
||||||
{
|
{
|
||||||
if (!isValid()) {
|
if (!isValid()) {
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ public:
|
||||||
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
|
||||||
bool operator==(const Fingerprint &other) const;
|
bool operator==(const Fingerprint &other) const = default;
|
||||||
QString toDbLine() const;
|
QString toDbLine() const;
|
||||||
static Fingerprint fromDbLine(const QString &line);
|
static Fingerprint fromDbLine(const QString &line);
|
||||||
static QString typeToString(Fingerprint::Type type);
|
static QString typeToString(Fingerprint::Type type);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue