CJoystickButton fixes

This commit is contained in:
Roland Winklmeier
2018-10-05 21:52:14 +02:00
committed by Klaus Basan
parent 832082c5bc
commit f90ad72d9e
2 changed files with 8 additions and 11 deletions

View File

@@ -32,7 +32,8 @@ namespace BlackMisc
void CJoystickButton::setButtonObject(CJoystickButton button)
{
this->m_buttonIndex = button.m_buttonIndex;
m_deviceName = button.m_deviceName;
m_buttonIndex = button.m_buttonIndex;
}
void CJoystickButton::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
@@ -48,7 +49,7 @@ namespace BlackMisc
case IndexButtonAsString:
this->setButtonIndex(buttonIndexFromString(variant.value<QString>()));
break;
case IndeButtonObject:
case IndexButtonObject:
this->setButtonObject(variant.value<BlackMisc::Input::CJoystickButton>());
break;
default:
@@ -63,14 +64,10 @@ namespace BlackMisc
ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{
case IndexDeviceName:
return CVariant::from(this->getDeviceName());
case IndexButton:
return CVariant::from(this->getButtonIndex());
case IndexButtonAsString:
return CVariant::from(this->getButtonAsString());
default:
break;
case IndexDeviceName: return CVariant::from(this->getDeviceName());
case IndexButton: return CVariant::from(this->getButtonIndex());
case IndexButtonAsString: return CVariant::from(this->getButtonAsString());
case IndexButtonObject: return CVariant::from(*this);
}
Q_ASSERT_X(false, "CJoystickButton", "index unknown");

View File

@@ -36,7 +36,7 @@ namespace BlackMisc
IndexDeviceName = CPropertyIndex::GlobalIndexCJoystickButton,
IndexButton,
IndexButtonAsString,
IndeButtonObject, // just for updates
IndexButtonObject, // just for updates
};
//! Default constructor