Replace occurrences of CVariant::toCVariant() with CVariant::from()

This commit is contained in:
Roland Winklmeier
2015-05-30 00:11:22 +02:00
parent 28d2561a48
commit e4f2c9e88a
49 changed files with 78 additions and 87 deletions

View File

@@ -35,7 +35,7 @@ namespace BlackMisc
CVariant CAircraftModel::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
{
if (index.isMyself()) { return this->toCVariant(); }
if (index.isMyself()) { return CVariant::from(*this); }
ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{

View File

@@ -101,7 +101,7 @@ namespace BlackMisc
CVariant CAirspaceAircraftSnapshot::propertyByIndex(const CPropertyIndex &index) const
{
if (index.isMyself()) { return this->toCVariant(); }
if (index.isMyself()) { return CVariant::from(*this); }
return CValueObject::propertyByIndex(index);
}

View File

@@ -101,7 +101,7 @@ namespace BlackMisc
CVariant CAircraftCfgEntries::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
{
if (index.isMyself()) { return this->toCVariant(); }
if (index.isMyself()) { return CVariant::from(*this); }
ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{

View File

@@ -93,7 +93,7 @@ namespace BlackMisc
bool CRemoteAircraftProviderDummy::updateAircraftModel(const CCallsign &callsign, const CAircraftModel &model, const COriginator &originator)
{
Q_UNUSED(originator);
CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexModel, model.toCVariant());
CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexModel, CVariant::from(model));
int n = this->m_aircraft.applyIfCallsign(callsign, vm);
return n > 0;
}

View File

@@ -41,7 +41,7 @@ namespace BlackMisc
CVariant CSimulatedAircraft::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
{
if (index.isMyself()) { return this->toCVariant(); }
if (index.isMyself()) { return CVariant::from(*this); }
ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{

View File

@@ -57,12 +57,12 @@ namespace BlackMisc
CVariant CSimulatorSetup::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
{
if (index.isMyself()) { return this->toCVariant(); }
if (index.isMyself()) { return CVariant::from(*this); }
ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{
case IndexData:
return m_data.toCVariant();
return CVariant::from(m_data);
default:
return CValueObject::propertyByIndex(index);
}