mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
Ref T485 Adjust CLogMessage and CStatusMessage call sites to use the new API.
This commit is contained in:
@@ -59,13 +59,13 @@ namespace BlackCore
|
||||
Q_ASSERT_X(m_inputCodec, "CAudioInputDeviceVatlib", "VatLocalCodec is invalid!");
|
||||
if (!device.isValid())
|
||||
{
|
||||
CLogMessage(this).warning("Cannot set invalid input device!");
|
||||
CLogMessage(this).warning(u"Cannot set invalid input device!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Vat_SetAudioInputDevice(m_inputCodec.data(), device.getIndex()))
|
||||
{
|
||||
CLogMessage(this).warning("Setting input device failed");
|
||||
CLogMessage(this).warning(u"Setting input device failed");
|
||||
}
|
||||
m_currentDevice = device;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ namespace BlackCore
|
||||
Q_ASSERT_X(m_outputCodec, "CAudioOutputDeviceVatlib", "VatLocalCodec is invalid!");
|
||||
if (!device.isValid())
|
||||
{
|
||||
CLogMessage(this).warning("Cannot set invalid output device!");
|
||||
CLogMessage(this).warning(u"Cannot set invalid output device!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -974,7 +974,7 @@ namespace BlackCore
|
||||
{
|
||||
if (CBuildConfig::isLocalDeveloperDebugBuild())
|
||||
{
|
||||
CLogMessage(static_cast<CNetworkVatlib *>(nullptr)).debug("Wrong transponder code '%1' for '%2'") << position->transponderCode << callsign;
|
||||
CLogMessage(static_cast<CNetworkVatlib *>(nullptr)).debug(u"Wrong transponder code '%1' for '%2'") << position->transponderCode << callsign;
|
||||
}
|
||||
|
||||
// I set a default: IFR standby is a reasonable default
|
||||
@@ -993,7 +993,7 @@ namespace BlackCore
|
||||
|
||||
if (parserError.error != QJsonParseError::NoError)
|
||||
{
|
||||
CLogMessage(self).warning("Failed to parse aircraft config packet: '%1' packet: '%2'") << parserError.errorString() << QString(json);
|
||||
CLogMessage(self).warning(u"Failed to parse aircraft config packet: '%1' packet: '%2'") << parserError.errorString() << QString(json);
|
||||
return; // we cannot parse the packet, so we give up here
|
||||
}
|
||||
|
||||
@@ -1075,7 +1075,7 @@ namespace BlackCore
|
||||
{
|
||||
if (data.size() < 9)
|
||||
{
|
||||
CLogMessage(this).warning("Malformed FSIPI packet");
|
||||
CLogMessage(this).warning(u"Malformed FSIPI packet");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1088,7 +1088,7 @@ namespace BlackCore
|
||||
{
|
||||
if (data.size() < 9)
|
||||
{
|
||||
CLogMessage(this).warning("Malformed FSIPIR packet");
|
||||
CLogMessage(this).warning(u"Malformed FSIPIR packet");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1108,7 +1108,7 @@ namespace BlackCore
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).warning("Unknown custom packet from %1 - id: %2") << callsign.toQString() << packetId;
|
||||
CLogMessage(this).warning(u"Unknown custom packet from %1 - id: %2") << callsign.toQString() << packetId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1476,30 +1476,30 @@ namespace BlackCore
|
||||
auto *self = cbvar_cast(cbvar);
|
||||
switch (error)
|
||||
{
|
||||
case vatServerErrorCsInUs: CLogMessage(self).error("The requested callsign is already taken"); emit self->terminate(); break;
|
||||
case vatServerErrorCallsignInvalid: CLogMessage(self).error("The requested callsign is not valid"); emit self->terminate(); break;
|
||||
case vatServerErrorCidInvalid: CLogMessage(self).error("Wrong user ID or password"); emit self->terminate(); break;
|
||||
case vatServerErrorRevision: CLogMessage(self).error("This server does not support our protocol version"); emit self->terminate(); break;
|
||||
case vatServerErrorLevel: CLogMessage(self).error("You are not authorized to use the requested pilot rating"); emit self->terminate(); break;
|
||||
case vatServerErrorServFull: CLogMessage(self).error("The server is full"); emit self->terminate(); break;
|
||||
case vatServerErrorCsSuspended: CLogMessage(self).error("Your user account is suspended"); emit self->terminate(); break;
|
||||
case vatServerErrorInvPos: CLogMessage(self).error("You are not authorized to use the requested rating"); emit self->terminate(); break;
|
||||
case vatServerErrorUnAuth: CLogMessage(self).error("This software is not authorized for use on this network"); emit self->terminate(); break;
|
||||
case vatServerErrorCsInUs: CLogMessage(self).error(u"The requested callsign is already taken"); emit self->terminate(); break;
|
||||
case vatServerErrorCallsignInvalid: CLogMessage(self).error(u"The requested callsign is not valid"); emit self->terminate(); break;
|
||||
case vatServerErrorCidInvalid: CLogMessage(self).error(u"Wrong user ID or password"); emit self->terminate(); break;
|
||||
case vatServerErrorRevision: CLogMessage(self).error(u"This server does not support our protocol version"); emit self->terminate(); break;
|
||||
case vatServerErrorLevel: CLogMessage(self).error(u"You are not authorized to use the requested pilot rating"); emit self->terminate(); break;
|
||||
case vatServerErrorServFull: CLogMessage(self).error(u"The server is full"); emit self->terminate(); break;
|
||||
case vatServerErrorCsSuspended: CLogMessage(self).error(u"Your user account is suspended"); emit self->terminate(); break;
|
||||
case vatServerErrorInvPos: CLogMessage(self).error(u"You are not authorized to use the requested rating"); emit self->terminate(); break;
|
||||
case vatServerErrorUnAuth: CLogMessage(self).error(u"This software is not authorized for use on this network"); emit self->terminate(); break;
|
||||
|
||||
case vatServerErrorNone: CLogMessage(self).info("OK"); break;
|
||||
case vatServerErrorSyntax: CLogMessage(self).info("Malformed packet: Syntax error: %1") << self->fromFSD(data); break;
|
||||
case vatServerErrorSrcInvalid: CLogMessage(self).info("Server: source invalid %1") << self->fromFSD(data); break;
|
||||
case vatServerErrorNoSuchCs: CLogMessage(self).info("Shim lib: %1 (%2)") << self->fromFSD(msg) << self->fromFSD(data); break;
|
||||
case vatServerErrorNoFP: CLogMessage(self).info("Server: no flight plan"); break;
|
||||
case vatServerErrorNoWeather: CLogMessage(self).info("Server: requested weather profile does not exist"); break;
|
||||
case vatServerErrorNone: CLogMessage(self).info(u"OK"); break;
|
||||
case vatServerErrorSyntax: CLogMessage(self).info(u"Malformed packet: Syntax error: %1") << self->fromFSD(data); break;
|
||||
case vatServerErrorSrcInvalid: CLogMessage(self).info(u"Server: source invalid %1") << self->fromFSD(data); break;
|
||||
case vatServerErrorNoSuchCs: CLogMessage(self).info(u"Shim lib: %1 (%2)") << self->fromFSD(msg) << self->fromFSD(data); break;
|
||||
case vatServerErrorNoFP: CLogMessage(self).info(u"Server: no flight plan"); break;
|
||||
case vatServerErrorNoWeather: CLogMessage(self).info(u"Server: requested weather profile does not exist"); break;
|
||||
|
||||
// we have no idea what these mean
|
||||
case vatServerErrorRegistered:
|
||||
case vatServerErrorInvalidCtrl: CLogMessage(self).info("Server: ") << self->fromFSD(msg); break;
|
||||
case vatServerErrorInvalidCtrl: CLogMessage(self).info(u"Server: ") << self->fromFSD(msg); break;
|
||||
|
||||
// default: qFatal("vatlib: %s (error %d)", msg, error); emit self->terminate();
|
||||
// KB: Why the hard termination?
|
||||
default: CLogMessage(self).error("vatlib: %1 (error %2)") << msg << error; emit self->terminate(); break;
|
||||
default: CLogMessage(self).error(u"vatlib: %1 (error %2)") << msg << error; emit self->terminate(); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace BlackCore
|
||||
// Worker thread, make sure to write no members here od do it threadsafe
|
||||
if (!this->doWorkCheck())
|
||||
{
|
||||
CLogMessage(this).info("Terminated booking parsing process");
|
||||
CLogMessage(this).info(u"Terminated booking parsing process");
|
||||
return; // stop, terminate straight away, ending thread
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace BlackCore
|
||||
bool changed = this->didContentChange(xmlData, xmlData.indexOf("</timestamp>"));
|
||||
if (!changed)
|
||||
{
|
||||
CLogMessage(this).info("Read bookings unchanged, skipped");
|
||||
CLogMessage(this).info(u"Read bookings unchanged, skipped");
|
||||
emit this->atcBookingsReadUnchanged();
|
||||
return; // stop, terminate straight away, ending thread
|
||||
}
|
||||
@@ -133,7 +133,7 @@ namespace BlackCore
|
||||
{
|
||||
if (!this->doWorkCheck())
|
||||
{
|
||||
CLogMessage(this).info("Terminated booking parsing process"); // for users
|
||||
CLogMessage(this).info(u"Terminated booking parsing process"); // for users
|
||||
return; // stop, terminate straight away, ending thread
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ namespace BlackCore
|
||||
else
|
||||
{
|
||||
// network error
|
||||
CLogMessage(this).warning("Reading bookings failed %1 %2") << nwReply->errorString() << nwReply->url().toString();
|
||||
CLogMessage(this).warning(u"Reading bookings failed %1 %2") << nwReply->errorString() << nwReply->url().toString();
|
||||
nwReply->abort();
|
||||
emit this->dataRead(CEntityFlags::BookingEntity, CEntityFlags::ReadFailed, 0);
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace BlackCore
|
||||
// Worker thread, make sure to write only synced here!
|
||||
if (!this->doWorkCheck())
|
||||
{
|
||||
CLogMessage(this).info("Terminated VATSIM file parsing process");
|
||||
CLogMessage(this).info(u"Terminated VATSIM file parsing process");
|
||||
return; // stop, terminate straight away, ending thread
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ namespace BlackCore
|
||||
if (dataFileData.isEmpty()) { return; }
|
||||
if (!this->didContentChange(dataFileData)) // Quick check by hash
|
||||
{
|
||||
CLogMessage(this).info("VATSIM file has same content, skipped");
|
||||
CLogMessage(this).info(u"VATSIM file has same content, skipped");
|
||||
return;
|
||||
}
|
||||
const QList<QStringRef> lines = splitLinesRefs(dataFileData);
|
||||
@@ -248,7 +248,7 @@ namespace BlackCore
|
||||
{
|
||||
if (!this->doWorkCheck())
|
||||
{
|
||||
CLogMessage(this).info("Terminated VATSIM file parsing process"); // for users
|
||||
CLogMessage(this).info(u"Terminated VATSIM file parsing process"); // for users
|
||||
return; // stop, terminate straight away, ending thread
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ namespace BlackCore
|
||||
const bool alreadyRead = (updateTimestampFromFile == this->getUpdateTimestamp());
|
||||
if (alreadyRead)
|
||||
{
|
||||
CLogMessage(this).info("VATSIM file has same timestamp, skipped");
|
||||
CLogMessage(this).info(u"VATSIM file has same timestamp, skipped");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -426,7 +426,7 @@ namespace BlackCore
|
||||
else
|
||||
{
|
||||
// network error
|
||||
CLogMessage(this).warning("Reading VATSIM data file failed '%1' '%2'") << nwReply->errorString() << nwReply->url().toString();
|
||||
CLogMessage(this).warning(u"Reading VATSIM data file failed '%1' '%2'") << nwReply->errorString() << nwReply->url().toString();
|
||||
nwReply->abort();
|
||||
emit this->dataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFailed, 0);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace BlackCore
|
||||
|
||||
if (!this->doWorkCheck())
|
||||
{
|
||||
CLogMessage(this).info("Terminated METAR decoding process"); // for users
|
||||
CLogMessage(this).info(u"Terminated METAR decoding process"); // for users
|
||||
return; // stop, terminate straight away, ending thread
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace BlackCore
|
||||
|
||||
if (!this->didContentChange(metarData)) // Quick check by hash
|
||||
{
|
||||
CLogMessage(this).info("METAR file has same content, skipped");
|
||||
CLogMessage(this).info(u"METAR file has same content, skipped");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace BlackCore
|
||||
else
|
||||
{
|
||||
// network error
|
||||
CLogMessage(this).warning("Reading METARs failed '%1' for '%2'") << nwReply->errorString() << nwReply->url().toString();
|
||||
CLogMessage(this).warning(u"Reading METARs failed '%1' for '%2'") << nwReply->errorString() << nwReply->url().toString();
|
||||
nwReply->abort();
|
||||
emit dataRead(CEntityFlags::MetarEntity, CEntityFlags::ReadFailed, 0);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace BlackCore
|
||||
if (!this->doWorkCheck())
|
||||
{
|
||||
CLogMessage(this).debug() << Q_FUNC_INFO;
|
||||
CLogMessage(this).info("Terminated VATSIM status file parsing process"); // for users
|
||||
CLogMessage(this).info(u"Terminated VATSIM status file parsing process"); // for users
|
||||
return; // stop, terminate straight away, ending thread
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace BlackCore
|
||||
if (!this->doWorkCheck())
|
||||
{
|
||||
CLogMessage(this).debug() << Q_FUNC_INFO;
|
||||
CLogMessage(this).info("Terminated status parsing process"); // for users
|
||||
CLogMessage(this).info(u"Terminated status parsing process"); // for users
|
||||
return; // stop, terminate straight away, ending thread
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace BlackCore
|
||||
else
|
||||
{
|
||||
// network error
|
||||
CLogMessage(this).warning("Reading VATSIM status file failed '%1' '%2'") << nwReply->errorString() << nwReply->url().toString();
|
||||
CLogMessage(this).warning(u"Reading VATSIM status file failed '%1' '%2'") << nwReply->errorString() << nwReply->url().toString();
|
||||
nwReply->abort();
|
||||
emit this->dataRead(CEntityFlags::VatsimStatusFile, CEntityFlags::ReadFailed, 0);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace BlackCore
|
||||
CServer::ServerType connectedServerType = sApp->getIContextNetwork()->getConnectedServer().getServerType();
|
||||
if (!sApp->getIContextNetwork()->isConnected() || connectedServerType != CServer::FSDServerVatsim)
|
||||
{
|
||||
CLogMessage(this).warning("Cannot join VATSIM voice channel without active VATSIM FSD connection!");
|
||||
CLogMessage(this).warning(u"Cannot join VATSIM voice channel without active VATSIM FSD connection!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user