refs #472 Removed static_cast<int> for enums in blackmisc, no longer needed.

This commit is contained in:
Mathew Sutcliffe
2015-09-27 01:41:42 +01:00
parent 9b1e42d71a
commit d13e863218
23 changed files with 104 additions and 35 deletions

View File

@@ -17,6 +17,12 @@ namespace BlackMisc
namespace Aviation
{
void CTransponder::registerMetadata()
{
CValueObject<CTransponder>::registerMetadata();
qRegisterMetaType<TransponderMode>();
}
bool CTransponder::validValues() const
{
if (this->isDefaultValue()) return true; // special case
@@ -151,7 +157,7 @@ namespace BlackMisc
switch (i)
{
case IndexMode:
return CVariant::from(static_cast<int>(this->getTransponderMode()));
return CVariant::from(this->getTransponderMode());
case IndexModeAsString:
return CVariant::from(this->getModeAsString());
case IndexTransponderCode:
@@ -176,7 +182,7 @@ namespace BlackMisc
switch (i)
{
case IndexMode:
this->setTransponderMode(static_cast<TransponderMode>(variant.toInt()));
this->setTransponderMode(variant.value<TransponderMode>());
break;
case IndexModeAsString:
this->setTransponderMode(modeFromString(variant.toQString()));