Formatting

This commit is contained in:
Klaus Basan
2017-06-23 17:31:25 +02:00
parent 36037c4c04
commit 1956a27b19
8 changed files with 24 additions and 24 deletions

View File

@@ -241,8 +241,8 @@ namespace BlackCore
const int c = this->updateAircraftInRange(callsign, vm); const int c = this->updateAircraftInRange(callsign, vm);
{ {
QReadLocker l(&m_lockAircraft); QReadLocker l(&m_lockAircraft);
CSimulatedAircraftList enabledAircrafts = m_aircraftInRange.findBy(&CSimulatedAircraft::fastPositionUpdates, true); const CSimulatedAircraftList enabledAircraft = m_aircraftInRange.findBy(&CSimulatedAircraft::fastPositionUpdates, true);
m_network->setInterimPositionReceivers(enabledAircrafts.getCallsigns()); m_network->setInterimPositionReceivers(enabledAircraft.getCallsigns());
} }
return c > 0; return c > 0;
} }
@@ -771,7 +771,7 @@ namespace BlackCore
if (changedOnline < 1) { return; } if (changedOnline < 1) { return; }
Q_ASSERT(changedOnline == 1); Q_ASSERT(changedOnline == 1);
CAtcStation station = this->m_atcStationsOnline.findFirstByCallsign(callsign); const CAtcStation station = this->m_atcStationsOnline.findFirstByCallsign(callsign);
emit this->changedAtcStationOnlineConnectionStatus(station, true); // send when voice room url is available emit this->changedAtcStationOnlineConnectionStatus(station, true); // send when voice room url is available
vm.addValue(CAtcStation::IndexIsOnline, true); // with voice room ATC is online vm.addValue(CAtcStation::IndexIsOnline, true); // with voice room ATC is online

View File

@@ -119,7 +119,7 @@ namespace BlackGui
} }
this->m_matcher.setDefaultModel(CModelMatcherComponent::defaultModel()); this->m_matcher.setDefaultModel(CModelMatcherComponent::defaultModel());
const CAircraftModel matched = this->m_matcher.getClosestMatch(remoteAircraft, &msgs); const CAircraftModel matched = this->m_matcher.getClosestMatch(remoteAircraft, &msgs); // test model matching
ui->te_Results->setText(matched.toQString(true)); ui->te_Results->setText(matched.toQString(true));
ui->tvp_ResultMessages->updateContainer(msgs); ui->tvp_ResultMessages->updateContainer(msgs);
} }

View File

@@ -35,7 +35,7 @@ namespace BlackGui
ui->setupUi(this); ui->setupUi(this);
ui->le_Callsign->setValidator(new CUpperCaseValidator(this)); ui->le_Callsign->setValidator(new CUpperCaseValidator(this));
ui->le_Callsign->setCompleter(new QCompleter(ui->le_Callsign)); ui->le_Callsign->setCompleter(new QCompleter(ui->le_Callsign));
this->m_timer.setInterval(20 * 1000); this->m_updateCompleterTimer.setInterval(20 * 1000);
this->initGui(); this->initGui();
this->m_text.setDefaultStyleSheet(CStatusMessageList::htmlStyleSheet()); this->m_text.setDefaultStyleSheet(CStatusMessageList::htmlStyleSheet());
connect(ui->le_Callsign, &QLineEdit::returnPressed, this, &CModelMatcherLogComponent::ps_callsignEntered); connect(ui->le_Callsign, &QLineEdit::returnPressed, this, &CModelMatcherLogComponent::ps_callsignEntered);
@@ -48,7 +48,7 @@ namespace BlackGui
connect(sGui->getIContextNetwork(), &IContextNetwork::changedLogOrDebugSettings, this, &CModelMatcherLogComponent::ps_valuesChanged); connect(sGui->getIContextNetwork(), &IContextNetwork::changedLogOrDebugSettings, this, &CModelMatcherLogComponent::ps_valuesChanged);
connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CModelMatcherLogComponent::ps_connectionStatusChanged); connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CModelMatcherLogComponent::ps_connectionStatusChanged);
} }
connect(&this->m_timer, &QTimer::timeout, this, &CModelMatcherLogComponent::ps_updateCallsignCompleter); connect(&this->m_updateCompleterTimer, &QTimer::timeout, this, &CModelMatcherLogComponent::ps_updateCallsignCompleter);
} }
CModelMatcherLogComponent::~CModelMatcherLogComponent() CModelMatcherLogComponent::~CModelMatcherLogComponent()
@@ -57,14 +57,14 @@ namespace BlackGui
void CModelMatcherLogComponent::initGui() void CModelMatcherLogComponent::initGui()
{ {
const bool needCallsigns = this->enabledMessages(); const bool needCallsigns = this->enabledMessages();
if (needCallsigns && !this->m_timer.isActive()) if (needCallsigns && !this->m_updateCompleterTimer.isActive())
{ {
this->m_timer.start(); this->m_updateCompleterTimer.start();
this->ps_updateCallsignCompleter(); this->ps_updateCallsignCompleter();
} }
else if (!needCallsigns) else if (!needCallsigns)
{ {
this->m_timer.stop(); this->m_updateCompleterTimer.stop();
} }
// avoid signal roundtrip // avoid signal roundtrip

View File

@@ -35,11 +35,11 @@ namespace BlackGui
explicit CModelMatcherLogComponent(QWidget *parent = nullptr); explicit CModelMatcherLogComponent(QWidget *parent = nullptr);
//! Constructor //! Constructor
~CModelMatcherLogComponent(); virtual ~CModelMatcherLogComponent();
private: private:
QScopedPointer<Ui::CModelMatcherLogComponent> ui; QScopedPointer<Ui::CModelMatcherLogComponent> ui;
QTimer m_timer { this }; QTimer m_updateCompleterTimer { this };
QTextDocument m_text { this }; QTextDocument m_text { this };
//! Init //! Init

View File

@@ -45,7 +45,7 @@ namespace BlackMisc
return s; return s;
} }
const QString CFlightPlan::flightruleToString(CFlightPlan::FlightRules rule) const QString CFlightPlan::flightRuleToString(CFlightPlan::FlightRules rule)
{ {
switch (rule) switch (rule)
{ {

View File

@@ -186,7 +186,7 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const; QString convertToQString(bool i18n = false) const;
//! Rules to string //! Rules to string
static const QString flightruleToString(FlightRules rule); static const QString flightRuleToString(FlightRules rule);
private: private:
QString m_equipmentIcao; //!< e.g. "T/A320/F" QString m_equipmentIcao; //!< e.g. "T/A320/F"

View File

@@ -286,7 +286,7 @@ namespace BlackMisc
CVariant CSimulatedAircraft::propertyByIndex(const BlackMisc::CPropertyIndex &index) const CVariant CSimulatedAircraft::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
{ {
if (index.isMyself()) { return CVariant::from(*this); } if (index.isMyself()) { return CVariant::from(*this); }
ColumnIndex i = index.frontCasted<ColumnIndex>(); const ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i) switch (i)
{ {
case IndexModel: case IndexModel:
@@ -372,7 +372,7 @@ namespace BlackMisc
break; break;
case IndexModel: case IndexModel:
this->m_models[CurrentModel].setPropertyByIndex(index.copyFrontRemoved(), variant); this->m_models[CurrentModel].setPropertyByIndex(index.copyFrontRemoved(), variant);
this->setModel(this->m_models[CurrentModel]); // sync some values this->setModel(this->m_models[CurrentModel]); // sync some values such as callsign
break; break;
case IndexNetworkModel: case IndexNetworkModel:
this->m_models[NetworkModel].setPropertyByIndex(index.copyFrontRemoved(), variant); this->m_models[NetworkModel].setPropertyByIndex(index.copyFrontRemoved(), variant);