mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Fixed gcc warnings
This commit is contained in:
@@ -38,9 +38,9 @@ namespace BlackCore
|
||||
BlackMisc::Simulation::IRemoteAircraftProvider *remoteAircraftProvider,
|
||||
QObject *parent)
|
||||
: ISimulator(parent),
|
||||
m_simulatorPluginInfo(info),
|
||||
COwnAircraftAware(ownAircraftProvider),
|
||||
CRemoteAircraftAware(remoteAircraftProvider)
|
||||
CRemoteAircraftAware(remoteAircraftProvider),
|
||||
m_simulatorPluginInfo(info)
|
||||
{
|
||||
this->setObjectName("CSimulatorCommon");
|
||||
m_oneSecondTimer = new QTimer(this);
|
||||
|
||||
@@ -55,15 +55,11 @@ namespace BlackMisc
|
||||
return;
|
||||
}
|
||||
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)
|
||||
{
|
||||
CIcons::IconIndex index = static_cast<CIcons::IconIndex>(variant.toInt());
|
||||
@@ -73,6 +69,17 @@ namespace BlackMisc
|
||||
{
|
||||
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;
|
||||
default:
|
||||
CValueObject::setPropertyByIndex(variant, index);
|
||||
|
||||
@@ -79,6 +79,12 @@ namespace BlackMisc
|
||||
CPhysicalQuantity::parseFromString(time);
|
||||
}
|
||||
|
||||
void CTime::parseFromString(const QString &time, CPqString::SeparatorMode mode)
|
||||
{
|
||||
this->parseFromString(time);
|
||||
Q_UNUSED(mode);
|
||||
}
|
||||
|
||||
QTime CTime::toQTime() const
|
||||
{
|
||||
CTime copy(*this);
|
||||
|
||||
@@ -51,6 +51,9 @@ namespace BlackMisc
|
||||
//! From string hh:mm, or hh:mm:ss, or time units such as s, min
|
||||
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
|
||||
//! \warning sign not considered
|
||||
QTime toQTime() const;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace BlackMisc
|
||||
|
||||
public:
|
||||
//! Specific values
|
||||
enum
|
||||
enum ColumnIndex
|
||||
{
|
||||
IndexData = BlackMisc::CPropertyIndex::GlobalIndexCSimulatorSetup
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user