Classes like ButtonEditDialog
JoyButtonSlot
(and probably many other) have many duplications in overrides constructors.
For example
JoyButtonSlot::JoyButtonSlot(QObject *parent)
: QObject(parent)
, extraData()
{
deviceCode = 0;
m_mode = JoyKeyboard;
m_distance = 0.0;
previousDistance = 0.0;
qkeyaliasCode = 0;
easingActive = false;
mix_slots = nullptr;
}
JoyButtonSlot::JoyButtonSlot(int code, JoySlotInputAction mode, QObject *parent)
: QObject(parent)
, extraData()
{
deviceCode = 0;
qkeyaliasCode = 0;
if (code > 0)
deviceCode = code;
m_mode = mode;
m_distance = 0.0;
easingActive = false;
mix_slots = nullptr;
}
JoyButtonSlot::JoyButtonSlot(int code, int alias, JoySlotInputAction mode, QObject *parent)
: QObject(parent)
, extraData()
{
deviceCode = 0;
qkeyaliasCode = 0;
if (code > 0)
deviceCode = code;
if (alias > 0)
qkeyaliasCode = alias;
m_mode = mode;
m_distance = 0.0;
easingActive = false;
mix_slots = nullptr;
}
Instead of duplicating code, these constructors could call each other
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too