refs #246 passing c++11 brace-initialized QStringList to CRuntime::logSlot

This commit is contained in:
Mathew Sutcliffe
2014-06-11 19:35:32 +01:00
parent cdd0ae6324
commit 26c270c9a6
3 changed files with 20 additions and 4 deletions

View File

@@ -331,7 +331,7 @@ namespace BlackCore
*/
void CContextNetwork::psFsdConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to, const QString &message)
{
if (this->getRuntime()->isSlotLogForNetworkEnabled()) this->getRuntime()->logSlot(Q_FUNC_INFO, QString::number(from), QString::number(to));
if (this->getRuntime()->isSlotLogForNetworkEnabled()) this->getRuntime()->logSlot(Q_FUNC_INFO, { QString::number(from), QString::number(to) });
CStatusMessageList msgs;
// send 1st position
if (to == INetwork::Connected)
@@ -358,7 +358,7 @@ namespace BlackCore
*/
void CContextNetwork::psFsdRealNameReplyReceived(const CCallsign &callsign, const QString &realname)
{
if (this->getRuntime()->isSlotLogForNetworkEnabled()) this->getRuntime()->logSlot(Q_FUNC_INFO, callsign.toQString(), realname);
if (this->getRuntime()->isSlotLogForNetworkEnabled()) this->getRuntime()->logSlot(Q_FUNC_INFO, { callsign.toQString(), realname });
if (realname.isEmpty()) return;
CIndexVariantMap vm(CAtcStation::IndexControllerRealName, realname);
this->m_atcStationsOnline.applyIf(&CAtcStation::getCallsign, callsign, vm);

View File

@@ -250,6 +250,16 @@ namespace BlackCore
qDebug() << func << p1 << p2 << p3 << p4;
}
void CRuntime::logSlot(const char *func, const QString &param) const
{
qDebug() << func << param;
}
void CRuntime::logSlot(const char *func, const QStringList &params) const
{
qDebug() << func << params;
}
void CRuntime::logSlot(const char *func, bool boolValue) const
{
qDebug() << func << boolValue;

View File

@@ -103,8 +103,14 @@ namespace BlackCore
bool isSlotLogForSimulatorEnabled() const { return this->m_slotLogSimulator; }
//! Slot logging
//! \todo to be replace if initializer lists becomes available
void logSlot(const char *func, const QString &p1 = "", const QString &p2 = "", const QString &p3 = "", const QString &p4 = "") const;
//! \deprecated Use a brace-initialized QStringList
void logSlot(const char *func, const QString &param, const QString &p2, const QString &p3 = "", const QString &p4 = "") const;
//! Slot logging
void logSlot(const char *func, const QString &param = "") const;
//! Slot logging
void logSlot(const char *func, const QStringList &params) const;
//! Slot logging for bool value
void logSlot(const char *func, bool boolValue) const;