Fixed gcc warnings

This commit is contained in:
Klaus Basan
2015-04-11 09:10:59 +02:00
parent 5d819b30f5
commit 9c75ff2db5
5 changed files with 27 additions and 11 deletions

View File

@@ -38,9 +38,9 @@ namespace BlackCore
BlackMisc::Simulation::IRemoteAircraftProvider *remoteAircraftProvider, BlackMisc::Simulation::IRemoteAircraftProvider *remoteAircraftProvider,
QObject *parent) QObject *parent)
: ISimulator(parent), : ISimulator(parent),
m_simulatorPluginInfo(info),
COwnAircraftAware(ownAircraftProvider), COwnAircraftAware(ownAircraftProvider),
CRemoteAircraftAware(remoteAircraftProvider) CRemoteAircraftAware(remoteAircraftProvider),
m_simulatorPluginInfo(info)
{ {
this->setObjectName("CSimulatorCommon"); this->setObjectName("CSimulatorCommon");
m_oneSecondTimer = new QTimer(this); m_oneSecondTimer = new QTimer(this);

View File

@@ -55,15 +55,11 @@ namespace BlackMisc
return; return;
} }
ColumnIndex i = index.frontCasted<ColumnIndex>(); ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
// special case, handle icon and allow to set it
// doing this in the switch gives gcc warning as IndexIcon is no member of ColumnIndex
if (i == static_cast<int>(IndexIcon))
{ {
case IndexName:
this->setName(variant.value<QString>());
break;
case IndexVariant:
this->m_variant = variant;
break;
case IndexIcon:
if (static_cast<QMetaType::Type>(variant.type()) == QMetaType::Int) if (static_cast<QMetaType::Type>(variant.type()) == QMetaType::Int)
{ {
CIcons::IconIndex index = static_cast<CIcons::IconIndex>(variant.toInt()); CIcons::IconIndex index = static_cast<CIcons::IconIndex>(variant.toInt());
@@ -73,6 +69,17 @@ namespace BlackMisc
{ {
this->m_icon = variant.value<BlackMisc::CIcon>(); this->m_icon = variant.value<BlackMisc::CIcon>();
} }
return;
}
// properties
switch (i)
{
case IndexName:
this->setName(variant.value<QString>());
break;
case IndexVariant:
this->m_variant = variant;
break; break;
default: default:
CValueObject::setPropertyByIndex(variant, index); CValueObject::setPropertyByIndex(variant, index);

View File

@@ -79,6 +79,12 @@ namespace BlackMisc
CPhysicalQuantity::parseFromString(time); CPhysicalQuantity::parseFromString(time);
} }
void CTime::parseFromString(const QString &time, CPqString::SeparatorMode mode)
{
this->parseFromString(time);
Q_UNUSED(mode);
}
QTime CTime::toQTime() const QTime CTime::toQTime() const
{ {
CTime copy(*this); CTime copy(*this);

View File

@@ -51,6 +51,9 @@ namespace BlackMisc
//! From string hh:mm, or hh:mm:ss, or time units such as s, min //! From string hh:mm, or hh:mm:ss, or time units such as s, min
virtual void parseFromString(const QString &time) override; virtual void parseFromString(const QString &time) override;
//! From string hh:mm, or hh:mm:ss, or time units such as s, min
virtual void parseFromString(const QString &time, BlackMisc::PhysicalQuantities::CPqString::SeparatorMode mode) override;
//! To Qt time //! To Qt time
//! \warning sign not considered //! \warning sign not considered
QTime toQTime() const; QTime toQTime() const;

View File

@@ -27,7 +27,7 @@ namespace BlackMisc
public: public:
//! Specific values //! Specific values
enum enum ColumnIndex
{ {
IndexData = BlackMisc::CPropertyIndex::GlobalIndexCSimulatorSetup IndexData = BlackMisc::CPropertyIndex::GlobalIndexCSimulatorSetup
}; };