diff --git a/src/blackcore/aircraftmatcher.cpp b/src/blackcore/aircraftmatcher.cpp index 7111207f9..1ff762dfb 100644 --- a/src/blackcore/aircraftmatcher.cpp +++ b/src/blackcore/aircraftmatcher.cpp @@ -731,11 +731,11 @@ namespace BlackCore if (modelsCleaned.isEmpty()) { // error to force popup - CLogMessage(this).error("No models for matching ('%1'), swift without a model set will not work!") << simulator.toQString(); + CLogMessage(this).error(u"No models for matching ('%1'), swift without a model set will not work!") << simulator.toQString(); } else if (!duplicateModels.isEmpty()) { - CLogMessage(this).error("Found model duplicate strings, check models: '%1'") << duplicateModels.dbKeysAsString(", "); + CLogMessage(this).error(u"Found model duplicate strings, check models: '%1'") << duplicateModels.dbKeysAsString(", "); } else if (!warnings.isEmpty()) { @@ -743,7 +743,7 @@ namespace BlackCore } else { - CLogMessage(this).validationInfo("Set %1 models in matcher, simulator '%2'") << modelsCleaned.size() << simulator.toQString(); + CLogMessage(this).validationInfo(u"Set %1 models in matcher, simulator '%2'") << modelsCleaned.size() << simulator.toQString(); } // set values @@ -830,7 +830,7 @@ namespace BlackCore const bool r = m_modelSet.removeModelWithString(modelString, Qt::CaseInsensitive); if (r) { - CLogMessage(this).warning("Removed model '%1' from matching model set") << modelString; + CLogMessage(this).warning(u"Removed model '%1' from matching model set") << modelString; m_removedModels.replaceOrAddModelWithString(remoteAircraft.getModel(), Qt::CaseInsensitive); } } diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index d982dcf2e..e8b62f8f0 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -194,7 +194,7 @@ namespace BlackCore const CApplicationInfo myself = CApplication::instance()->getApplicationInfo(); if (!apps.contains(myself)) { apps.push_back(myself); } const bool ok = CFileUtils::writeStringToLockedFile(apps.toJsonString(), CFileUtils::appendFilePaths(swiftDataRoot(), "apps.json")); - if (!ok) { CLogMessage(static_cast(nullptr)).error("Failed to write to application list file"); } + if (!ok) { CLogMessage(static_cast(nullptr)).error(u"Failed to write to application list file"); } return ok; } @@ -206,7 +206,7 @@ namespace BlackCore if (!apps.contains(myself)) { return true; } apps.remove(myself); const bool ok = CFileUtils::writeStringToLockedFile(apps.toJsonString(), CFileUtils::appendFilePaths(swiftDataRoot(), "apps.json")); - if (!ok) { CLogMessage(static_cast(nullptr)).error("Failed to write to application list file"); } + if (!ok) { CLogMessage(static_cast(nullptr)).error(u"Failed to write to application list file"); } return ok; } @@ -366,7 +366,7 @@ namespace BlackCore #ifdef BLACK_USE_CRASHPAD CRASHPAD_SIMULATE_CRASH(); #else - CLogMessage(this).warning("This compiler or platform does not support crashpad. Cannot simulate crash dump!"); + CLogMessage(this).warning(u"This compiler or platform does not support crashpad. Cannot simulate crash dump!"); #endif }); } @@ -409,7 +409,7 @@ namespace BlackCore CStatusMessageList CApplication::waitForSetup(int timeoutMs) { - if (!m_setupReader) { return CStatusMessage(this).error("No setup reader"); } + if (!m_setupReader) { return CStatusMessage(this).error(u"No setup reader"); } CEventLoop::processEventsUntil(this, &CApplication::setupHandlingCompleted, timeoutMs, [this] { // init, if this is true event queue is not started @@ -426,19 +426,20 @@ namespace BlackCore } if (m_setupReader->isSetupAvailable()) { - msgs.push_back(CStatusMessage(this).info(forced ? "Setup available after forcing (so likely web read still pending)" : "Setup available")); + msgs.push_back(CStatusMessage(this).info(forced ? QStringLiteral("Setup available after forcing (so likely web read still pending)") + : QStringLiteral("Setup available"))); return msgs; } // getting here can means no "real" read success, and NO available cache - msgs.push_back(CStatusMessage(this).error("Setup not available, setup reading failed or timed out.")); + msgs.push_back(CStatusMessage(this).error(u"Setup not available, setup reading failed or timed out.")); if (m_setupReader->getLastSetupReadErrorMessages().hasErrorMessages()) { msgs.push_back(m_setupReader->getLastSetupReadErrorMessages()); } if (m_setupReader->hasCmdLineBootstrapUrl()) { - msgs.push_back(CStatusMessage(this).info("Bootstrap URL cmd line argument '%1'") << m_setupReader->getCmdLineBootstrapUrl()); + msgs.push_back(CStatusMessage(this).info(u"Bootstrap URL cmd line argument '%1'") << m_setupReader->getCmdLineBootstrapUrl()); } return msgs; } @@ -451,8 +452,8 @@ namespace BlackCore CStatusMessageList CApplication::requestReloadOfSetupAndVersion() { - if (m_shutdown) { return CStatusMessage(this).warning("Shutting down, not reading"); } - if (!m_setupReader) { return CStatusMessage(this).error("No reader for setup/version"); } + if (m_shutdown) { return CStatusMessage(this).warning(u"Shutting down, not reading"); } + if (!m_setupReader) { return CStatusMessage(this).error(u"No reader for setup/version"); } Q_ASSERT_X(m_parsed, Q_FUNC_INFO, "Not yet parsed"); return m_setupReader->asyncLoad(); } @@ -864,7 +865,7 @@ namespace BlackCore BLACK_VERIFY_X(QSslSocket::supportsSsl(), Q_FUNC_INFO, "No SSL"); if (!QSslSocket::supportsSsl()) { - return CStatusMessage(this).error("No SSL supported, can`t be used"); + return CStatusMessage(this).error(u"No SSL supported, can`t be used"); } m_webReadersUsed = webReaders; @@ -877,8 +878,8 @@ namespace BlackCore { Q_ASSERT_X(m_parsed, Q_FUNC_INFO, "Call this function after parsing"); - if (!m_useContexts) { return CStatusMessage(this).error("No need to start core facade"); } // we do not use context, so no need to startup - if (!m_setupReader || !m_setupReader->isSetupAvailable()) { return CStatusMessage(this).error("No setup reader or setup available"); } + if (!m_useContexts) { return CStatusMessage(this).error(u"No need to start core facade"); } // we do not use context, so no need to startup + if (!m_setupReader || !m_setupReader->isSetupAvailable()) { return CStatusMessage(this).error(u"No setup reader or setup available"); } Q_ASSERT_X(m_coreFacade.isNull(), Q_FUNC_INFO, "Cannot alter facade"); Q_ASSERT_X(m_setupReader, Q_FUNC_INFO, "No facade without setup possible"); @@ -886,7 +887,7 @@ namespace BlackCore this->startWebDataServices(); - const CStatusMessageList msgs(CStatusMessage(this).info("Will start core facade now")); + const CStatusMessageList msgs(CStatusMessage(this).info(u"Will start core facade now")); m_coreFacade.reset(new CCoreFacade(m_coreFacadeConfig)); emit this->coreFacadeStarted(); return msgs; @@ -896,14 +897,14 @@ namespace BlackCore { Q_ASSERT_X(m_parsed, Q_FUNC_INFO, "Call this function after parsing"); - if (!m_useWebData) { return CStatusMessage(this).warning("No need to start web data services"); } - if (!m_setupReader || !m_setupReader->isSetupAvailable()) { return CStatusMessage(this).error("No setup reader or setup available"); } + if (!m_useWebData) { return CStatusMessage(this).warning(u"No need to start web data services"); } + if (!m_setupReader || !m_setupReader->isSetupAvailable()) { return CStatusMessage(this).error(u"No setup reader or setup available"); } Q_ASSERT_X(m_setupReader, Q_FUNC_INFO, "No web data services without setup possible"); CStatusMessageList msgs; if (!m_webDataServices) { - msgs.push_back(CStatusMessage(this).info("Will start web data services now")); + msgs.push_back(CStatusMessage(this).info(u"Will start web data services now")); m_webDataServices.reset( new CWebDataServices(m_webReadersUsed, m_dbReaderConfig, {}, this) ); @@ -931,7 +932,7 @@ namespace BlackCore } else { - msgs.push_back(CStatusMessage(this).info("Web data services already running")); + msgs.push_back(CStatusMessage(this).info(u"Web data services already running")); } return msgs; @@ -1080,21 +1081,21 @@ namespace BlackCore { case QNetworkAccessManager::Accessible: m_accessManager->setNetworkAccessible(accessible); // for some reasons the queried value still is unknown - CLogMessage(this).info("Network is accessible"); + CLogMessage(this).info(u"Network is accessible"); break; case QNetworkAccessManager::NotAccessible: - CLogMessage(this).error("Network not accessible"); + CLogMessage(this).error(u"Network not accessible"); break; default: - CLogMessage(this).warning("Network accessibility unknown"); + CLogMessage(this).warning(u"Network accessibility unknown"); break; } } void CApplication::onChangedInternetAccessibility(bool accessible) { - if (accessible) { CLogMessage(this).info("Internet reported accessible"); } - else { CLogMessage(this).warning("Internet not accessible"); } + if (accessible) { CLogMessage(this).info(u"Internet reported accessible"); } + else { CLogMessage(this).warning(u"Internet not accessible"); } emit this->changedInternetAccessibility(accessible); } @@ -1103,11 +1104,11 @@ namespace BlackCore { if (accessible) { - CLogMessage(this).info("swift DB reported accessible: '%1'") << url.toQString(); + CLogMessage(this).info(u"swift DB reported accessible: '%1'") << url.toQString(); } else { - CLogMessage(this).warning("swift DB not accessible: '%1'") << url.toQString(); + CLogMessage(this).warning(u"swift DB not accessible: '%1'") << url.toQString(); if (m_networkWatchDog) { CLogMessage(this).warning(m_networkWatchDog->getCheckInfo()); @@ -1130,7 +1131,7 @@ namespace BlackCore { m_networkWatchDog->disableNetworkAccessibilityCheck(true); m_accessManager->setNetworkAccessible(QNetworkAccessManager::Accessible); - CLogMessage(this).warning("No network configurations found, disabling network accessibility checks"); + CLogMessage(this).warning(u"No network configurations found, disabling network accessibility checks"); } } else @@ -1148,7 +1149,7 @@ namespace BlackCore const bool disable = activeCount < 1; // only inactive if (disable && m_networkWatchDog && m_networkWatchDog->isNetworkAccessibilityCheckEnabled()) { - CLogMessage(this).warning("Disabling network accessibility check in watchdog"); + CLogMessage(this).warning(u"Disabling network accessibility check in watchdog"); m_networkWatchDog->disableNetworkAccessibilityCheck(disable); } @@ -1159,7 +1160,7 @@ namespace BlackCore if (!m_noNwAccessPoint) { m_noNwAccessPoint = true; - CLogMessage(this).warning("No network access point found for swift"); + CLogMessage(this).warning(u"No network access point found for swift"); } } } @@ -1210,13 +1211,13 @@ namespace BlackCore { if (!sApp || sApp->isShuttingDown()) { return; } const QString r = CNetworkUtils::createNetworkConfigurationReport(m_networkConfigManager, m_accessManager); - CLogMessage(this).info("Network report:\n%1") << r; + CLogMessage(this).info(u"Network report:\n%1") << r; }); } CStatusMessageList CApplication::asyncWebAndContextStart() { - if (m_started) { return CStatusMessage(this).info("Already started "); } + if (m_started) { return CStatusMessage(this).info(u"Already started "); } // follow up startups CStatusMessageList msgs = this->startWebDataServices(); @@ -1619,7 +1620,7 @@ namespace BlackCore { #ifdef BLACK_USE_CRASHPAD // No crash handling for unit tests - if (this->getApplicationInfo().isUnitTest()) { return CStatusMessage(this).info("No crash handler for unit tests"); } + if (this->getApplicationInfo().isUnitTest()) { return CStatusMessage(this).info(u"No crash handler for unit tests"); } static const QString crashpadHandler(CBuildConfig::isRunningOnWindowsNtPlatform() ? "swift_crashpad_handler.exe" : "swift_crashpad_handler"); static const QString handler = CFileUtils::appendFilePaths(CDirectoryUtils::binDirectory(), crashpadHandler); @@ -1629,7 +1630,7 @@ namespace BlackCore if (!QFileInfo::exists(handler)) { - return CStatusMessage(this).warning("Crashpad handler '%1' not found. Cannot init handler!") << handler; + return CStatusMessage(this).warning(u"Crashpad handler '%1' not found. Cannot init handler!") << handler; } const CUrl serverUrl = this->getGlobalSetup().getCrashReportServerUrl(); @@ -1652,9 +1653,9 @@ namespace BlackCore annotations, {}, false, true); - return CStatusMessage(this).info("Using crash handler"); + return CStatusMessage(this).info(u"Using crash handler"); #else - return CStatusMessage(this).info("Not using crash handler"); + return CStatusMessage(this).info(u"Not using crash handler"); #endif } diff --git a/src/blackcore/context/context.h b/src/blackcore/context/context.h index e6dba1be0..863c64ffc 100644 --- a/src/blackcore/context/context.h +++ b/src/blackcore/context/context.h @@ -162,7 +162,7 @@ namespace BlackCore //! Empty context called void logEmptyContextWarning(const QString &functionName) const { - BlackMisc::CLogMessage(this, BlackMisc::CLogCategory::contextSlot()).warning("Empty context called, details: %1") << functionName; + BlackMisc::CLogMessage(this, BlackMisc::CLogCategory::contextSlot()).warning(u"Empty context called, details: %1") << functionName; } //! Standard message when status message is returned in empty context diff --git a/src/blackcore/context/contextaudioimpl.cpp b/src/blackcore/context/contextaudioimpl.cpp index 2e6a5f197..9c453f774 100644 --- a/src/blackcore/context/contextaudioimpl.cpp +++ b/src/blackcore/context/contextaudioimpl.cpp @@ -550,7 +550,7 @@ namespace BlackCore break; case IVoiceChannel::ConnectingFailed: case IVoiceChannel::DisconnectedError: - CLogMessage(this).warning("Voice channel disconnecting error"); + CLogMessage(this).warning(u"Voice channel disconnecting error"); // intentional fall-through case IVoiceChannel::Disconnected: emit this->changedVoiceRooms(getComVoiceRooms(), false); diff --git a/src/blackcore/context/contextnetworkimpl.cpp b/src/blackcore/context/contextnetworkimpl.cpp index db4a1eac1..f44b50351 100644 --- a/src/blackcore/context/contextnetworkimpl.cpp +++ b/src/blackcore/context/contextnetworkimpl.cpp @@ -219,7 +219,7 @@ namespace BlackCore // Fall back to observer mode, if no simulator is available or not simulating if (!CBuildConfig::isLocalDeveloperDebugBuild() && !this->getIContextSimulator()->isSimulatorSimulating()) { - CLogMessage(this).info("No simulator connected or connected simulator not simulating. Falling back to observer mode"); + CLogMessage(this).info(u"No simulator connected or connected simulator not simulating. Falling back to observer mode"); mode = INetwork::LoginAsObserver; } @@ -288,17 +288,17 @@ namespace BlackCore { if (!this->getIContextNetwork()->isConnected()) { - CLogMessage(this).validationError("Network needs to be connected"); + CLogMessage(this).validationError(u"Network needs to be connected"); return false; } else if (!this->getIContextOwnAircraft()) { - CLogMessage(this).validationError("No own aircraft data, no text message can be sent"); + CLogMessage(this).validationError(u"No own aircraft data, no text message can be sent"); return false; } if (parser.countParts() < 3) { - CLogMessage(this).validationError("Incorrect message"); + CLogMessage(this).validationError(u"Incorrect message"); return false; } @@ -307,7 +307,7 @@ namespace BlackCore const CSimulatedAircraft ownAircraft(this->getIContextOwnAircraft()->getOwnAircraft()); if (ownAircraft.getCallsign().isEmpty()) { - CLogMessage(this).validationError("No own callsign"); + CLogMessage(this).validationError(u"No own callsign"); return false; } @@ -337,7 +337,7 @@ namespace BlackCore } else { - CLogMessage(this).validationError("Wrong COM frequency for text message"); + CLogMessage(this).validationError(u"Wrong COM frequency for text message"); return false; } } @@ -352,7 +352,7 @@ namespace BlackCore tm.setMessage(msg); if (tm.isEmpty()) { - CLogMessage(this).validationError("No text message body"); + CLogMessage(this).validationError(u"No text message body"); return false; } CTextMessageList tml(tm); @@ -375,7 +375,7 @@ namespace BlackCore cs = CCallsign(csPart); if (!m_airspace->isAircraftInRange(cs)) { - CLogMessage(this).validationError("Altitude offset unknown callsign"); + CLogMessage(this).validationError(u"Altitude offset unknown callsign"); return false; } } @@ -387,8 +387,8 @@ namespace BlackCore } const bool added = this->testAddAltitudeOffset(cs, os); - if (added) { CLogMessage(this).info("Added altitude offset %1 for %2") << os.valueRoundedWithUnit(2) << cs.asString(); } - else { CLogMessage(this).info("Removed altitude offset %1") << cs.asString(); } + if (added) { CLogMessage(this).info(u"Added altitude offset %1 for %2") << os.valueRoundedWithUnit(2) << cs.asString(); } + else { CLogMessage(this).info(u"Removed altitude offset %1") << cs.asString(); } return true; } @@ -399,7 +399,7 @@ namespace BlackCore const bool watchdog = parser.toBool(1, true); m_airspace->enableAnalyzer(watchdog); - CLogMessage(this).info("Enabled watchdog: %1") << boolToYesNo(watchdog); + CLogMessage(this).info(u"Enabled watchdog: %1") << boolToYesNo(watchdog); } else if (parser.matchesCommand(".reinit", ".reinitialize")) { @@ -407,7 +407,7 @@ namespace BlackCore const int count = m_airspace->reInitializeAllAircraft(); if (count > 0) { - CLogMessage(this).info("Re-init %1 aircraft") << count; + CLogMessage(this).info(u"Re-init %1 aircraft") << count; } } else if (parser.matchesCommand(".wallop")) @@ -546,7 +546,7 @@ namespace BlackCore // send 1st position if (to == INetwork::Connected) { - CLogMessage(this).info("Connected, own aircraft %1") << this->ownAircraft().getCallsignAsString(); + CLogMessage(this).info(u"Connected, own aircraft %1") << this->ownAircraft().getCallsignAsString(); if (m_network) { @@ -595,7 +595,7 @@ namespace BlackCore void CContextNetwork::updateMetars(const BlackMisc::Weather::CMetarList &metars) { if (this->isDebugEnabled()) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; } - CLogMessage(this).info("%1 METARs updated") << metars.size(); + CLogMessage(this).info(u"%1 METARs updated") << metars.size(); } void CContextNetwork::onChangedAtisReceived(const CCallsign &callsign) @@ -862,7 +862,7 @@ namespace BlackCore if (c) { const CSimulatedAircraft aircraft(this->getAircraftInRangeForCallsign(callsign)); - CLogMessage(this).info("Callsign '%1' fast positions '%2'") << aircraft.getCallsign() << BlackMisc::boolToOnOff(aircraft.fastPositionUpdates()); + CLogMessage(this).info(u"Callsign '%1' fast positions '%2'") << aircraft.getCallsign() << BlackMisc::boolToOnOff(aircraft.fastPositionUpdates()); emit this->changedFastPositionUpdates(aircraft); } return c; @@ -875,7 +875,7 @@ namespace BlackCore if (c) { const CSimulatedAircraft aircraft(this->getAircraftInRangeForCallsign(callsign)); - CLogMessage(this).info("Callsign '%1' set gnd.capability: %2") << aircraft.getCallsign() << boolToOnOff(aircraft.isSupportingGndFlag()); + CLogMessage(this).info(u"Callsign '%1' set gnd.capability: %2") << aircraft.getCallsign() << boolToOnOff(aircraft.isSupportingGndFlag()); emit this->changedGndFlagCapability(aircraft); } return c; diff --git a/src/blackcore/context/contextsimulatorimpl.cpp b/src/blackcore/context/contextsimulatorimpl.cpp index c130ba052..74fa1a272 100644 --- a/src/blackcore/context/contextsimulatorimpl.cpp +++ b/src/blackcore/context/contextsimulatorimpl.cpp @@ -208,12 +208,12 @@ namespace BlackCore CStatusMessageList msgs; if (!sApp || !sApp->isNetworkAccessible()) { - msgs.push_back(CStatusMessage(this).error("No network interface, simulation will not work properly")); + msgs.push_back(CStatusMessage(this).error(u"No network interface, simulation will not work properly")); } const CSimulatorInfo simulators = this->simulatorsWithInitializedModelSet(); if (simulators.isNoSimulator()) { - msgs.push_back(CStatusMessage(this).error("No model set so far, you need at least one model set. Hint: You can create a model set in the mapping tool, or copy an existing set in the launcher.")); + msgs.push_back(CStatusMessage(this).error(u"No model set so far, you need at least one model set. Hint: You can create a model set in the mapping tool, or copy an existing set in the launcher.")); } return msgs; } @@ -358,7 +358,7 @@ namespace BlackCore if (!simulatorPluginInfo.isValid()) { - CLogMessage(this).error("Illegal plugin"); + CLogMessage(this).error(u"Illegal plugin"); return false; } @@ -421,7 +421,7 @@ namespace BlackCore const bool connected = simulator->connectTo(); if (!connected) { - CLogMessage(this).error("Simulator plugin connection to simulator '%1' failed") << simulatorPluginInfo.toQString(true); + CLogMessage(this).error(u"Simulator plugin connection to simulator '%1' failed") << simulatorPluginInfo.toQString(true); return false; } @@ -440,7 +440,7 @@ namespace BlackCore emit this->simulatorPluginChanged(simulatorPluginInfo); }); - CLogMessage(this).info("Simulator plugin loaded: '%1' connected: %2") + CLogMessage(this).info(u"Simulator plugin loaded: '%1' connected: %2") << simulatorPluginInfo.toQString(true) << boolToYesNo(connected); @@ -470,7 +470,7 @@ namespace BlackCore const bool c = connect(listener, &ISimulatorListener::simulatorStarted, this, &CContextSimulator::onSimulatorStarted, Qt::QueuedConnection); if (!c) { - CLogMessage(this).error("Unable to use '%1'") << simulatorInfo.toQString(); + CLogMessage(this).error(u"Unable to use '%1'") << simulatorInfo.toQString(); return false; } listener->setProperty("isInitialized", true); @@ -484,7 +484,7 @@ namespace BlackCore Q_ASSERT_X(s, Q_FUNC_INFO, "cannot invoke method"); Q_UNUSED(s); } - CLogMessage(this).info("Listening for simulator '%1'") << simulatorInfo.getIdentifier(); + CLogMessage(this).info(u"Listening for simulator '%1'") << simulatorInfo.getIdentifier(); return true; } @@ -559,7 +559,7 @@ namespace BlackCore if (this->isAircraftInRange(aircraftAfterModelApplied.getCallsign())) { return; } // removed, but callsig, we did crosscheck // callsign, but no model string - CLogMessage(this).error("Matching error for '%1', no model string") << aircraftAfterModelApplied.getCallsign().asString(); + CLogMessage(this).error(u"Matching error for '%1', no model string") << aircraftAfterModelApplied.getCallsign().asString(); CSimulatedAircraft brokenAircraft(aircraftAfterModelApplied); brokenAircraft.setEnabled(false); @@ -854,7 +854,7 @@ namespace BlackCore else if (p1 == "parts") { rs.setEnabledAircraftParts(on); } else { return false; } this->setInterpolationAndRenderingSetupGlobal(rs); - CLogMessage(this, CLogCategory::cmdLine()).info("Setup is: '%1'") << rs.toQString(true); + CLogMessage(this, CLogCategory::cmdLine()).info(u"Setup is: '%1'") << rs.toQString(true); return true; } if (parser.matchesCommand("plugin") || parser.matchesCommand("drv") || parser.matchesCommand("driver")) @@ -1035,7 +1035,7 @@ namespace BlackCore const CSimulatorInfo simulator(m_modelSetSimulator.get()); CCentralMultiSimulatorModelSetCachesProvider::modelCachesInstance().synchronizeCache(simulator); const CAircraftModelList models(this->getModelSet()); - CLogMessage(this).info("Init aircraft matcher with %1 models from set for '%2'") << models.size() << simulator.toQString(); + CLogMessage(this).info(u"Init aircraft matcher with %1 models from set for '%2'") << models.size() << simulator.toQString(); m_aircraftMatcher.setModelSet(models, simulator, false); } } // namespace diff --git a/src/blackcore/corefacade.cpp b/src/blackcore/corefacade.cpp index 1ab483990..66e91134f 100644 --- a/src/blackcore/corefacade.cpp +++ b/src/blackcore/corefacade.cpp @@ -98,7 +98,7 @@ namespace BlackCore { const QString e = m_dbusConnection.lastError().message(); BLACK_VERIFY_X(false, "CRuntime::init DBus problem", e.toUtf8().constData()); - CLogMessage(this).error("DBus connection failed: '%1'") << e; + CLogMessage(this).error(u"DBus connection failed: '%1'") << e; return; } } @@ -136,7 +136,7 @@ namespace BlackCore time.restart(); this->initPostSetup(times); times.insert("Post setup", time.restart()); - CLogMessage(this).info("Init times: %1") << qmapToString(times); + CLogMessage(this).info(u"Init times: %1") << qmapToString(times); // flag m_initalized = true; @@ -170,7 +170,7 @@ namespace BlackCore Q_ASSERT(!dBusAddress.isEmpty()); if (m_dbusServer) { m_dbusServer->deleteLater(); } // delete if there was an existing one m_dbusServer = new CDBusServer(dBusAddress, this); - CLogMessage(this).info("DBus server on address: '%1'") << dBusAddress; + CLogMessage(this).info(u"DBus server on address: '%1'") << dBusAddress; } void CCoreFacade::initPostSetup(QMap ×) diff --git a/src/blackcore/db/airportdatareader.cpp b/src/blackcore/db/airportdatareader.cpp index 4db3050c3..1489a8b18 100644 --- a/src/blackcore/db/airportdatareader.cpp +++ b/src/blackcore/db/airportdatareader.cpp @@ -74,13 +74,13 @@ namespace BlackCore const QDir directory(dir); if (!directory.exists()) { - return CStatusMessage(this).error("Missing directory '%1'") << dir; + return CStatusMessage(this).error(u"Missing directory '%1'") << dir; } whatToRead &= CEntityFlags::AirportEntity; // can handle these entities if (whatToRead == CEntityFlags::NoEntity) { - return CStatusMessage(this).info("'%1' No entity for this reader") << CEntityFlags::flagToString(whatToRead); + return CStatusMessage(this).info(u"'%1' No entity for this reader") << CEntityFlags::flagToString(whatToRead); } int c = 0; @@ -91,7 +91,7 @@ namespace BlackCore const QFileInfo fi(fileName); if (!fi.exists()) { - msgs.push_back(CStatusMessage(this).warning("File '%1' does not exist") << fileName); + msgs.push_back(CStatusMessage(this).warning(u"File '%1' does not exist") << fileName); } else if (!this->overrideCacheFromFile(overrideNewerOnly, fi, CEntityFlags::AirportEntity, msgs)) { @@ -227,7 +227,7 @@ namespace BlackCore qint64 latestTimestamp = airports.latestTimestampMsecsSinceEpoch(); if (size > 0 && latestTimestamp < 0) { - CLogMessage(this).error("No timestamp in airport list, setting to last modified value"); + CLogMessage(this).error(u"No timestamp in airport list, setting to last modified value"); latestTimestamp = lastModifiedMsSinceEpoch(nwReply.data()); } diff --git a/src/blackcore/db/backgrounddataupdater.cpp b/src/blackcore/db/backgrounddataupdater.cpp index 9cd56aad6..48a460cd4 100644 --- a/src/blackcore/db/backgrounddataupdater.cpp +++ b/src/blackcore/db/backgrounddataupdater.cpp @@ -60,18 +60,18 @@ namespace BlackCore emit this->consolidating(true); int cycle = m_cycle; - this->addHistory(CLogMessage(this).info("Background consolidation cycle %1") << cycle); + this->addHistory(CLogMessage(this).info(u"Background consolidation cycle %1") << cycle); switch (cycle) { case 0: // normally redundant, will be read in other places as well // new metadata for next comparison - this->addHistory(CLogMessage(this).info("Triggered info reads from DB")); + this->addHistory(CLogMessage(this).info(u"Triggered info reads from DB")); this->triggerInfoReads(); break; case 1: - this->addHistory(CLogMessage(this).info("Synchronize DB entities")); + this->addHistory(CLogMessage(this).info(u"Synchronize DB entities")); this->syncDbEntity(CEntityFlags::AirlineIcaoEntity); this->syncDbEntity(CEntityFlags::LiveryEntity); this->syncDbEntity(CEntityFlags::ModelEntity); @@ -79,11 +79,11 @@ namespace BlackCore this->syncDbEntity(CEntityFlags::AircraftIcaoEntity); break; case 2: - this->addHistory(CLogMessage(this).info("Synchronize %1") << this->modelCaches(true).getDescription()); + this->addHistory(CLogMessage(this).info(u"Synchronize %1") << this->modelCaches(true).getDescription()); this->syncModelOrModelSetCacheWithDbData(true); // set break; case 3: - this->addHistory(CLogMessage(this).info("Synchronize %1") << this->modelCaches(false).getDescription()); + this->addHistory(CLogMessage(this).info(u"Synchronize %1") << this->modelCaches(false).getDescription()); this->syncModelOrModelSetCacheWithDbData(false); break; default: @@ -142,13 +142,13 @@ namespace BlackCore { const CStatusMessage m = modelCaches.setCachedModels(simulatorModels, singleSimulator); const int msElapsed = time.elapsed(); - this->addHistory(CLogMessage(this).info("Consolidated %1 models (%2) for '%3' in %4ms") << c << description << singleSimulator.convertToQString() << msElapsed); + this->addHistory(CLogMessage(this).info(u"Consolidated %1 models (%2) for '%3' in %4ms") << c << description << singleSimulator.convertToQString() << msElapsed); CLogMessage::preformatted(m); this->addHistory(m); } else { - this->addHistory(CLogMessage(this).info("Synchronized, no changes for '%1'") << singleSimulator.convertToQString()); + this->addHistory(CLogMessage(this).info(u"Synchronized, no changes for '%1'") << singleSimulator.convertToQString()); } if (simulatorsSet.size() > 1) @@ -173,12 +173,12 @@ namespace BlackCore if (!latestDbTs.isValid()) { return; } if (latestDbTs <= latestCacheTs) { - this->addHistory(CLogMessage(this).info("Background updater (%1), no auto synchronization with DB, entity '%2', DB ts: %3 cache ts: %4") + this->addHistory(CLogMessage(this).info(u"Background updater (%1), no auto synchronization with DB, entity '%2', DB ts: %3 cache ts: %4") << CThreadUtils::currentThreadInfo() << entityStr << latestDbTs.toString(Qt::ISODate) << latestCacheTsStr); return; } - this->addHistory(CLogMessage(this).info("Background updater (%1) triggering read of '%2' since '%3'") + this->addHistory(CLogMessage(this).info(u"Background updater (%1) triggering read of '%2' since '%3'") << CThreadUtils::currentThreadInfo() << entityStr << latestCacheTsStr); sApp->getWebDataServices()->triggerLoadingDirectlyFromDb(entity, latestCacheTs); } diff --git a/src/blackcore/db/databaseauthentication.cpp b/src/blackcore/db/databaseauthentication.cpp index 568d38fa5..31395a486 100644 --- a/src/blackcore/db/databaseauthentication.cpp +++ b/src/blackcore/db/databaseauthentication.cpp @@ -123,12 +123,12 @@ namespace BlackCore const QString json(nwReply->readAll().trimmed()); if (json.isEmpty()) { - CLogMessage(this).error("Authentication failed, no response from '%1'") << urlString; + CLogMessage(this).error(u"Authentication failed, no response from '%1'") << urlString; return; } if (!Json::looksLikeJson(json)) { - CLogMessage(this).error("Illegal JSON object: %1") << CNetworkUtils::removeHtmlPartsFromPhpErrorMessage(json); + CLogMessage(this).error(u"Illegal JSON object: %1") << CNetworkUtils::removeHtmlPartsFromPhpErrorMessage(json); return; } @@ -165,7 +165,7 @@ namespace BlackCore } else { - CLogMessage(this).error("Authentication failed, %1") << nwReply->errorString(); + CLogMessage(this).error(u"Authentication failed, %1") << nwReply->errorString(); return; } } diff --git a/src/blackcore/db/databasereader.cpp b/src/blackcore/db/databasereader.cpp index b3878e8b4..2244e7396 100644 --- a/src/blackcore/db/databasereader.cpp +++ b/src/blackcore/db/databasereader.cpp @@ -99,7 +99,7 @@ namespace BlackCore { this->admitCaches(currentEntity); cachedEntities |= currentEntity; // read from cache - CLogMessage(this).info("Using cache for '%1' (%2, %3)") << currentEntityName << cacheTs.toString() << cacheTimestamp; + CLogMessage(this).info(u"Using cache for '%1' (%2, %3)") << currentEntityName << cacheTs.toString() << cacheTimestamp; } else { @@ -109,23 +109,23 @@ namespace BlackCore if (changedUrl) { - CLogMessage(this).info("Data location for '%1' changed ('%2'->'%3'), will override cache for reading '%4'") + CLogMessage(this).info(u"Data location for '%1' changed ('%2'->'%3'), will override cache for reading '%4'") << currentEntityName << oldUrlInfo.toQString() << newUrlInfo.toQString() << rmDbOrSharedFlagString; } else { - CLogMessage(this).info("Cache for '%1' outdated, latest entity (%2, %3), reading '%4'") << currentEntityName << latestEntityTs.toString() << latestEntityTimestamp << rmDbOrSharedFlagString; + CLogMessage(this).info(u"Cache for '%1' outdated, latest entity (%2, %3), reading '%4'") << currentEntityName << latestEntityTs.toString() << latestEntityTimestamp << rmDbOrSharedFlagString; } } } else { - if (!rmDbReadingOrShared) { CLogMessage(this).info("No DB or shared reading for '%1', read mode is: '%2'") << currentEntityName << rmString; } - if (!hasDbInfoObjects) { CLogMessage(this).info("No DB info objects for '%1', read mode is: '%2'") << currentEntityName << rmString; } + if (!rmDbReadingOrShared) { CLogMessage(this).info(u"No DB or shared reading for '%1', read mode is: '%2'") << currentEntityName << rmString; } + if (!hasDbInfoObjects) { CLogMessage(this).info(u"No DB info objects for '%1', read mode is: '%2'") << currentEntityName << rmString; } if (currentEntityCount > 0) { - CLogMessage(this).info("Cache for '%1' already read, %2 entries") << currentEntityName << currentEntityCount; + CLogMessage(this).info(u"Cache for '%1' already read, %2 entries") << currentEntityName << currentEntityCount; } else { @@ -134,12 +134,12 @@ namespace BlackCore if (!rmDbReadingOrShared) { // intentionally we do not want to read from DB/shared - CLogMessage(this).info("Triggered reading cache for '%1', read mode: %2") << currentEntityName << rmString; + CLogMessage(this).info(u"Triggered reading cache for '%1', read mode: %2") << currentEntityName << rmString; } else { // we want to read from DB/shared, but have no info object - CLogMessage(this).info("No info object for '%1', triggered reading cache, read mode: %2") << currentEntityName << rmString; + CLogMessage(this).info(u"No info object for '%1', triggered reading cache, read mode: %2") << currentEntityName << rmString; } } cachedEntities |= currentEntity; // read from cache @@ -164,14 +164,14 @@ namespace BlackCore // Real read from DB if (dbEntities != CEntityFlags::NoEntity) { - CLogMessage(this).info("Start reading DB entities: %1") << CEntityFlags::flagToString(dbEntities); + CLogMessage(this).info(u"Start reading DB entities: %1") << CEntityFlags::flagToString(dbEntities); this->startReadFromBackendInBackgroundThread(dbEntities, CDbFlags::DbReading, newerThan); } // Real read from shared if (sharedEntities != CEntityFlags::NoEntity) { - CLogMessage(this).info("Start reading shared entities: %1") << CEntityFlags::flagToString(sharedEntities); + CLogMessage(this).info(u"Start reading shared entities: %1") << CEntityFlags::flagToString(sharedEntities); this->startReadFromBackendInBackgroundThread(dbEntities, CDbFlags::Shared, newerThan); } } @@ -191,7 +191,7 @@ namespace BlackCore if (newerHeaderEntities != entities) { const CEntityFlags::Entity validInCacheEntities = (entities ^ newerHeaderEntities) & entities; - CLogMessage(this).info("Reduced '%1' to '%2' before triggering load of shared files (still in cache)") << CEntityFlags::flagToString(entities) << CEntityFlags::flagToString(newerHeaderEntities); + CLogMessage(this).info(u"Reduced '%1' to '%2' before triggering load of shared files (still in cache)") << CEntityFlags::flagToString(entities) << CEntityFlags::flagToString(newerHeaderEntities); // In case we have difference entities we treat them as they were loaded, they result from still being in the cache // Using timer to first finish this function, then the resulting signal @@ -394,7 +394,7 @@ namespace BlackCore const CUrl urlSharedDbdata = CDatabaseReader::getWorkingSharedDbdataDirectoryUrl(); if (urlSharedDbdata.isEmpty()) { - CLogMessage(this).warning("No working shared URL, cannot request headers"); + CLogMessage(this).warning(u"No working shared URL, cannot request headers"); return 0; } @@ -407,7 +407,7 @@ namespace BlackCore url.appendPath(fileName); const QString entityString = CEntityFlags::flagToString(currentEntity); - CLogMessage(this).info("Triggered read of header for shared file of '%1'") << entityString; + CLogMessage(this).info(u"Triggered read of header for shared file of '%1'") << entityString; const QNetworkReply *reply = sApp->headerFromNetwork(url, { this, &CDatabaseReader::receivedSharedFileHeader }); if (reply) { c++; } currentEntity = CEntityFlags::iterateDbEntities(allEntities); @@ -497,7 +497,7 @@ namespace BlackCore { // never emit when lock is held, deadlock Q_ASSERT_X(CEntityFlags::isSingleEntity(entity), Q_FUNC_INFO, "Expect single entity"); - CLogMessage(this).info("Read %1 entities of '%2' from '%3' (%4)") << number << CEntityFlags::flagToString(entity) << res.getUrlString() << res.getLoadTimeStringWithStartedHint(); + CLogMessage(this).info(u"Read %1 entities of '%2' from '%3' (%4)") << number << CEntityFlags::flagToString(entity) << res.getUrlString() << res.getLoadTimeStringWithStartedHint(); emit this->dataRead(entity, res.isRestricted() ? CEntityFlags::ReadFinishedRestricted : CEntityFlags::ReadFinished, number); } @@ -553,7 +553,7 @@ namespace BlackCore const CEntityFlags::Entity entity = CEntityFlags::singleEntityByName(fileName); m_sharedFileResponses[entity] = headerResponse; - CLogMessage(this).info("Received header for shared file of '%1' from '%2'") << fileName << headerResponse.getUrl().toQString(); + CLogMessage(this).info(u"Received header for shared file of '%1' from '%2'") << fileName << headerResponse.getUrl().toQString(); emit this->sharedFileHeaderRead(entity, fileName, !headerResponse.hasWarningOrAboveMessage()); } @@ -618,8 +618,8 @@ namespace BlackCore { const bool s = this->readFromJsonFilesInBackground(CDirectoryUtils::staticDbFilesDirectory(), entities, overrideNewerOnly); return s ? - CStatusMessage(this).info("Started reading in background from '%1' of entities: '%2'") << CDirectoryUtils::staticDbFilesDirectory() << CEntityFlags::flagToString(entities) : - CStatusMessage(this).error("Starting reading in background from '%1' of entities: '%2' failed") << CDirectoryUtils::staticDbFilesDirectory() << CEntityFlags::flagToString(entities); + CStatusMessage(this).info(u"Started reading in background from '%1' of entities: '%2'") << CDirectoryUtils::staticDbFilesDirectory() << CEntityFlags::flagToString(entities) : + CStatusMessage(this).error(u"Starting reading in background from '%1' of entities: '%2' failed") << CDirectoryUtils::staticDbFilesDirectory() << CEntityFlags::flagToString(entities); } else { @@ -657,19 +657,19 @@ namespace BlackCore const qint64 cacheTs = cacheDateTime.toUTC().toMSecsSinceEpoch(); if (fileTs > cacheTs) { - msgs.push_back(CStatusMessage(this).info("File '%1' is newer than cache (%2)") << fileInfo.absoluteFilePath() << cacheDateTime.toUTC().toString()); + msgs.push_back(CStatusMessage(this).info(u"File '%1' is newer than cache (%2)") << fileInfo.absoluteFilePath() << cacheDateTime.toUTC().toString()); return true; } else { - msgs.push_back(CStatusMessage(this).info("File '%1' is not newer than cache (%2)") << fileInfo.absoluteFilePath() << cacheDateTime.toUTC().toString()); + msgs.push_back(CStatusMessage(this).info(u"File '%1' is not newer than cache (%2)") << fileInfo.absoluteFilePath() << cacheDateTime.toUTC().toString()); return true; } } void CDatabaseReader::logParseMessage(const QString &entity, int size, int msElapsed, const CDatabaseReader::JsonDatastoreResponse &response) const { - CLogMessage(this).info("Parsed %1 %2 in %3ms, thread %4 | '%5'") + CLogMessage(this).info(u"Parsed %1 %2 in %3ms, thread %4 | '%5'") << size << entity << msElapsed << CThreadUtils::currentThreadInfo() << response.toQString(); } diff --git a/src/blackcore/db/databaseutils.cpp b/src/blackcore/db/databaseutils.cpp index d0aa87b11..6729eb40f 100644 --- a/src/blackcore/db/databaseutils.cpp +++ b/src/blackcore/db/databaseutils.cpp @@ -197,7 +197,7 @@ namespace BlackCore consolidatedModels.push_back(model); } } - CLogMessage(static_cast(nullptr)).info("Consolidated %1 vs. %2 in %3 ms") << models.size() << simulatorModels.size() << timer.elapsed() << "ms"; + CLogMessage(static_cast(nullptr)).info(u"Consolidated %1 vs. %2 in %3 ms") << models.size() << simulatorModels.size() << timer.elapsed() << "ms"; return consolidatedModels; } @@ -218,7 +218,7 @@ namespace BlackCore if (processEvents && c % 125 == 0) { sApp->processEventsFor(25); } } } - CLogMessage(static_cast(nullptr)).info("Consolidated %1 models in %2ms") << models.size() << timer.elapsed(); + CLogMessage(static_cast(nullptr)).info(u"Consolidated %1 models in %2ms") << models.size() << timer.elapsed(); return c; } @@ -242,7 +242,7 @@ namespace BlackCore model = consolidated; c++; } - CLogMessage(static_cast(nullptr)).info("Consolidated %1 models in %2 ms") << simulatorModels.size() << timer.elapsed(); + CLogMessage(static_cast(nullptr)).info(u"Consolidated %1 models in %2 ms") << simulatorModels.size() << timer.elapsed(); return c; } @@ -340,7 +340,7 @@ namespace BlackCore stashModels.push_back(dbModel); // changed DB model if (updateInfo) { - const CStatusMessage m = CStatusMessage(getLogCategories()).info("%1 -> %2 (%3) for '%4'") + const CStatusMessage m = CStatusMessage(getLogCategories()).info(u"%1 -> %2 (%3) for '%4'") << dbModelSimulator.toQString(true) << simulator.toQString(true) << delta.toQString(true) << dbModel.getModelStringAndDbKey(); updateInfo->push_back(m); diff --git a/src/blackcore/db/icaodatareader.cpp b/src/blackcore/db/icaodatareader.cpp index 27aa2420f..9948f8f5a 100644 --- a/src/blackcore/db/icaodatareader.cpp +++ b/src/blackcore/db/icaodatareader.cpp @@ -300,7 +300,7 @@ namespace BlackCore qint64 latestTimestamp = codes.latestTimestampMsecsSinceEpoch(); // ignores duplicates if (n > 0 && latestTimestamp < 0) { - CLogMessage(this).error("No timestamp in aircraft ICAO list, setting to last modified value"); + CLogMessage(this).error(u"No timestamp in aircraft ICAO list, setting to last modified value"); latestTimestamp = this->lastModifiedMsSinceEpoch(nwReply.data()); } @@ -354,7 +354,7 @@ namespace BlackCore qint64 latestTimestamp = codes.latestTimestampMsecsSinceEpoch(); if (n > 0 && latestTimestamp < 0) { - CLogMessage(this).error("No timestamp in airline ICAO list, setting to last modified value"); + CLogMessage(this).error(u"No timestamp in airline ICAO list, setting to last modified value"); latestTimestamp = this->lastModifiedMsSinceEpoch(nwReply.data()); } @@ -398,7 +398,7 @@ namespace BlackCore qint64 latestTimestamp = countries.latestTimestampMsecsSinceEpoch(); if (n > 0 && latestTimestamp < 0) { - CLogMessage(this).error("No timestamp in country list, setting to last modified value"); + CLogMessage(this).error(u"No timestamp in country list, setting to last modified value"); latestTimestamp = this->lastModifiedMsSinceEpoch(nwReply.data()); } @@ -413,7 +413,7 @@ namespace BlackCore const QDir directory(dir); if (!directory.exists()) { - return CStatusMessage(this).error("Missing directory '%1'") << dir; + return CStatusMessage(this).error(u"Missing directory '%1'") << dir; } // Hint: Do not emit while locked -> deadlock @@ -426,7 +426,7 @@ namespace BlackCore const QFileInfo fi(fileName); if (!fi.exists()) { - msgs.push_back(CStatusMessage(this).warning("File '%1' does not exist") << fileName); + msgs.push_back(CStatusMessage(this).warning(u"File '%1' does not exist") << fileName); } else if (!this->overrideCacheFromFile(overrideNewerOnly, fi, CEntityFlags::CountryEntity, msgs)) { @@ -437,7 +437,7 @@ namespace BlackCore const QJsonObject countriesJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName)); if (countriesJson.isEmpty()) { - msgs.push_back(CStatusMessage(this).error("Failed to read from file/empty file '%1'") << fileName); + msgs.push_back(CStatusMessage(this).error(u"Failed to read from file/empty file '%1'") << fileName); } else { @@ -464,7 +464,7 @@ namespace BlackCore const QFileInfo fi(fileName); if (!fi.exists()) { - msgs.push_back(CStatusMessage(this).warning("File '%1' does not exist") << fileName); + msgs.push_back(CStatusMessage(this).warning(u"File '%1' does not exist") << fileName); } else if (!this->overrideCacheFromFile(overrideNewerOnly, fi, CEntityFlags::AircraftIcaoEntity, msgs)) { @@ -475,7 +475,7 @@ namespace BlackCore const QJsonObject aircraftJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName)); if (aircraftJson.isEmpty()) { - msgs.push_back(CStatusMessage(this).error("Failed to read from file/empty file '%1'") << fileName); + msgs.push_back(CStatusMessage(this).error(u"Failed to read from file/empty file '%1'") << fileName); } else { @@ -502,7 +502,7 @@ namespace BlackCore const QFileInfo fi(fileName); if (!fi.exists()) { - msgs.push_back(CStatusMessage(this).warning("File '%1' does not exist") << fileName); + msgs.push_back(CStatusMessage(this).warning(u"File '%1' does not exist") << fileName); } else if (!this->overrideCacheFromFile(overrideNewerOnly, fi, CEntityFlags::AirlineIcaoEntity, msgs)) { @@ -513,7 +513,7 @@ namespace BlackCore const QJsonObject airlineJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName)); if (airlineJson.isEmpty()) { - msgs.push_back(CStatusMessage(this).error("Failed to read from file/empty file '%1'") << fileName); + msgs.push_back(CStatusMessage(this).error(u"Failed to read from file/empty file '%1'") << fileName); } else { diff --git a/src/blackcore/db/infodatareader.cpp b/src/blackcore/db/infodatareader.cpp index 8bc44bf00..1d90cdbe2 100644 --- a/src/blackcore/db/infodatareader.cpp +++ b/src/blackcore/db/infodatareader.cpp @@ -146,7 +146,7 @@ namespace BlackCore if (urlLogList.hasPending()) { - CLogMessage(this).info("Info data reading still pending, summary: '%1'") << urlLogList.getSummary(); + CLogMessage(this).info(u"Info data reading still pending, summary: '%1'") << urlLogList.getSummary(); return; } if (!url.isEmpty()) @@ -229,7 +229,7 @@ namespace BlackCore Q_UNUSED(overrideNewer); Q_ASSERT_X(false, Q_FUNC_INFO, "Not supported"); - return CStatusMessage(this).error("Not supported"); + return CStatusMessage(this).error(u"Not supported"); } bool CInfoDataReader::readFromJsonFilesInBackground(const QString &dir, CEntityFlags::Entity whatToRead, bool overrideNewer) diff --git a/src/blackcore/db/modeldatareader.cpp b/src/blackcore/db/modeldatareader.cpp index bc800200c..11abf0c5f 100644 --- a/src/blackcore/db/modeldatareader.cpp +++ b/src/blackcore/db/modeldatareader.cpp @@ -310,7 +310,7 @@ namespace BlackCore qint64 latestTimestamp = liveries.latestTimestampMsecsSinceEpoch(); if (n > 0 && latestTimestamp < 0) { - CLogMessage(this).error("No timestamp in livery list, setting to last modified value"); + CLogMessage(this).error(u"No timestamp in livery list, setting to last modified value"); latestTimestamp = lastModifiedMsSinceEpoch(nwReply.data()); } const CStatusMessage cacheMsg = m_liveryCache.set(liveries, latestTimestamp); @@ -357,7 +357,7 @@ namespace BlackCore qint64 latestTimestamp = distributors.latestTimestampMsecsSinceEpoch(); if (n > 0 && latestTimestamp < 0) { - CLogMessage(this).error("No timestamp in distributor list, setting to last modified value"); + CLogMessage(this).error(u"No timestamp in distributor list, setting to last modified value"); latestTimestamp = lastModifiedMsSinceEpoch(nwReply.data()); } @@ -406,7 +406,7 @@ namespace BlackCore qint64 latestTimestamp = models.latestTimestampMsecsSinceEpoch(); if (n > 0 && latestTimestamp < 0) { - CLogMessage(this).error("No timestamp in model list, setting to last modified value"); + CLogMessage(this).error(u"No timestamp in model list, setting to last modified value"); latestTimestamp = lastModifiedMsSinceEpoch(nwReply.data()); } const CStatusMessage cacheMsg = m_modelCache.set(models, latestTimestamp); @@ -421,7 +421,7 @@ namespace BlackCore const QDir directory(dir); if (!directory.exists()) { - return CStatusMessage(this).error("Missing directory '%1'") << dir; + return CStatusMessage(this).error(u"Missing directory '%1'") << dir; } whatToRead &= CEntityFlags::DistributorLiveryModel; // supported @@ -434,7 +434,7 @@ namespace BlackCore const QFileInfo fi(fileName); if (!fi.exists()) { - msgs.push_back(CStatusMessage(this).warning("File '%1' does not exist") << fileName); + msgs.push_back(CStatusMessage(this).warning(u"File '%1' does not exist") << fileName); } else if (!this->overrideCacheFromFile(overrideNewerOnly, fi, CEntityFlags::LiveryEntity, msgs)) { @@ -445,7 +445,7 @@ namespace BlackCore const QJsonObject liveriesJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName)); if (liveriesJson.isEmpty()) { - msgs.push_back(CStatusMessage(this).error("Failed to read from file/empty file '%1'") << fileName); + msgs.push_back(CStatusMessage(this).error(u"Failed to read from file/empty file '%1'") << fileName); } else { @@ -472,7 +472,7 @@ namespace BlackCore const QFileInfo fi(fileName); if (!fi.exists()) { - msgs.push_back(CStatusMessage(this).warning("File '%1' does not exist") << fileName); + msgs.push_back(CStatusMessage(this).warning(u"File '%1' does not exist") << fileName); } else if (!this->overrideCacheFromFile(overrideNewerOnly, fi, CEntityFlags::ModelEntity, msgs)) { @@ -483,7 +483,7 @@ namespace BlackCore const QJsonObject modelsJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName)); if (modelsJson.isEmpty()) { - msgs.push_back(CStatusMessage(this).error("Failed to read from file/empty file '%1'") << fileName); + msgs.push_back(CStatusMessage(this).error(u"Failed to read from file/empty file '%1'") << fileName); } else { @@ -510,7 +510,7 @@ namespace BlackCore const QFileInfo fi(fileName); if (!fi.exists()) { - msgs.push_back(CStatusMessage(this).warning("File '%1' does not exist") << fileName); + msgs.push_back(CStatusMessage(this).warning(u"File '%1' does not exist") << fileName); } else if (!this->overrideCacheFromFile(overrideNewerOnly, fi, CEntityFlags::DistributorEntity, msgs)) { @@ -521,7 +521,7 @@ namespace BlackCore const QJsonObject distributorsJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName)); if (distributorsJson.isEmpty()) { - msgs.push_back(CStatusMessage(this).error("Failed to read from file/empty file '%1'") << fileName); + msgs.push_back(CStatusMessage(this).error(u"Failed to read from file/empty file '%1'") << fileName); } else { diff --git a/src/blackcore/db/networkwatchdog.cpp b/src/blackcore/db/networkwatchdog.cpp index 5a08a68d5..6caf62d70 100644 --- a/src/blackcore/db/networkwatchdog.cpp +++ b/src/blackcore/db/networkwatchdog.cpp @@ -329,7 +329,7 @@ namespace BlackCore // be a little less verbose if ((m_totalGoodCountDb % 5 == 0) || m_consecutivePingBadCount > 0) { - CLogMessage(this).info("Watchdog pinged '%1'") << url; + CLogMessage(this).info(u"Watchdog pinged '%1'") << url; } m_totalGoodCountDb++; m_consecutivePingBadCount = 0; @@ -340,7 +340,7 @@ namespace BlackCore m_consecutivePingBadCount++; if (m_logOwnMessages) { - CStatusMessage(this).warning("Watchdog ping failed, error: '%1', total good/bad DB counts: %2/%3") << errorString << m_totalGoodCountDb << m_totalBadCountDb; + CStatusMessage(this).warning(u"Watchdog ping failed, error: '%1', total good/bad DB counts: %2/%3") << errorString << m_totalGoodCountDb << m_totalBadCountDb; } } this->setDbAccessibility(ok); diff --git a/src/blackcore/pluginmanager.cpp b/src/blackcore/pluginmanager.cpp index a2c05c5f1..8bb5ef9c8 100644 --- a/src/blackcore/pluginmanager.cpp +++ b/src/blackcore/pluginmanager.cpp @@ -34,7 +34,7 @@ namespace BlackCore QDir pluginDir(pluginDirectory()); if (!pluginDir.exists()) { - CLogMessage(this).warning("No such directory: %1") << pluginDir.path(); + CLogMessage(this).warning(u"No such directory: %1") << pluginDir.path(); return; } @@ -100,7 +100,7 @@ namespace BlackCore const QJsonObject json = loader.metaData(); if (!isValid(json)) { - CLogMessage(this).warning("Plugin '%1' invalid, not loading it") << path; + CLogMessage(this).warning(u"Plugin '%1' invalid, not loading it") << path; return false; } @@ -129,7 +129,7 @@ namespace BlackCore if (!m_paths.contains(identifier)) { - CLogMessage(this).warning("Plugin with id '%1' does not exist") << identifier; + CLogMessage(this).warning(u"Plugin with id '%1' does not exist") << identifier; return nullptr; } diff --git a/src/blackcore/pluginmanagersimulator.cpp b/src/blackcore/pluginmanagersimulator.cpp index 3be99ec42..b7b8c93cf 100644 --- a/src/blackcore/pluginmanagersimulator.cpp +++ b/src/blackcore/pluginmanagersimulator.cpp @@ -41,7 +41,7 @@ namespace BlackCore ISimulatorFactory *factory = this->getFactory(pluginId); if (!factory) { - CLogMessage(this).warning("Could not load plugin '%1'.") << pluginId; + CLogMessage(this).warning(u"Could not load plugin '%1'.") << pluginId; m_plugins.remove(pluginId); return nullptr; } diff --git a/src/blackcore/setupreader.cpp b/src/blackcore/setupreader.cpp index 165e7b2fd..dc430d32a 100644 --- a/src/blackcore/setupreader.cpp +++ b/src/blackcore/setupreader.cpp @@ -262,7 +262,7 @@ namespace BlackCore if (!m_lastSuccessfulSetupUrl.isEmpty()) { // already read - CLogMessage(this).info("Cancel second bootstrap read ('%1'), as there was a 1st read: '%2'") << url.toQString() << m_lastSuccessfulSetupUrl; + CLogMessage(this).info(u"Cancel second bootstrap read ('%1'), as there was a 1st read: '%2'") << url.toQString() << m_lastSuccessfulSetupUrl; return; } sApp->getFromNetwork(url.toNetworkRequest(), { this, &CSetupReader::parseBootstrapFile }); @@ -283,14 +283,14 @@ namespace BlackCore const CUrlList randomUrls = m_updateInfoUrls.randomElements(2); if (randomUrls.isEmpty()) { - CLogMessage(this).warning("Cannot read update info, no URLs"); + CLogMessage(this).warning(u"Cannot read update info, no URLs"); this->manageUpdateInfoAvailability(false); return; } if (m_updateInfo.lastUpdatedAge() < 5000) { - CLogMessage(this).info("Update info just updated, skip read"); + CLogMessage(this).info(u"Update info just updated, skip read"); return; } @@ -308,7 +308,7 @@ namespace BlackCore if (!m_lastSuccessfulUpdateInfoUrl.isEmpty()) { // already read - CLogMessage(this).info("Cancel second update info read ('%1'), as there was a 1st read '%2'") << url.toQString() << m_lastSuccessfulUpdateInfoUrl; + CLogMessage(this).info(u"Cancel second update info read ('%1'), as there was a 1st read '%2'") << url.toQString() << m_lastSuccessfulUpdateInfoUrl; return; } sApp->getFromNetwork(url.toNetworkRequest(), { this, &CSetupReader::parseUpdateInfoFile }); @@ -331,15 +331,15 @@ namespace BlackCore CStatusMessageList CSetupReader::readLocalBootstrapFile(const QString &fileName) { - if (fileName.isEmpty()) { return CStatusMessage(this).error("No file name for local bootstrap file"); } - if (!sApp || sApp->isShuttingDown()) { return CStatusMessage(this).error("No sApp, shutting down?"); } + if (fileName.isEmpty()) { return CStatusMessage(this).error(u"No file name for local bootstrap file"); } + if (!sApp || sApp->isShuttingDown()) { return CStatusMessage(this).error(u"No sApp, shutting down?"); } QString fn; const QFile file(fileName); if (!file.exists()) { // relative name? const QString dir(sApp->getCmdSwiftPrivateSharedDir()); - if (dir.isEmpty()) { return CStatusMessage(this).error("Empty shared directory '%1' for bootstrap file") << dir; } + if (dir.isEmpty()) { return CStatusMessage(this).error(u"Empty shared directory '%1' for bootstrap file") << dir; } // no version for local files, as those come with the current code fn = CFileUtils::appendFilePaths(dir, "bootstrap/" + CDirectoryUtils::bootstrapFileName()); @@ -350,7 +350,7 @@ namespace BlackCore } const QString content(CFileUtils::readFileToString(fn)); - if (content.isEmpty()) { return CStatusMessage(this).error("File '%1' not existing or empty") << fn; } + if (content.isEmpty()) { return CStatusMessage(this).error(u"File '%1' not existing or empty") << fn; } try { @@ -358,7 +358,7 @@ namespace BlackCore s.convertFromJson(content); s.markAsLoadedFromFile(true); const CStatusMessage setMsg = m_setup.set(s); - const CStatusMessage setInfo = CStatusMessage(this).info("Setup cache updated from local file '%1'") << fn; + const CStatusMessage setInfo = CStatusMessage(this).info(u"Setup cache updated from local file '%1'") << fn; return setMsg.isSuccess() ? setInfo : setMsg; } catch (const CJsonException &ex) @@ -384,7 +384,7 @@ namespace BlackCore nwReplyPtr->close(); if (setupJson.isEmpty()) { - const CStatusMessage m = CLogMessage(this).info("No bootstrap setup file at '%1'") << urlString; + const CStatusMessage m = CLogMessage(this).info(u"No bootstrap setup file at '%1'") << urlString; emit this->setupLoadingMessages(m); } else @@ -403,7 +403,7 @@ namespace BlackCore if (sameVersionLoaded) { m_updateInfoUrls = currentSetup.getSwiftUpdateInfoFileUrls(); // defaults - CLogMessage(this).info("Same setup version loaded from '%1' as already in data cache '%2'") << urlString << m_setup.getFilename(); + CLogMessage(this).info(u"Same setup version loaded from '%1' as already in data cache '%2'") << urlString << m_setup.getFilename(); CLogMessage::preformatted(this->manageSetupAvailability(true)); return; // success } @@ -416,9 +416,9 @@ namespace BlackCore { // no issue with cache m_updateInfoUrls = loadedSetup.getSwiftUpdateInfoFileUrls(); - const CStatusMessage m = CLogMessage(this).info("Loaded setup from '%1'") << urlString; + const CStatusMessage m = CLogMessage(this).info(u"Loaded setup from '%1'") << urlString; emit this->setupLoadingMessages(m); - CLogMessage(this).info("Setup: Updated data cache in '%1'") << m_setup.getFilename(); + CLogMessage(this).info(u"Setup: Updated data cache in '%1'") << m_setup.getFilename(); { QWriteLocker l(&m_lockSetup); m_lastSuccessfulSetupUrl = urlString; @@ -473,7 +473,7 @@ namespace BlackCore nwReplyPtr->close(); if (updateInfoJsonString.isEmpty()) { - CLogMessage(this).info("No update info file content"); + CLogMessage(this).info(u"No update info file content"); // try next URL } else @@ -483,7 +483,7 @@ namespace BlackCore const CUpdateInfo updateInfo = CUpdateInfo::fromDatabaseJson(updateInfoJsonString); if (updateInfo.isEmpty()) { - CLogMessage(this).error("Loading of update info yielded no data"); + CLogMessage(this).error(u"Loading of update info yielded no data"); this->manageUpdateInfoAvailability(false); } else @@ -501,8 +501,8 @@ namespace BlackCore QWriteLocker l(&m_lockUpdateInfo); m_lastSuccessfulUpdateInfoUrl = urlString; } - CLogMessage(this).info("Update info loaded from '%1") << urlString; - CLogMessage(this).info("Update info: Updated data cache in '%1', artifacts: %2, distributions: %3") << m_updateInfo.getFilename() << updateInfo.getArtifactsPilotClient().size() << updateInfo.getDistributions().size(); + CLogMessage(this).info(u"Update info loaded from '%1") << urlString; + CLogMessage(this).info(u"Update info: Updated data cache in '%1', artifacts: %2, distributions: %3") << m_updateInfo.getFilename() << updateInfo.getArtifactsPilotClient().size() << updateInfo.getDistributions().size(); this->manageUpdateInfoAvailability(true); } // cache } @@ -578,7 +578,7 @@ namespace BlackCore const bool cacheAvailable = cachedSetup.wasLoaded(); if (cacheAvailable) { - CLogMessage(this).info("Setup cache prefill (bootstrap already cached, no prefill needed"); + CLogMessage(this).info(u"Setup cache prefill (bootstrap already cached, no prefill needed"); return false; } const QString fn = CDirectoryUtils::bootstrapResourceFilePath(); @@ -659,7 +659,7 @@ namespace BlackCore if (webRead) { - msgs.push_back(CStatusMessage(this).info("Setup loaded from web, will trigger read of update information")); + msgs.push_back(CStatusMessage(this).info(u"Setup loaded from web, will trigger read of update information")); QTimer::singleShot(500, this, [ = ] { if (!myself) { return; } @@ -669,7 +669,7 @@ namespace BlackCore if (localRead) { - msgs.push_back(CStatusMessage(this).info("Setup loaded locally, will trigger read of update information")); + msgs.push_back(CStatusMessage(this).info(u"Setup loaded locally, will trigger read of update information")); QTimer::singleShot(500, this, [ = ] { if (!myself) { return; } @@ -705,7 +705,7 @@ namespace BlackCore if (!webRead && !localRead) { - msgs.push_back(CStatusMessage(this).warning("Since setup was not updated this time, will not start loading of update information")); + msgs.push_back(CStatusMessage(this).warning(u"Since setup was not updated this time, will not start loading of update information")); this->manageUpdateInfoAvailability(false); } return msgs; diff --git a/src/blackcore/simulator.cpp b/src/blackcore/simulator.cpp index af0ec4f82..2872ff8dc 100644 --- a/src/blackcore/simulator.cpp +++ b/src/blackcore/simulator.cpp @@ -165,7 +165,7 @@ namespace BlackCore { if (!this->showDebugLogMessage()) { return; } if (msg.isEmpty()) { return; } - const CStatusMessage m = CStatusMessage(this).info("%1") << msg; + const CStatusMessage m = CStatusMessage(this).info(u"%1") << msg; emit this->driverMessages(m); } @@ -173,7 +173,7 @@ namespace BlackCore { if (!this->showDebugLogMessage()) { return; } if (msg.isEmpty()) { return; } - const CStatusMessage m = CStatusMessage(this).info("%1 %2") << msg << funcInfo; + const CStatusMessage m = CStatusMessage(this).info(u"%1 %2") << msg << funcInfo; emit this->driverMessages(m); } @@ -383,14 +383,14 @@ namespace BlackCore const QString part2 = parser.part(2).toLower(); if (part2 == "off" || part2 == "false") { - CStatusMessage(this).info("Disabled interpolation logging"); + CStatusMessage(this).info(u"Disabled interpolation logging"); this->clearInterpolationLogCallsigns(); return true; } if (part2 == "clear" || part2 == "clr") { m_interpolationLogger.clearLog(); - CStatusMessage(this).info("Cleared interpolation logging"); + CStatusMessage(this).info(u"Cleared interpolation logging"); this->clearInterpolationLogCallsigns(); return true; } @@ -401,7 +401,7 @@ namespace BlackCore const int max = parser.part(3).toInt(&ok); if (!ok) { return false; } m_interpolationLogger.setMaxSituations(max); - CStatusMessage(this).info("Max.situations logged: %1") << max; + CStatusMessage(this).info(u"Max.situations logged: %1") << max; return true; } if (part2 == "write" || part2 == "save") @@ -411,7 +411,7 @@ namespace BlackCore // write m_interpolationLogger.writeLogInBackground(); - CLogMessage(this).info("Started writing interpolation log"); + CLogMessage(this).info(u"Started writing interpolation log"); return true; } if (part2 == "show") @@ -424,7 +424,7 @@ namespace BlackCore } else { - CLogMessage(this).warning("No interpolation log directory"); + CLogMessage(this).warning(u"No interpolation log directory"); } return true; } @@ -433,13 +433,13 @@ namespace BlackCore if (!cs.isValid()) { return false; } if (this->getAircraftInRangeCallsigns().contains(cs)) { - CLogMessage(this).info("Will log interpolation for '%1'") << cs.asString(); + CLogMessage(this).info(u"Will log interpolation for '%1'") << cs.asString(); this->setLogCallsign(true, cs); return true; } else { - CLogMessage(this).warning("Cannot log interpolation for '%1', no aircraft in range") << cs.asString(); + CLogMessage(this).warning(u"Cannot log interpolation for '%1', no aircraft in range") << cs.asString(); return false; } } // logint @@ -450,7 +450,8 @@ namespace BlackCore { const CCallsign cs(parser.part(2)); const bool changed = this->setInterpolationMode(part1, cs); - CLogMessage(this).info(changed ? "Changed interpolation mode for '%1'" : "Unchanged interpolation mode for '%1'") << cs.asString(); + CLogMessage(this).info(changed ? QStringLiteral("Changed interpolation mode for '%1'") + : QStringLiteral("Unchanged interpolation mode for '%1'")) << cs.asString(); return true; } else @@ -458,7 +459,8 @@ namespace BlackCore CInterpolationAndRenderingSetupGlobal setup = this->getInterpolationSetupGlobal(); const bool changed = setup.setInterpolatorMode(part1); if (changed) { this->setInterpolationSetupGlobal(setup); } - CLogMessage(this).info(changed ? "Changed interpolation mode globally" : "Unchanged interpolation mode"); + CLogMessage(this).info(changed ? QStringLiteral("Changed interpolation mode globally") + : QStringLiteral("Unchanged interpolation mode")); return true; } } // spline/linear @@ -476,7 +478,7 @@ namespace BlackCore } this->setLogCallsign(true, cs); - CLogMessage(this).info("Display position for '%1'") << cs.asString(); + CLogMessage(this).info(u"Display position for '%1'") << cs.asString(); this->displayLoggedSituationInSimulator(cs, true); return true; } @@ -522,7 +524,7 @@ namespace BlackCore { const int perSecond = parser.toInt(2, -1); this->limitToUpdatesPerSecond(perSecond); - CLogMessage(this).info("Remote aircraft updates limitations: %1") << this->updateAircraftLimitationInfo(); + CLogMessage(this).info(u"Remote aircraft updates limitations: %1") << this->updateAircraftLimitationInfo(); return true; } @@ -658,7 +660,7 @@ namespace BlackCore connect(this, &ISimulator::ownAircraftModelChanged, this, &ISimulator::onOwnModelChanged, Qt::QueuedConnection); // info - CLogMessage(this).info("Initialized simulator driver: '%1'") << + CLogMessage(this).info(u"Initialized simulator driver: '%1'") << (this->getSimulatorInfo().isUnspecified() ? this->getSimulatorPluginInfo().toQString() : this->getSimulatorInfo().toQString()); @@ -999,7 +1001,7 @@ namespace BlackCore { CStatusMessageList msgs; if (!CBuildConfig::isLocalDeveloperDebugBuild()) { return msgs; } - if (!m_addAgainAircraftWhenRemoved.isEmpty()) { msgs.push_back(CStatusMessage(this).error("m_addAgainAircraftWhenRemoved not empty: '%1'") << m_addAgainAircraftWhenRemoved.getCallsignStrings(true).join(", ")); } + if (!m_addAgainAircraftWhenRemoved.isEmpty()) { msgs.push_back(CStatusMessage(this).error(u"m_addAgainAircraftWhenRemoved not empty: '%1'") << m_addAgainAircraftWhenRemoved.getCallsignStrings(true).join(", ")); } return msgs; } diff --git a/src/blackcore/threadedreader.cpp b/src/blackcore/threadedreader.cpp index f3e1cc16d..006f5b117 100644 --- a/src/blackcore/threadedreader.cpp +++ b/src/blackcore/threadedreader.cpp @@ -177,7 +177,7 @@ namespace BlackCore const CUrlLogList outdatedPendingUrls = m_urlReadLog.findOutdatedPending(OutdatedPendingCallMs); if (!outdatedPendingUrls.isEmpty()) { - CLogMessage(this).warning("Detected outdated reader pending calls: '%1'") << outdatedPendingUrls.toQString(true); + CLogMessage(this).warning(u"Detected outdated reader pending calls: '%1'") << outdatedPendingUrls.toQString(true); m_urlReadLog.removeOlderThanNowMinusOffset(OutdatedPendingCallMs); // clean up } diff --git a/src/blackcore/vatsim/audiodevicevatlib.cpp b/src/blackcore/vatsim/audiodevicevatlib.cpp index 052cb1fbf..776990b12 100644 --- a/src/blackcore/vatsim/audiodevicevatlib.cpp +++ b/src/blackcore/vatsim/audiodevicevatlib.cpp @@ -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; } diff --git a/src/blackcore/vatsim/networkvatlib.cpp b/src/blackcore/vatsim/networkvatlib.cpp index 2466453cd..6c257acf3 100644 --- a/src/blackcore/vatsim/networkvatlib.cpp +++ b/src/blackcore/vatsim/networkvatlib.cpp @@ -974,7 +974,7 @@ namespace BlackCore { if (CBuildConfig::isLocalDeveloperDebugBuild()) { - CLogMessage(static_cast(nullptr)).debug("Wrong transponder code '%1' for '%2'") << position->transponderCode << callsign; + CLogMessage(static_cast(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; } } diff --git a/src/blackcore/vatsim/vatsimbookingreader.cpp b/src/blackcore/vatsim/vatsimbookingreader.cpp index f8451e6a3..c19453668 100644 --- a/src/blackcore/vatsim/vatsimbookingreader.cpp +++ b/src/blackcore/vatsim/vatsimbookingreader.cpp @@ -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("")); 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); } diff --git a/src/blackcore/vatsim/vatsimdatafilereader.cpp b/src/blackcore/vatsim/vatsimdatafilereader.cpp index 690c44388..981eea07e 100644 --- a/src/blackcore/vatsim/vatsimdatafilereader.cpp +++ b/src/blackcore/vatsim/vatsimdatafilereader.cpp @@ -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 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); } diff --git a/src/blackcore/vatsim/vatsimmetarreader.cpp b/src/blackcore/vatsim/vatsimmetarreader.cpp index a3f72b337..c11e07799 100644 --- a/src/blackcore/vatsim/vatsimmetarreader.cpp +++ b/src/blackcore/vatsim/vatsimmetarreader.cpp @@ -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); } diff --git a/src/blackcore/vatsim/vatsimstatusfilereader.cpp b/src/blackcore/vatsim/vatsimstatusfilereader.cpp index ea7eb3e72..69c5d773e 100644 --- a/src/blackcore/vatsim/vatsimstatusfilereader.cpp +++ b/src/blackcore/vatsim/vatsimstatusfilereader.cpp @@ -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); } diff --git a/src/blackcore/vatsim/voicechannelvatlib.cpp b/src/blackcore/vatsim/voicechannelvatlib.cpp index c117604c8..b67a69153 100644 --- a/src/blackcore/vatsim/voicechannelvatlib.cpp +++ b/src/blackcore/vatsim/voicechannelvatlib.cpp @@ -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; } diff --git a/src/blackcore/weathermanager.cpp b/src/blackcore/weathermanager.cpp index d20d21fe1..e2193b687 100644 --- a/src/blackcore/weathermanager.cpp +++ b/src/blackcore/weathermanager.cpp @@ -84,7 +84,7 @@ namespace BlackCore const CWeatherDataPluginInfoList weatherDataPluginInfos = m_pluginManagerWeatherData.getAvailableWeatherDataPlugins(); if (weatherDataPluginInfos.isEmpty()) { - CLogMessage(this).warning("No weather data plugin found!"); + CLogMessage(this).warning(u"No weather data plugin found!"); return false; } @@ -93,14 +93,14 @@ namespace BlackCore IWeatherDataFactory *factory = m_pluginManagerWeatherData.getPluginById(pluginInfo.getIdentifier()); if (!factory) { - CLogMessage(this).error("Failed to create IWeatherDataFactory for %1") << pluginInfo.getIdentifier(); + CLogMessage(this).error(u"Failed to create IWeatherDataFactory for %1") << pluginInfo.getIdentifier(); return false; } IWeatherData *weatherData = factory->create(this); if (!weatherData) { - CLogMessage(this).error("Failed to create IWeatherData instance for %1") << pluginInfo.getIdentifier(); + CLogMessage(this).error(u"Failed to create IWeatherData instance for %1") << pluginInfo.getIdentifier(); return false; } diff --git a/src/blackcore/webdataservices.cpp b/src/blackcore/webdataservices.cpp index 0cdaa3d7d..260aa0e8c 100644 --- a/src/blackcore/webdataservices.cpp +++ b/src/blackcore/webdataservices.cpp @@ -72,7 +72,7 @@ namespace BlackCore // will remove info reader because not needed readers &= ~CWebReaderFlags::DbInfoDataReader; m_readers = readers; - CLogMessage(this).info("Remove info object reader because not needed"); + CLogMessage(this).info(u"Remove info object reader because not needed"); } // get entities to be read @@ -80,7 +80,7 @@ namespace BlackCore if (entities.testFlag(CEntityFlags::DbInfoObjectEntity)) { Q_ASSERT_X(readers.testFlag(CWebReaderFlags::DbInfoDataReader), Q_FUNC_INFO, "info object but no reader"); - CLogMessage(this).info("Using info objects for swift DB entities"); + CLogMessage(this).info(u"Using info objects for swift DB entities"); } this->initReaders(readers, entities); // reads info objects if required @@ -312,7 +312,7 @@ namespace BlackCore if (!sApp || sApp->isShuttingDown()) { return CEntityFlags::NoEntity; } if (!sApp->isSwiftDbAccessible()) { - CLogMessage(this).warning("Not triggering load of '%1' because swift DB is not accessible") << CEntityFlags::flagToString(whatToRead); + CLogMessage(this).warning(u"Not triggering load of '%1' because swift DB is not accessible") << CEntityFlags::flagToString(whatToRead); return CEntityFlags::NoEntity; } @@ -362,7 +362,7 @@ namespace BlackCore if (!sApp || sApp->isShuttingDown()) { return CEntityFlags::NoEntity; } if (!sApp->hasWorkingSharedUrl()) { - CLogMessage(this).warning("Not triggering load of '%1' because no working shared URL") << CEntityFlags::flagToString(whatToRead); + CLogMessage(this).warning(u"Not triggering load of '%1' because no working shared URL") << CEntityFlags::flagToString(whatToRead); return CEntityFlags::NoEntity; } @@ -1002,7 +1002,7 @@ namespace BlackCore } else { - CLogMessage(this).warning("DB unreachable, skipping read from DB info data reader"); + CLogMessage(this).warning(u"DB unreachable, skipping read from DB info data reader"); } } } @@ -1019,7 +1019,7 @@ namespace BlackCore { m_vatsimStatusReader = new CVatsimStatusFileReader(this); c = connect(m_vatsimStatusReader, &CVatsimStatusFileReader::dataFileRead, this, &CWebDataServices::vatsimStatusFileRead, typeReaderReadSignals); - CLogMessage(this).info("Trigger read of VATSIM status file"); + CLogMessage(this).info(u"Trigger read of VATSIM status file"); m_vatsimStatusReader->start(QThread::LowPriority); // run single shot in main loop, so readInBackgroundThread is not called before initReaders completes @@ -1268,22 +1268,22 @@ namespace BlackCore void CWebDataServices::receivedBookings(const CAtcStationList &stations) { - CLogMessage(this).info("Read %1 ATC bookings from network") << stations.size(); + CLogMessage(this).info(u"Read %1 ATC bookings from network") << stations.size(); } void CWebDataServices::receivedMetars(const CMetarList &metars) { - CLogMessage(this).info("Read %1 METARs") << metars.size(); + CLogMessage(this).info(u"Read %1 METARs") << metars.size(); } void CWebDataServices::vatsimDataFileRead(int lines) { - CLogMessage(this).info("Read VATSIM data file, %1 lines") << lines; + CLogMessage(this).info(u"Read VATSIM data file, %1 lines") << lines; } void CWebDataServices::vatsimStatusFileRead(int lines) { - CLogMessage(this).info("Read VATSIM status file, %1 lines") << lines; + CLogMessage(this).info(u"Read VATSIM status file, %1 lines") << lines; } void CWebDataServices::readFromSwiftReader(CEntityFlags::Entity entities, CEntityFlags::ReadState state, int number) @@ -1296,16 +1296,16 @@ namespace BlackCore const CStatusMessage::StatusSeverity severity = CEntityFlags::flagToSeverity(state); if (severity == CStatusMessage::SeverityWarning) { - CLogMessage(cats).warning("Read data '%1' entries: %2 state: %3") << CEntityFlags::flagToString(entities) << number << CEntityFlags::flagToString(state); + CLogMessage(cats).warning(u"Read data '%1' entries: %2 state: %3") << CEntityFlags::flagToString(entities) << number << CEntityFlags::flagToString(state); } else { - CLogMessage(cats).error("Read data '%1' entries: %2 state: %3") << CEntityFlags::flagToString(entities) << number << CEntityFlags::flagToString(state); + CLogMessage(cats).error(u"Read data '%1' entries: %2 state: %3") << CEntityFlags::flagToString(entities) << number << CEntityFlags::flagToString(state); } } else { - CLogMessage(cats).info("Read data '%1' entries: %2 state: %3") << CEntityFlags::flagToString(entities) << number << CEntityFlags::flagToString(state); + CLogMessage(cats).info(u"Read data '%1' entries: %2 state: %3") << CEntityFlags::flagToString(entities) << number << CEntityFlags::flagToString(state); } m_swiftDbEntitiesRead |= entities; @@ -1410,7 +1410,7 @@ namespace BlackCore if (infoReader->areAllInfoObjectsRead()) { // we have all data and carry on - CLogMessage(this).info("Info objects (%1) triggered for '%2' loaded from '%3'") << info << CEntityFlags::flagToString(entities) << infoReader->getInfoObjectsUrl().toQString(); + CLogMessage(this).info(u"Info objects (%1) triggered for '%2' loaded from '%3'") << info << CEntityFlags::flagToString(entities) << infoReader->getInfoObjectsUrl().toQString(); timeOut = QDateTime(); // reset to null return true; // no need to wait any longer } @@ -1419,7 +1419,7 @@ namespace BlackCore if (timeOut.isValid() && QDateTime::currentDateTimeUtc() > timeOut) { const QString timeOutString = timeOut.toString(); - CLogMessage(this).warning("Could not read '%1' info objects for '%2' from '%3', time out '%4'. Marking reader '%5' as failed and continue.") + CLogMessage(this).warning(u"Could not read '%1' info objects for '%2' from '%3', time out '%4'. Marking reader '%5' as failed and continue.") << info << CEntityFlags::flagToString(entities) << infoReader->getInfoObjectsUrl().toQString() << timeOutString << infoReader->getName(); @@ -1437,14 +1437,14 @@ namespace BlackCore { // ok, this means we are parsing this->readDeferredInBackground(entities, waitForInfoObjectsMs); - CLogMessage(this).info("Parsing objects (%1) for '%2' from '%3'") << info << CEntityFlags::flagToString(entities) << infoReader->getInfoObjectsUrl().toQString(); + CLogMessage(this).info(u"Parsing objects (%1) for '%2' from '%3'") << info << CEntityFlags::flagToString(entities) << infoReader->getInfoObjectsUrl().toQString(); return false; // wait } else { // we have a response, but a failure, means server is alive, but responded with error // such an error (access, ...) normally will not go away - CLogMessage(this).error("Info objects (%1) loading for '%2' failed from '%3', '%4'") << info << CEntityFlags::flagToString(entities) << infoReader->getInfoObjectsUrl().toQString() << infoReader->getStatusMessage(); + CLogMessage(this).error(u"Info objects (%1) loading for '%2' failed from '%3', '%4'") << info << CEntityFlags::flagToString(entities) << infoReader->getInfoObjectsUrl().toQString() << infoReader->getStatusMessage(); infoReader->setMarkedAsFailed(true); return true; // carry on, regardless of situation } @@ -1470,7 +1470,7 @@ namespace BlackCore { const CEcosystem es(server.getEcosystem()); this->setCurrentEcosystem(es); - CLogMessage(this).info("Changed data service ecosystem to '%1'") << es.toQString(true); + CLogMessage(this).info(u"Changed data service ecosystem to '%1'") << es.toQString(true); } bool CWebDataServices::writeDbDataToDisk(const QString &dir) const @@ -1520,7 +1520,7 @@ namespace BlackCore bool ib = inBackground || !CThreadUtils::isCurrentThreadObjectThread(m_icaoDataReader); if (ib) { - CLogMessage(this).info("Reading from disk in background: %1") << m_icaoDataReader->getSupportedEntitiesAsString(); + CLogMessage(this).info(u"Reading from disk in background: %1") << m_icaoDataReader->getSupportedEntitiesAsString(); s1 = m_icaoDataReader->readFromJsonFilesInBackground(dir, m_icaoDataReader->getSupportedEntities(), overrideNewerOnly); } else @@ -1538,7 +1538,7 @@ namespace BlackCore bool ib = inBackground || !CThreadUtils::isCurrentThreadObjectThread(m_modelDataReader); if (ib) { - CLogMessage(this).info("Reading from disk in background: %1") << m_modelDataReader->getSupportedEntitiesAsString(); + CLogMessage(this).info(u"Reading from disk in background: %1") << m_modelDataReader->getSupportedEntitiesAsString(); s2 = m_modelDataReader->readFromJsonFilesInBackground(dir, m_modelDataReader->getSupportedEntities(), overrideNewerOnly); } else @@ -1556,7 +1556,7 @@ namespace BlackCore bool ib = inBackground || !CThreadUtils::isCurrentThreadObjectThread(m_airportDataReader); if (ib) { - CLogMessage(this).info("Reading from disk in background: %1") << m_airportDataReader->getSupportedEntitiesAsString(); + CLogMessage(this).info(u"Reading from disk in background: %1") << m_airportDataReader->getSupportedEntitiesAsString(); s3 = m_airportDataReader->readFromJsonFilesInBackground(dir, m_airportDataReader->getSupportedEntities(), overrideNewerOnly); } else @@ -1576,17 +1576,17 @@ namespace BlackCore msgs.push_back( m_icaoDataReader ? m_icaoDataReader->initFromLocalResourceFiles(inBackground) : - CStatusMessage(this).info("No ICAO reader") + CStatusMessage(this).info(u"No ICAO reader") ); msgs.push_back( m_modelDataReader ? m_modelDataReader->initFromLocalResourceFiles(inBackground) : - CStatusMessage(this).info("No model reader") + CStatusMessage(this).info(u"No model reader") ); msgs.push_back( m_airportDataReader ? m_airportDataReader->initFromLocalResourceFiles(inBackground) : - CStatusMessage(this).info("No airport reader") + CStatusMessage(this).info(u"No airport reader") ); return msgs; } @@ -1598,17 +1598,17 @@ namespace BlackCore msgs.push_back( m_icaoDataReader && m_icaoDataReader->supportsAnyOfEntities(entities) ? m_icaoDataReader->initFromLocalResourceFiles(entities, inBackground) : - CStatusMessage(this).info("No ICAO reader or not supporting entities") + CStatusMessage(this).info(u"No ICAO reader or not supporting entities") ); msgs.push_back( m_modelDataReader && m_modelDataReader->supportsAnyOfEntities(entities) ? m_modelDataReader->initFromLocalResourceFiles(entities, inBackground) : - CStatusMessage(this).info("No model reader or not supporting entities") + CStatusMessage(this).info(u"No model reader or not supporting entities") ); msgs.push_back( m_airportDataReader && m_airportDataReader->supportsAnyOfEntities(entities) ? m_airportDataReader->initFromLocalResourceFiles(entities, inBackground) : - CStatusMessage(this).info("No airport reader or not supporting entities") + CStatusMessage(this).info(u"No airport reader or not supporting entities") ); return msgs; } diff --git a/src/blackgui/components/atcstationcomponent.cpp b/src/blackgui/components/atcstationcomponent.cpp index 54b3bfe5b..9bdd5892f 100644 --- a/src/blackgui/components/atcstationcomponent.cpp +++ b/src/blackgui/components/atcstationcomponent.cpp @@ -268,7 +268,7 @@ namespace BlackGui if (sender == ui->tvp_AtcStationsBooked) { // trigger new read, which takes some time. A signal will be received when this is done - CLogMessage(this).info("Requested new bookings"); + CLogMessage(this).info(u"Requested new bookings"); sGui->getIContextNetwork()->requestAtcBookingsUpdate(); } else diff --git a/src/blackgui/components/cockpitcomcomponent.cpp b/src/blackgui/components/cockpitcomcomponent.cpp index 58f6851de..6f3393c34 100644 --- a/src/blackgui/components/cockpitcomcomponent.cpp +++ b/src/blackgui/components/cockpitcomcomponent.cpp @@ -124,7 +124,7 @@ namespace BlackGui const CSelcal selcal = ui->editor_Com->getSelcal(); if (!selcal.isValid()) { - CLogMessage().validationWarning("Invalid SELCAL code"); + CLogMessage().validationWarning(u"Invalid SELCAL code"); } else if (sGui->getIContextAudio()) { @@ -132,7 +132,7 @@ namespace BlackGui } else { - CLogMessage().validationWarning("No audio available"); + CLogMessage().validationWarning(u"No audio available"); } } diff --git a/src/blackgui/components/copyconfigurationcomponent.cpp b/src/blackgui/components/copyconfigurationcomponent.cpp index a1a486d3e..c3b9d50f7 100644 --- a/src/blackgui/components/copyconfigurationcomponent.cpp +++ b/src/blackgui/components/copyconfigurationcomponent.cpp @@ -133,11 +133,11 @@ namespace BlackGui { if (!copied.isEmpty()) { - CLogMessage(this).info("Copied %1 files, list: '%2'") << copied.size() << copied.join(", "); + CLogMessage(this).info(u"Copied %1 files, list: '%2'") << copied.size() << copied.join(", "); } if (!skipped.isEmpty()) { - CLogMessage(this).info("Skipped %1 files, list: '%2'") << skipped.size() << skipped.join(", "); + CLogMessage(this).info(u"Skipped %1 files, list: '%2'") << skipped.size() << skipped.join(", "); } } diff --git a/src/blackgui/components/copymodelsfromotherswiftversionscomponent.cpp b/src/blackgui/components/copymodelsfromotherswiftversionscomponent.cpp index 757eb5bb0..275e7882e 100644 --- a/src/blackgui/components/copymodelsfromotherswiftversionscomponent.cpp +++ b/src/blackgui/components/copymodelsfromotherswiftversionscomponent.cpp @@ -49,7 +49,7 @@ namespace BlackGui const QSet simulators = selectedSimulators.asSingleSimulatorSet(); if (simulators.isEmpty()) { - static const CStatusMessage m = CStatusMessage(this).validationError("No simulators selected"); + static const CStatusMessage m = CStatusMessage(this).validationError(u"No simulators selected"); this->showOverlayMessage(m); return; } @@ -58,14 +58,14 @@ namespace BlackGui const bool cache = ui->cb_ModelCache->isChecked(); if (!cache && !set) { - static const CStatusMessage m = CStatusMessage(this).validationError("No simulators selected"); + static const CStatusMessage m = CStatusMessage(this).validationError(u"No simulators selected"); this->showOverlayMessage(m); return; } if (!ui->comp_OtherSwiftVersions->hasSelection()) { - static const CStatusMessage m = CStatusMessage(this).validationError("No other version selected"); + static const CStatusMessage m = CStatusMessage(this).validationError(u"No other version selected"); this->showOverlayMessage(m); return; } @@ -116,7 +116,7 @@ namespace BlackGui if (sets > 0 || caches > 0) { - const CStatusMessage m = CStatusMessage(this).validationInfo("Copied %1 sets and %2 caches for '%3'") << sets << caches << selectedSimulators.toQString(true); + const CStatusMessage m = CStatusMessage(this).validationInfo(u"Copied %1 sets and %2 caches for '%3'") << sets << caches << selectedSimulators.toQString(true); this->showOverlayHTMLMessage(m, 7500); } } diff --git a/src/blackgui/components/copysettingsandcachescomponent.cpp b/src/blackgui/components/copysettingsandcachescomponent.cpp index 6d62220f3..a41d5ec39 100644 --- a/src/blackgui/components/copysettingsandcachescomponent.cpp +++ b/src/blackgui/components/copysettingsandcachescomponent.cpp @@ -400,7 +400,7 @@ namespace BlackGui if (copied > 0) { - const CStatusMessage m = CStatusMessage(this).validationInfo("Copied %1 settings") << copied; + const CStatusMessage m = CStatusMessage(this).validationInfo(u"Copied %1 settings") << copied; this->showOverlayHTMLMessage(m); } diff --git a/src/blackgui/components/datainfoareacomponent.cpp b/src/blackgui/components/datainfoareacomponent.cpp index 326bda8fd..24d08be81 100644 --- a/src/blackgui/components/datainfoareacomponent.cpp +++ b/src/blackgui/components/datainfoareacomponent.cpp @@ -85,7 +85,7 @@ namespace BlackGui { if (!sGui || !sGui->getWebDataServices()->hasSuccesfullyConnectedSwiftDb()) { - CLogMessage(this).warning("No connection to DB yet, no new data loaded which can be written"); + CLogMessage(this).warning(u"No connection to DB yet, no new data loaded which can be written"); return false; } @@ -93,11 +93,11 @@ namespace BlackGui const bool s = sGui->getWebDataServices()->writeDbDataToDisk(CDirectoryUtils::staticDbFilesDirectory()); if (s) { - CLogMessage(this).info("Written DB data"); + CLogMessage(this).info(u"Written DB data"); } else { - CLogMessage(this).error("Cannot write DB data"); + CLogMessage(this).error(u"Cannot write DB data"); } return s; } @@ -111,7 +111,7 @@ namespace BlackGui bool ok = false; if (msgs.isSuccess()) { - CLogMessage(this).info("Read DB data from directory: %1") << CDirectoryUtils::staticDbFilesDirectory(); + CLogMessage(this).info(u"Read DB data from directory: %1") << CDirectoryUtils::staticDbFilesDirectory(); ui->comp_DbAircraftIcao->showLoadIndicator(); ui->comp_DbAirlineIcao->showLoadIndicator(); ui->comp_DbCountries->showLoadIndicator(); diff --git a/src/blackgui/components/dblogincomponent.cpp b/src/blackgui/components/dblogincomponent.cpp index bc19da651..be24391d4 100644 --- a/src/blackgui/components/dblogincomponent.cpp +++ b/src/blackgui/components/dblogincomponent.cpp @@ -141,7 +141,7 @@ namespace BlackGui if (!sGui || sGui->isShuttingDown()) { return; } if (user.isAuthenticated()) { - CLogMessage(this).info("User authenticated: %1") << user.toQString(); + CLogMessage(this).info(u"User authenticated: %1") << user.toQString(); this->setModeLogin(false); ui->le_Name->setText(user.getRealNameAndId()); ui->te_Roles->setPlainText(user.getRolesAsString()); diff --git a/src/blackgui/components/dbmappingcomponent.cpp b/src/blackgui/components/dbmappingcomponent.cpp index 97307b2d8..1ca0dc578 100644 --- a/src/blackgui/components/dbmappingcomponent.cpp +++ b/src/blackgui/components/dbmappingcomponent.cpp @@ -181,7 +181,7 @@ namespace BlackGui const CAircraftModelList vPilotModels(m_vPilotReader.getAsModelsFromCache()); ui->tvp_AircraftModelsForVPilot->updateContainerMaybeAsync(vPilotModels); const int noModels = vPilotModels.size(); - CLogMessage(this).info("%1 cached vPilot models loaded") << noModels; + CLogMessage(this).info(u"%1 cached vPilot models loaded") << noModels; } ui->tab_VPilot->setEnabled(m_vPilotEnabled); ui->tab_VPilot->setVisible(m_vPilotEnabled); @@ -292,7 +292,7 @@ namespace BlackGui if (updated) { - CLogMessage(this).info("Updated editor data for '%1'") << modelString; + CLogMessage(this).info(u"Updated editor data for '%1'") << modelString; } } @@ -512,12 +512,12 @@ namespace BlackGui { if (m_vPilotReader.readInBackground(true)) { - CLogMessage(this).info("Start loading vPilot rulesets"); + CLogMessage(this).info(u"Start loading vPilot rulesets"); ui->tvp_AircraftModelsForVPilot->showLoadIndicator(); } else { - CLogMessage(this).warning("Loading vPilot rulesets already in progress"); + CLogMessage(this).warning(u"Loading vPilot rulesets already in progress"); } } @@ -526,7 +526,7 @@ namespace BlackGui if (!m_vPilotEnabled) { return; } if (success) { - CLogMessage(this).info("Loading vPilot ruleset completed"); + CLogMessage(this).info(u"Loading vPilot ruleset completed"); const CAircraftModelList models(m_vPilotReader.getAsModels()); if (ui->tvp_AircraftModelsForVPilot->displayAutomatically()) { @@ -535,7 +535,7 @@ namespace BlackGui } else { - CLogMessage(this).error("Loading vPilot ruleset failed"); + CLogMessage(this).error(u"Loading vPilot ruleset failed"); } ui->tvp_AircraftModelsForVPilot->hideLoadIndicator(); } diff --git a/src/blackgui/components/dbownmodelscomponent.cpp b/src/blackgui/components/dbownmodelscomponent.cpp index 3c1136bbe..68334cda3 100644 --- a/src/blackgui/components/dbownmodelscomponent.cpp +++ b/src/blackgui/components/dbownmodelscomponent.cpp @@ -69,7 +69,7 @@ namespace BlackGui const bool success = this->initModelLoader(simulator, IAircraftModelLoader::CacheOnly); if (!success) { - CLogMessage(this).error("Init of model loader failed in component"); + CLogMessage(this).error(u"Init of model loader failed in component"); } } @@ -519,27 +519,27 @@ namespace BlackGui { if (m_modelLoader->supportsSimulator(simulator)) { - const CStatusMessage msg = CLogMessage(this).warning("Loading for '%1' already in progress, will NOT load.") << simulator.toQString(); + const CStatusMessage msg = CLogMessage(this).warning(u"Loading for '%1' already in progress, will NOT load.") << simulator.toQString(); this->showOverlayMessage(msg); return; } else { - const CStatusMessage msg = CLogMessage(this).warning("Loading for another simulator '%1' already in progress. Loading might be slow.") << simulator.toQString(); + const CStatusMessage msg = CLogMessage(this).warning(u"Loading for another simulator '%1' already in progress. Loading might be slow.") << simulator.toQString(); this->showOverlayMessage(msg); } } if (!this->initModelLoader(simulator)) { - const CStatusMessage msg = CLogMessage(this).error("Cannot init model loader for %1") << simulator.toQString(); + const CStatusMessage msg = CLogMessage(this).error(u"Cannot init model loader for %1") << simulator.toQString(); this->showOverlayMessage(msg); return; } // Do not check for empty models die here, as depending on mode we could still load // will be checked in model loader - CLogMessage(this).info("Starting loading for '%1' in mode '%2'") << simulator.toQString() << IAircraftModelLoader::enumToString(mode); + CLogMessage(this).info(u"Starting loading for '%1' in mode '%2'") << simulator.toQString() << IAircraftModelLoader::enumToString(mode); ui->tvp_OwnAircraftModels->showLoadIndicator(); Q_ASSERT_X(sGui && sGui->getWebDataServices(), Q_FUNC_INFO, "missing web data services"); m_modelLoader->startLoading(mode, static_cast(&CDatabaseUtils::consolidateModelsWithDbData), modelDirectories); @@ -547,7 +547,7 @@ namespace BlackGui void CDbOwnModelsComponent::onModelLoaderDiskLoadingStarted(const CSimulatorInfo &simulator, IAircraftModelLoader::LoadMode mode) { - const CStatusMessage msg = CLogMessage(this).info("Started disk loading for '%1' in mode '%2'") << simulator.toQString(true) << IAircraftModelLoader::enumToString(mode); + const CStatusMessage msg = CLogMessage(this).info(u"Started disk loading for '%1' in mode '%2'") << simulator.toQString(true) << IAircraftModelLoader::enumToString(mode); this->showOverlayMessage(msg, 5000); } @@ -563,11 +563,11 @@ namespace BlackGui if (modelsLoaded < 1) { // loading ok, but no data - m = CLogMessage(this).warning("Loading completed for simulator '%1', but no models") << simulator; + m = CLogMessage(this).warning(u"Loading completed for simulator '%1', but no models") << simulator; } else { - m = CLogMessage(this).info("Loading completed for simulator '%1' with %2 models") << simulator << modelsLoaded; + m = CLogMessage(this).info(u"Loading completed for simulator '%1' with %2 models") << simulator << modelsLoaded; } // overlay @@ -579,7 +579,7 @@ namespace BlackGui else { ui->tvp_OwnAircraftModels->clear(); - CLogMessage(this).error("Loading of models failed, simulator '%1'") << simulator.toQString(); + CLogMessage(this).error(u"Loading of models failed, simulator '%1'") << simulator.toQString(); } if (statusMessages.hasWarningOrErrorMessages()) diff --git a/src/blackgui/components/dbownmodelsetcomponent.cpp b/src/blackgui/components/dbownmodelsetcomponent.cpp index 25f065344..919fcc2be 100644 --- a/src/blackgui/components/dbownmodelsetcomponent.cpp +++ b/src/blackgui/components/dbownmodelsetcomponent.cpp @@ -118,7 +118,7 @@ namespace BlackGui const int diff = models.size() - cleanModelList.size(); if (diff > 0) { - const CStatusMessage m = CStatusMessage(this).warning("Removed %1 models from set, because not matching %2") << diff << simulator.toQString(true); + const CStatusMessage m = CStatusMessage(this).warning(u"Removed %1 models from set, because not matching %2") << diff << simulator.toQString(true); this->showMappingComponentOverlayHtmlMessage(m, 5000); } cleanModelList.resetOrder(); @@ -133,7 +133,7 @@ namespace BlackGui const int diff = models.size() - cleanModelList.size(); if (diff > 0) { - const CStatusMessage m = CStatusMessage(this).warning("Removed %1 models from set, because not matching %2") << diff << simulator.toQString(true); + const CStatusMessage m = CStatusMessage(this).warning(u"Removed %1 models from set, because not matching %2") << diff << simulator.toQString(true); this->showMappingComponentOverlayHtmlMessage(m, 5000); } if (cleanModelList.isEmpty()) { return 0; } @@ -350,7 +350,7 @@ namespace BlackGui CDbMappingComponent *mc = this->getMappingComponent(); if (!mc) { - CLogMessage(this).error("No mapping component available!"); + CLogMessage(this).error(u"No mapping component available!"); return; } @@ -373,7 +373,7 @@ namespace BlackGui } else { - const CStatusMessage m = CStatusMessage(this).error("No model data for %1") << simulator.toQString(true); + const CStatusMessage m = CStatusMessage(this).error(u"No model data for %1") << simulator.toQString(true); mc->showOverlayMessage(m); } } diff --git a/src/blackgui/components/dbownmodelsetformdialog.cpp b/src/blackgui/components/dbownmodelsetformdialog.cpp index 9413b8a97..1e8b1eb50 100644 --- a/src/blackgui/components/dbownmodelsetformdialog.cpp +++ b/src/blackgui/components/dbownmodelsetformdialog.cpp @@ -113,7 +113,7 @@ namespace BlackGui const int c = this->getMappingComponent()->getOwnModelsCount(); if (c < 1) { - const CStatusMessage m = CStatusMessage(this).error("No models for '%1'") << m_simulatorInfo.toQString(true); + const CStatusMessage m = CStatusMessage(this).error(u"No models for '%1'") << m_simulatorInfo.toQString(true); ui->form_OwnModelSet->showOverlayMessage(m); return false; } diff --git a/src/blackgui/components/dbreducemodelduplicates.cpp b/src/blackgui/components/dbreducemodelduplicates.cpp index d5de4093a..11ddeb804 100644 --- a/src/blackgui/components/dbreducemodelduplicates.cpp +++ b/src/blackgui/components/dbreducemodelduplicates.cpp @@ -85,14 +85,14 @@ namespace BlackGui if (m_models.isEmpty()) { - const CStatusMessage m = CStatusMessage(this).validationError("No models"); + const CStatusMessage m = CStatusMessage(this).validationError(u"No models"); ui->fr_Overlay->showOverlayHTMLMessage(m, 5000); return; } if (ui->le_Distributor->text().isEmpty()) { - const CStatusMessage m = CStatusMessage(this).validationError("No distributor"); + const CStatusMessage m = CStatusMessage(this).validationError(u"No distributor"); ui->fr_Overlay->showOverlayHTMLMessage(m, 5000); return; } @@ -100,7 +100,7 @@ namespace BlackGui const CAircraftModelList keyDuplicates = m_models.findDuplicateModelStrings(); if (!keyDuplicates.isEmpty()) { - const CStatusMessage m = CStatusMessage(this).validationError("Found %1 key duplicates") << keyDuplicates.size(); + const CStatusMessage m = CStatusMessage(this).validationError(u"Found %1 key duplicates") << keyDuplicates.size(); ui->fr_Overlay->showOverlayHTMLMessage(m, 5000); return; } @@ -109,7 +109,7 @@ namespace BlackGui const CDistributor distributor = distributors.findByKeyOrAlias(ui->le_Distributor->text().trimmed().toUpper()); if (!distributor.hasValidDbKey()) { - const CStatusMessage m = CStatusMessage(this).validationError("Invalid distributor"); + const CStatusMessage m = CStatusMessage(this).validationError(u"Invalid distributor"); ui->fr_Overlay->showOverlayHTMLMessage(m, 5000); return; } @@ -149,8 +149,8 @@ namespace BlackGui const QString distKeys = removeModels.getDistributors().dbKeysAsString(", "); const CStatusMessage msg = removeModels.isEmpty() ? - CStatusMessage(this).info("No duplicates to be removed!") : - CStatusMessage(this).info("You can remove %1 models of the following distributors: '%2'.") << removeModels.size() << distKeys; + CStatusMessage(this).info(u"No duplicates to be removed!") : + CStatusMessage(this).info(u"You can remove %1 models of the following distributors: '%2'.") << removeModels.size() << distKeys; ui->fr_Overlay->showOverlayHTMLMessage(msg, 5000); ui->bb_ReduceModelDuplicates->button(QDialogButtonBox::Ok)->setEnabled(true); } diff --git a/src/blackgui/components/dbstashcomponent.cpp b/src/blackgui/components/dbstashcomponent.cpp index 5bb2668cf..d338b3f89 100644 --- a/src/blackgui/components/dbstashcomponent.cpp +++ b/src/blackgui/components/dbstashcomponent.cpp @@ -452,7 +452,7 @@ namespace BlackGui const bool equal = sGui->getWebDataServices()->isDbModelEqualForPublishing(model, &modelMsgs); if (equal) { - msgs.push_back(CStatusMessage(this).info("Model '%1' has no change values") << model.getModelStringAndDbKey()); + msgs.push_back(CStatusMessage(this).info(u"Model '%1' has no change values") << model.getModelStringAndDbKey()); } else { diff --git a/src/blackgui/components/distributorpreferencescomponent.cpp b/src/blackgui/components/distributorpreferencescomponent.cpp index 13ee5606e..0c9643ded 100644 --- a/src/blackgui/components/distributorpreferencescomponent.cpp +++ b/src/blackgui/components/distributorpreferencescomponent.cpp @@ -82,7 +82,7 @@ namespace BlackGui const CDistributorList distributors(sGui->getWebDataServices()->getDistributors()); if (distributors.isEmpty()) { - const CStatusMessage m = CStatusMessage(this).error("No distributors"); + const CStatusMessage m = CStatusMessage(this).error(u"No distributors"); this->showOverlayMessage(m); return; } @@ -95,7 +95,7 @@ namespace BlackGui const CDistributorList distributors(sGui->getWebDataServices()->getDistributors().matchesSimulator(sim)); if (distributors.isEmpty()) { - const CStatusMessage m = CStatusMessage(this).error("No distributors, or no distributors matching %1") << sim.toQString(); + const CStatusMessage m = CStatusMessage(this).error(u"No distributors, or no distributors matching %1") << sim.toQString(); this->showOverlayMessage(m); return; } @@ -108,14 +108,14 @@ namespace BlackGui const CAircraftModelList models = CCentralMultiSimulatorModelSetCachesProvider::modelCachesInstance().getCachedModels(sim); if (models.isEmpty()) { - const CStatusMessage m = CStatusMessage(this).error("No data in model set %1") << sim.toQString(); + const CStatusMessage m = CStatusMessage(this).error(u"No data in model set %1") << sim.toQString(); this->showOverlayMessage(m); return; } const CDistributorList distributors = models.getDistributors(); if (distributors.isEmpty()) { - const CStatusMessage m = CStatusMessage(this).error("No distributors for model set %1") << sim.toQString(); + const CStatusMessage m = CStatusMessage(this).error(u"No distributors for model set %1") << sim.toQString(); this->showOverlayMessage(m); return; } diff --git a/src/blackgui/components/downloadcomponent.cpp b/src/blackgui/components/downloadcomponent.cpp index 98f613fb2..e11f4fba2 100644 --- a/src/blackgui/components/downloadcomponent.cpp +++ b/src/blackgui/components/downloadcomponent.cpp @@ -90,7 +90,7 @@ namespace BlackGui if (downloadDir.isEmpty()) { return; } // canceled if (!QDir(downloadDir).exists()) { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning("'%1' is not a valid download directory") << downloadDir; + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning(u"'%1' is not a valid download directory") << downloadDir; this->showOverlayMessage(msg, CDownloadComponent::OverlayMsgTimeoutMs); return; } @@ -172,7 +172,7 @@ namespace BlackGui if (!sGui || !sGui->hasWebDataServices() || sGui->isShuttingDown()) { return false; } if (!this->existsDownloadDir()) { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Invalid download directory"); + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Invalid download directory"); this->showOverlayMessage(msg, CDownloadComponent::OverlayMsgTimeoutMs); return false; } @@ -180,7 +180,7 @@ namespace BlackGui const CUrl download = remoteFile.getSmartUrl(); if (download.isEmpty()) { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("No download URL for file name '%1'") << remoteFile.getNameAndSize(); + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"No download URL for file name '%1'") << remoteFile.getNameAndSize(); this->showOverlayMessage(msg, CDownloadComponent::OverlayMsgTimeoutMs); return false; } @@ -193,14 +193,14 @@ namespace BlackGui if (r) { // this->showLoading(10 * 1000); - CLogMessage(this).info("Triggered downloading of file from '%1'") << download.getHost(); + CLogMessage(this).info(u"Triggered downloading of file from '%1'") << download.getHost(); connect(r, &QNetworkReply::downloadProgress, this, &CDownloadComponent::downloadProgress); m_reply = r; success = true; } else { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Starting download for '%1' failed") << download.getFullUrl(); + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Starting download for '%1' failed") << download.getFullUrl(); this->showOverlayMessage(msg, CDownloadComponent::OverlayMsgTimeoutMs); } return success; diff --git a/src/blackgui/components/firstmodelsetcomponent.cpp b/src/blackgui/components/firstmodelsetcomponent.cpp index 16bfd5d52..014e5a0d7 100644 --- a/src/blackgui/components/firstmodelsetcomponent.cpp +++ b/src/blackgui/components/firstmodelsetcomponent.cpp @@ -221,7 +221,7 @@ namespace BlackGui const int modelsCount = this->modelLoader()->getCachedModelsCount(simulator); if (modelsCount < 1) { - static const CStatusMessage msg = CStatusMessage(this).validationError("No models indexed so far. Try 'reload'!"); + static const CStatusMessage msg = CStatusMessage(this).validationError(u"No models indexed so far. Try 'reload'!"); this->showOverlayMessage(msg, 4000); return; } @@ -236,7 +236,7 @@ namespace BlackGui } else { - static const CStatusMessage msg = CStatusMessage(this).validationError("No distributors selected"); + static const CStatusMessage msg = CStatusMessage(this).validationError(u"No distributors selected"); this->showOverlayMessage(msg, 4000); return; } diff --git a/src/blackgui/components/flightplancomponent.cpp b/src/blackgui/components/flightplancomponent.cpp index db63bddd0..a8acd1a47 100644 --- a/src/blackgui/components/flightplancomponent.cpp +++ b/src/blackgui/components/flightplancomponent.cpp @@ -252,7 +252,7 @@ namespace BlackGui const bool strict = ui->cb_StrictCheck->isChecked(); const bool vfr = this->isVfr(); const CStatusMessage::StatusSeverity severity = strict ? CStatusMessage::SeverityError : CStatusMessage::SeverityWarning; - messages.push_back(CStatusMessage(this).validationInfo(strict ? "Strict validation" : "Lenient validation")); + messages.push_back(CStatusMessage(this).validationInfo(strict ? QStringLiteral("Strict validation") : QStringLiteral("Lenient validation"))); const CFlightPlan::FlightRules rule = ui->cb_FlightRule->currentText().startsWith("I") ? CFlightPlan::IFR : CFlightPlan::VFR; flightPlan.setFlightRule(rule); @@ -262,11 +262,11 @@ namespace BlackGui v = ui->le_Callsign->text().trimmed().toUpper(); if (v.isEmpty()) { - // messages.push_back(CStatusMessage(this).validationError("Missing '%1'") << ui->lbl_Callsign->text()); + // messages.push_back(CStatusMessage(this).validationError(u"Missing '%1'") << ui->lbl_Callsign->text()); } else if (!CCallsign::isValidAircraftCallsign(v)) { - messages.push_back(CStatusMessage(this).validationError("Invalid callsign '%1'") << v); + messages.push_back(CStatusMessage(this).validationError(u"Invalid callsign '%1'") << v); } flightPlan.setCallsign(CCallsign(v)); @@ -274,15 +274,15 @@ namespace BlackGui v = ui->le_AircraftType->text().trimmed().toUpper(); if (v.isEmpty()) { - messages.push_back(CStatusMessage(this).validationError("Missing '%1'") << ui->lbl_AircraftType->text()); + messages.push_back(CStatusMessage(this).validationError(u"Missing '%1'") << ui->lbl_AircraftType->text()); } else if (!CAircraftIcaoCode::isValidDesignator(v)) { - messages.push_back(CStatusMessage(this).validationError("Invalid aircraft ICAO code '%1'") << v); + messages.push_back(CStatusMessage(this).validationError(u"Invalid aircraft ICAO code '%1'") << v); } else if (sApp && sApp->hasWebDataServices() && sApp->getWebDataServices()->hasDbAircraftData() && !sApp->getWebDataServices()->containsAircraftIcaoDesignator(v)) { - messages.push_back(CStatusMessage(this).validationWarning("Are you sure '%1' is a valid type?") << v); + messages.push_back(CStatusMessage(this).validationWarning(u"Are you sure '%1' is a valid type?") << v); } flightPlan.setAircraftIcao(this->getAircraftIcaoCode()); @@ -290,14 +290,14 @@ namespace BlackGui v = this->getPrefix(); if (!v.isEmpty() && !CFlightPlan::prefixCodes().contains(v)) { - messages.push_back(CStatusMessage(this).validation(severity, "Invalid prefix")); + messages.push_back(CStatusMessage(this).validation(severity, u"Invalid prefix")); } flightPlan.setPrefix(v); v = this->getEquipmentSuffix(); if (!v.isEmpty() && !CFlightPlan::equipmentCodes().contains(v)) { - messages.push_back(CStatusMessage(this).validation(severity, "Invalid equipment code")); + messages.push_back(CStatusMessage(this).validation(severity, u"Invalid equipment code")); } flightPlan.setEquipmentSuffix(v); @@ -308,11 +308,11 @@ namespace BlackGui messages.push_back(CStatusMessage(this).validation( vfr ? CStatusMessage::SeverityInfo : - CStatusMessage::SeverityWarning, "Missing '%1'") << ui->lbl_Route->text()); + CStatusMessage::SeverityWarning, u"Missing '%1'") << ui->lbl_Route->text()); } else if (v.length() > CFlightPlan::MaxRouteLength) { - messages.push_back(CStatusMessage(this).validationError("Flight plan route length exceeded (%1 chars max.)") << CFlightPlan::MaxRouteLength); + messages.push_back(CStatusMessage(this).validationError(u"Flight plan route length exceeded (%1 chars max.)") << CFlightPlan::MaxRouteLength); } else { @@ -323,11 +323,11 @@ namespace BlackGui v = ui->pte_Remarks->toPlainText().trimmed(); if (v.isEmpty()) { - messages.push_back(CStatusMessage(this).validationError("No '%1', voice capabilities are mandatory") << ui->lbl_Remarks->text()); + messages.push_back(CStatusMessage(this).validationError(u"No '%1', voice capabilities are mandatory") << ui->lbl_Remarks->text()); } else if (v.length() > CFlightPlan::MaxRemarksLength) { - messages.push_back(CStatusMessage(this).validationError("Flight plan remarks length exceeded (%1 chars max.)") << CFlightPlan::MaxRemarksLength); + messages.push_back(CStatusMessage(this).validationError(u"Flight plan remarks length exceeded (%1 chars max.)") << CFlightPlan::MaxRemarksLength); } else { @@ -338,7 +338,7 @@ namespace BlackGui v = ui->le_EstimatedTimeEnroute->text(); if (v.isEmpty() || v == defaultTime()) { - messages.push_back(CStatusMessage(this).validation(severity, "Missing '%1'") << ui->lbl_EstimatedTimeEnroute->text()); + messages.push_back(CStatusMessage(this).validation(severity, u"Missing '%1'") << ui->lbl_EstimatedTimeEnroute->text()); } flightPlan.setEnrouteTime(v); @@ -346,7 +346,7 @@ namespace BlackGui v = ui->le_FuelOnBoard->text(); if (v.isEmpty() || v == defaultTime()) { - messages.push_back(CStatusMessage(this).validation(severity, "Missing '%1'") << ui->lbl_FuelOnBoard->text()); + messages.push_back(CStatusMessage(this).validation(severity, u"Missing '%1'") << ui->lbl_FuelOnBoard->text()); } flightPlan.setFuelTime(v); @@ -354,7 +354,7 @@ namespace BlackGui v = ui->le_TakeOffTimePlanned->text(); if (v.isEmpty() || v == defaultTime()) { - messages.push_back(CStatusMessage(this).validation(severity, "Missing '%1'") << ui->lbl_TakeOffTimePlanned->text()); + messages.push_back(CStatusMessage(this).validation(severity, u"Missing '%1'") << ui->lbl_TakeOffTimePlanned->text()); } flightPlan.setTakeoffTimePlanned(v); @@ -369,7 +369,7 @@ namespace BlackGui v = ui->le_DestinationAirport->text(); if (v.isEmpty() || v.endsWith(defaultIcao(), Qt::CaseInsensitive)) { - messages.push_back(CStatusMessage(this).validationError("Missing '%1'") << ui->lbl_DestinationAirport->text()); + messages.push_back(CStatusMessage(this).validationError(u"Missing '%1'") << ui->lbl_DestinationAirport->text()); flightPlan.setDestinationAirportIcao(QString()); } else @@ -381,7 +381,7 @@ namespace BlackGui v = ui->le_OriginAirport->text(); if (v.isEmpty() || v.endsWith(defaultIcao(), Qt::CaseInsensitive)) { - messages.push_back(CStatusMessage(this).validationError("Missing '%1'") << ui->lbl_OriginAirport->text()); + messages.push_back(CStatusMessage(this).validationError(u"Missing '%1'") << ui->lbl_OriginAirport->text()); flightPlan.setOriginAirportIcao(defaultIcao()); } else @@ -395,7 +395,7 @@ namespace BlackGui cruiseTAS.parseFromString(v, CPqString::SeparatorBestGuess); if (cruiseTAS.isNull()) { - messages.push_back(CStatusMessage(this).validationError("Wrong TAS, %1") << ui->lbl_CruiseTrueAirspeed->text()); + messages.push_back(CStatusMessage(this).validationError(u"Wrong TAS, %1") << ui->lbl_CruiseTrueAirspeed->text()); flightPlan.setDestinationAirportIcao(defaultIcao()); } else @@ -409,7 +409,7 @@ namespace BlackGui { if (!messages.hasWarningOrErrorMessages()) { - messages.push_back(CStatusMessage(this).validationInfo("Missing %1") << ui->lbl_AlternateAirport->text()); + messages.push_back(CStatusMessage(this).validationInfo(u"Missing %1") << ui->lbl_AlternateAirport->text()); } flightPlan.setAlternateAirportIcao(QString()); } @@ -421,7 +421,7 @@ namespace BlackGui // OK if (!messages.isFailure()) { - messages.push_back(CStatusMessage(this).validationInfo("Flight plan validation passed")); + messages.push_back(CStatusMessage(this).validationInfo(u"Flight plan validation passed")); } return messages; } @@ -440,12 +440,12 @@ namespace BlackGui flightPlan.setWhenLastSentOrLoaded(QDateTime::currentDateTimeUtc()); sGui->getIContextNetwork()->sendFlightPlan(flightPlan); lastSent = flightPlan.whenLastSentOrLoaded().toString(); - m = CStatusMessage(this).validationInfo("Sent flight plan"); + m = CStatusMessage(this).validationInfo(u"Sent flight plan"); } else { flightPlan.setWhenLastSentOrLoaded(QDateTime()); // empty - m = CStatusMessage(this).validationError("No errors, but not connected, cannot send flight plan"); + m = CStatusMessage(this).validationError(u"No errors, but not connected, cannot send flight plan"); } ui->le_LastSent->setText(lastSent); this->showOverlayMessage(m, OverlayMessageMs); @@ -544,7 +544,7 @@ namespace BlackGui { if (!sGui || sGui->isShuttingDown() || !sGui->getIContextNetwork() || !sGui->getIContextNetwork()->isConnected()) { - const CStatusMessage m = CLogMessage(this).validationWarning("Cannot load network flight plan, network not connected"); + const CStatusMessage m = CLogMessage(this).validationWarning(u"Cannot load network flight plan, network not connected"); this->showOverlayHTMLMessage(m, OverlayTimeoutMs); return; } @@ -556,11 +556,11 @@ namespace BlackGui const QMessageBox::StandardButton r = QMessageBox::warning(this, "Loaded FP", "Override current flight plan data?", QMessageBox::Yes | QMessageBox::No); if (r != QMessageBox::Yes) { return; } this->fillWithFlightPlanData(loadedPlan); - CLogMessage(this).info("Updated with loaded flight plan"); + CLogMessage(this).info(u"Updated with loaded flight plan"); } else { - const CStatusMessage m = CLogMessage(this).warning("No flight plan data in loaded plan"); + const CStatusMessage m = CLogMessage(this).warning(u"No flight plan data in loaded plan"); this->showOverlayHTMLMessage(m, OverlayTimeoutMs); } } @@ -620,7 +620,7 @@ namespace BlackGui const QString generated = ui->pte_RemarksGenerated->toPlainText().trimmed(); if (confirm && !this->overrideRemarks()) { return; } ui->pte_Remarks->setPlainText(generated); - CLogMessage(this).info("Copied remarks"); + CLogMessage(this).info(u"Copied remarks"); } void CFlightPlanComponent::currentTabGenerator() @@ -752,11 +752,11 @@ namespace BlackGui if (vfr) { ui->cb_NoSidsStarts->setChecked(true); - msgs.push_back(CStatusMessage(this).validationInfo("No SID/STARs")); + msgs.push_back(CStatusMessage(this).validationInfo(u"No SID/STARs")); ui->cb_RequiredNavigationPerformance->setCurrentIndex(0); ui->cb_PerformanceCategory->setCurrentIndex(0); ui->cb_NavigationEquipment->setCurrentIndex(0); - msgs.push_back(CStatusMessage(this).validationInfo("Set navigation and performance to VFR")); + msgs.push_back(CStatusMessage(this).validationInfo(u"Set navigation and performance to VFR")); } else { @@ -767,11 +767,11 @@ namespace BlackGui if (icao.getEnginesCount() >= 2 && icao.getEngineType() == "J") { // jet with >=2 engines - msgs.push_back(CStatusMessage(this).validationInfo("Jet >=2 engines")); - msgs.push_back(CStatusMessage(this).validationInfo("SID/STARs")); + msgs.push_back(CStatusMessage(this).validationInfo(u"Jet >=2 engines")); + msgs.push_back(CStatusMessage(this).validationInfo(u"SID/STARs")); ui->cb_NoSidsStarts->setChecked(false); ui->cb_NavigationEquipment->setCurrentText("GPS or FMC capable of SIDs/STARs"); - msgs.push_back(CStatusMessage(this).validationInfo("GPS or FMC capable of SIDs/STARs")); + msgs.push_back(CStatusMessage(this).validationInfo(u"GPS or FMC capable of SIDs/STARs")); // reset those values ui->cb_RequiredNavigationPerformance->setCurrentIndex(0); diff --git a/src/blackgui/components/hotkeydialog.cpp b/src/blackgui/components/hotkeydialog.cpp index 977d19635..4eb2868be 100644 --- a/src/blackgui/components/hotkeydialog.cpp +++ b/src/blackgui/components/hotkeydialog.cpp @@ -205,19 +205,19 @@ namespace BlackGui { if (m_actionHotkey.getApplicableMachine().getMachineName().isEmpty()) { - CLogMessage().validationWarning("Missing hotkey '%1'") << ui->gb_Machine->title(); + CLogMessage().validationWarning(u"Missing hotkey '%1'") << ui->gb_Machine->title(); return; } if (m_actionHotkey.getCombination().isEmpty()) { - CLogMessage().validationWarning("Missing hotkey '%1'") << ui->gb_Hotkey->title(); + CLogMessage().validationWarning(u"Missing hotkey '%1'") << ui->gb_Hotkey->title(); return; } if (m_actionHotkey.getAction().isEmpty()) { - CLogMessage().validationWarning("Missing hotkey '%1'") << ui->gb_Action->title(); + CLogMessage().validationWarning(u"Missing hotkey '%1'") << ui->gb_Action->title(); return; } diff --git a/src/blackgui/components/installxswiftbuscomponent.cpp b/src/blackgui/components/installxswiftbuscomponent.cpp index 11c836de4..74def1675 100644 --- a/src/blackgui/components/installxswiftbuscomponent.cpp +++ b/src/blackgui/components/installxswiftbuscomponent.cpp @@ -74,7 +74,7 @@ namespace BlackGui if (xPlanePluginDir.isEmpty()) { return; } // canceled if (!QDir(xPlanePluginDir).exists()) { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning("'%1' is not a valid X-Plane plugin directory") << xPlanePluginDir; + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning(u"'%1' is not a valid X-Plane plugin directory") << xPlanePluginDir; this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs); return; } @@ -90,7 +90,7 @@ namespace BlackGui if (downloadDir.isEmpty()) { return; } // canceled if (!QDir(downloadDir).exists()) { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning("'%1' is not a valid download directory") << downloadDir; + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning(u"'%1' is not a valid download directory") << downloadDir; this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs); return; } @@ -104,7 +104,7 @@ namespace BlackGui QFile downloadFile(downloadFileName); if (!downloadFile.exists()) { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Cannot read downloaded file '%1'") << downloadFileName; + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Cannot read downloaded file '%1'") << downloadFileName; this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs); return; } @@ -112,7 +112,7 @@ namespace BlackGui const QString xSwiftBusDirectory = this->xSwiftBusDir(); if (xSwiftBusDirectory.isEmpty()) { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("No directory to install to'"); + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"No directory to install to'"); this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs); return; } @@ -120,7 +120,7 @@ namespace BlackGui const QDir installDir(xSwiftBusDirectory); if (!installDir.exists()) { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Directory '%1' does not exist") << xSwiftBusDirectory; + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Directory '%1' does not exist") << xSwiftBusDirectory; this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs); return; } @@ -133,7 +133,7 @@ namespace BlackGui const bool removed = destFile.remove(); if (!removed) { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Cannot remove '%1'") << destFileName; + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Cannot remove '%1'") << destFileName; this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs); return; } @@ -143,7 +143,7 @@ namespace BlackGui const bool copied = QFile::copy(downloadFileName, destFileName); if (!copied) { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Cannot copy '%1' to '%2'") << downloadFileName << destFileName; + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Cannot copy '%1' to '%2'") << downloadFileName << destFileName; this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs); return; } @@ -152,7 +152,7 @@ namespace BlackGui const QFileInfo destFile(destFileName); if (!destFile.exists()) { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("XSwiftBus file '%1' does not exist") << destFileName; + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"XSwiftBus file '%1' does not exist") << destFileName; this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs); return; } @@ -162,7 +162,7 @@ namespace BlackGui if (CCompressUtils::zip7Uncompress(destFile.absoluteFilePath(), xSwiftBusDirectory, &stdOutAndError)) { // capture values by copy! - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).info("Uncompressed xSwiftBus in '%1'") << xSwiftBusDirectory; + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).info(u"Uncompressed xSwiftBus in '%1'") << xSwiftBusDirectory; this->showOverlayMessagesWithConfirmation(msg, false, "Delete downloaded file?", [ = ] { QFile downloadFile(downloadFileName); @@ -174,7 +174,7 @@ namespace BlackGui } else { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning("Unzip failed: stdout '%1' stderr '%2'") << safeAt(stdOutAndError, 0) << safeAt(stdOutAndError, 1); + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning(u"Unzip failed: stdout '%1' stderr '%2'") << safeAt(stdOutAndError, 0) << safeAt(stdOutAndError, 1); this->showOverlayMessage(msg); } @@ -195,7 +195,7 @@ namespace BlackGui if (!sGui || !sGui->hasWebDataServices() || sGui->isShuttingDown()) { return; } if (!this->existsDownloadDir()) { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Invalid download directory"); + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Invalid download directory"); this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs); return; } @@ -204,7 +204,7 @@ namespace BlackGui const CUrl download = rf.getSmartUrl(); if (download.isEmpty()) { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("No download URL for file name '%1'") << rf.getNameAndSize(); + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"No download URL for file name '%1'") << rf.getNameAndSize(); this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs); return; } @@ -220,7 +220,7 @@ namespace BlackGui if (reply == QMessageBox::Cancel) { return; } if (reply == QMessageBox::Yes) { - const CStatusMessage msg = CStatusMessage(this).info("Using existing file '%1'") << saveAsFile; + const CStatusMessage msg = CStatusMessage(this).info(u"Using existing file '%1'") << saveAsFile; const QPointer guard(this); QTimer::singleShot(100, this, [ = ] { @@ -234,12 +234,12 @@ namespace BlackGui const QNetworkReply *r = sGui->downloadFromNetwork(download, saveAsFile, { this, &CInstallXSwiftBusComponent::downloadedXSwiftBusFile}); if (r) { - CLogMessage(this).info("Triggered downloading of XSwiftBus file from '%1'") << download.getHost(); + CLogMessage(this).info(u"Triggered downloading of XSwiftBus file from '%1'") << download.getHost(); this->showLoading(120 * 1000); // timeout in any case } else { - const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Starting download for '%1' failed") << download.getFullUrl(); + const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Starting download for '%1' failed") << download.getFullUrl(); this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs); } } @@ -255,7 +255,7 @@ namespace BlackGui } if (!this->existsXSwiftBusPluginDir()) { - const CStatusMessage msg = CStatusMessage(this).warning("No valid install directory, cannot continue."); + const CStatusMessage msg = CStatusMessage(this).warning(u"No valid install directory, cannot continue."); this->showOverlayMessage(msg); return; } diff --git a/src/blackgui/components/internalscomponent.cpp b/src/blackgui/components/internalscomponent.cpp index 60108acd7..a84825c72 100644 --- a/src/blackgui/components/internalscomponent.cpp +++ b/src/blackgui/components/internalscomponent.cpp @@ -106,20 +106,20 @@ namespace BlackGui Q_ASSERT(sGui->getIContextNetwork()); if (!sGui->getIContextNetwork()->isConnected()) { - CLogMessage(this).validationError("Cannot send aircraft parts, network not connected"); + CLogMessage(this).validationError(u"Cannot send aircraft parts, network not connected"); return; } const CCallsign callsign(ui->comp_RemoteAircraftSelector->getSelectedCallsign()); if (callsign.isEmpty()) { - CLogMessage(this).validationError("No valid callsign selected"); + CLogMessage(this).validationError(u"No valid callsign selected"); return; } CClient client = sGui->getIContextNetwork()->getClientsForCallsigns(callsign).frontOrDefault(); if (client.getCallsign().isEmpty() || client.getCallsign() != callsign) { - CLogMessage(this).validationError("No valid client for '%1'") << callsign.asString(); + CLogMessage(this).validationError(u"No valid client for '%1'") << callsign.asString(); return; } @@ -140,7 +140,7 @@ namespace BlackGui ui->tb_History->setToolTip(""); const bool incremental = ui->cb_AircraftPartsIncremental->isChecked(); sGui->getIContextNetwork()->testAddAircraftParts(callsign, parts, incremental); - CLogMessage(this).info("Added parts for %1") << callsign.toQString(); + CLogMessage(this).info(u"Added parts for %1") << callsign.toQString(); } void CInternalsComponent::setCurrentParts() @@ -152,7 +152,7 @@ namespace BlackGui const CAircraftPartsList partsList = sGui->getIContextNetwork()->getRemoteAircraftParts(callsign); if (partsList.isEmpty()) { - CStatusMessage(this).info("No parts for '%1'") << callsign.asString(); + CStatusMessage(this).info(u"No parts for '%1'") << callsign.asString(); return; } const CAircraftParts parts = partsList.latestObject(); @@ -261,12 +261,12 @@ namespace BlackGui const CCallsign callsign(ui->comp_RemoteAircraftSelector->getSelectedCallsign()); if (callsign.isEmpty()) { - CLogMessage(this).validationError("No valid callsign selected"); + CLogMessage(this).validationError(u"No valid callsign selected"); return; } ui->pb_RequestFromNetwork->setEnabled(false); sGui->getIContextNetwork()->testRequestAircraftConfig(callsign); - CLogMessage(this).info("Request aircraft config for '%1'") << callsign.asString(); + CLogMessage(this).info(u"Request aircraft config for '%1'") << callsign.asString(); // simple approach to update UI when parts are received const QPointer myself(this); @@ -290,7 +290,7 @@ namespace BlackGui const CCallsign callsign(ui->comp_RemoteAircraftSelector->getSelectedCallsign()); if (callsign.isEmpty()) { - CLogMessage(this).validationError("No valid callsign selected"); + CLogMessage(this).validationError(u"No valid callsign selected"); return; } diff --git a/src/blackgui/components/interpolationlogdisplay.cpp b/src/blackgui/components/interpolationlogdisplay.cpp index 6d646aed1..b2c9874f6 100644 --- a/src/blackgui/components/interpolationlogdisplay.cpp +++ b/src/blackgui/components/interpolationlogdisplay.cpp @@ -400,7 +400,7 @@ namespace BlackGui if (!sApp || sApp->isShuttingDown()) { break; } // stop and return if (m_callsign.isEmpty()) { - // static const CStatusMessage ms = CStatusMessage(this).validationError("No callsign for logging"); + // static const CStatusMessage ms = CStatusMessage(this).validationError(u"No callsign for logging"); // m = ms; break; } @@ -408,14 +408,14 @@ namespace BlackGui const bool canUpdateLog = m_airspaceMonitor && m_simulator && m_simulator->isConnected() && !m_simulator->isShuttingDown(); if (!canUpdateLog) { - static const CStatusMessage ms = CStatusMessage(this).validationError("No airspace monitor or simulator or shutting down"); + static const CStatusMessage ms = CStatusMessage(this).validationError(u"No airspace monitor or simulator or shutting down"); m = ms; break; } if (!m_simulator->isLogCallsign(m_callsign)) { - static const CStatusMessage ms = CStatusMessage(this).validationError("No longer logging callsign"); + static const CStatusMessage ms = CStatusMessage(this).validationError(u"No longer logging callsign"); m = ms; break; } diff --git a/src/blackgui/components/interpolationsetupcomponent.cpp b/src/blackgui/components/interpolationsetupcomponent.cpp index 350da1848..d9014011d 100644 --- a/src/blackgui/components/interpolationsetupcomponent.cpp +++ b/src/blackgui/components/interpolationsetupcomponent.cpp @@ -137,7 +137,7 @@ namespace BlackGui gs.setBaseValues(setup); gs.setLogInterpolation(false); // that would globally log all values sGui->getIContextSimulator()->setInterpolationAndRenderingSetupGlobal(gs); - CLogMessage(this).info("Set global setup: '%1'") << gs.toQString(true); + CLogMessage(this).info(u"Set global setup: '%1'") << gs.toQString(true); const QPointer myself(this); QTimer::singleShot(250, this, [ = ] @@ -154,7 +154,7 @@ namespace BlackGui const bool ignoreGlobal = ui->cb_IgnoreGlobal->isChecked(); if (ignoreGlobal && setup.isEqualToGlobal(gs)) { - static const CStatusMessage m = CStatusMessage(this).validationWarning("Same as global setup"); + static const CStatusMessage m = CStatusMessage(this).validationWarning(u"Same as global setup"); this->showOverlayMessage(m); return; } @@ -222,7 +222,7 @@ namespace BlackGui { if (showOverlay) { - const CStatusMessage m = CStatusMessage(this).validationError("No context"); + const CStatusMessage m = CStatusMessage(this).validationError(u"No context"); this->showOverlayMessage(m); } return false; @@ -231,7 +231,7 @@ namespace BlackGui { if (showOverlay) { - const CStatusMessage m = CStatusMessage(this).validationError("No simulator available"); + const CStatusMessage m = CStatusMessage(this).validationError(u"No simulator available"); this->showOverlayMessage(m); } return false; diff --git a/src/blackgui/components/legalinfocomponent.cpp b/src/blackgui/components/legalinfocomponent.cpp index 45562c74d..67128a002 100644 --- a/src/blackgui/components/legalinfocomponent.cpp +++ b/src/blackgui/components/legalinfocomponent.cpp @@ -62,7 +62,7 @@ namespace BlackGui bool CLegalInfoComponent::validateAgreement() { if (this->isAgreedTo()) { return true; } - static const CStatusMessage m = CStatusMessage(this).validationError("You need to agree with the swift license"); + static const CStatusMessage m = CStatusMessage(this).validationError(u"You need to agree with the swift license"); this->showOverlayMessage(m); return false; } @@ -77,7 +77,7 @@ namespace BlackGui void CLegalInfoComponent::showCrashDumpHint() { if (ui->cb_CrashDumps->isChecked()) { return; } - const CStatusMessage m = CStatusMessage(this).info("We recommend to enable crash dump uploads"); + const CStatusMessage m = CStatusMessage(this).info(u"We recommend to enable crash dump uploads"); this->showOverlayHTMLMessage(m, 7500); } diff --git a/src/blackgui/components/logincomponent.cpp b/src/blackgui/components/logincomponent.cpp index a667f7c25..249479687 100644 --- a/src/blackgui/components/logincomponent.cpp +++ b/src/blackgui/components/logincomponent.cpp @@ -253,14 +253,14 @@ namespace BlackGui { if (!this->validateAircraftValues()) { - this->showOverlayHTMLMessage(CStatusMessage(this).validationWarning("Invalid aircraft data, login not possible"), OverlayMessageMs); + this->showOverlayHTMLMessage(CStatusMessage(this).validationWarning(u"Invalid aircraft data, login not possible"), OverlayMessageMs); return; } const CStatusMessageList pilotMsgs = ui->form_Pilot->validate(); if (pilotMsgs.isFailure()) { - this->showOverlayHTMLMessage(CStatusMessage(this).validationWarning("Invalid pilot data, login not possible"), OverlayMessageMs); + this->showOverlayHTMLMessage(CStatusMessage(this).validationWarning(u"Invalid pilot data, login not possible"), OverlayMessageMs); return; } @@ -272,8 +272,8 @@ namespace BlackGui const INetwork::LoginMode mode = ui->frp_LoginMode->getLoginMode(); switch (mode) { - case INetwork::LoginStealth: CLogMessage(this).info("login in stealth mode"); break; - case INetwork::LoginAsObserver: CLogMessage(this).info("login in observer mode"); break; + case INetwork::LoginStealth: CLogMessage(this).info(u"login in stealth mode"); break; + case INetwork::LoginAsObserver: CLogMessage(this).info(u"login in observer mode"); break; default: break; // INetwork::LoginNormal } @@ -685,8 +685,8 @@ namespace BlackGui const QString modelStr(model.hasModelString() ? model.getModelString() : ""); if (!model.hasModelString()) { - CLogMessage(this).validationInfo("Invalid lookup for '%1' successful: %2") << modelStr << model.toQString(); - CLogMessage(this).validationInfo("Hint: Are you using the emulated driver? Set a model if so!"); + CLogMessage(this).validationInfo(u"Invalid lookup for '%1' successful: %2") << modelStr << model.toQString(); + CLogMessage(this).validationInfo(u"Hint: Are you using the emulated driver? Set a model if so!"); return; } this->setOwnModelAndIcaoValues(); diff --git a/src/blackgui/components/mappingcomponent.cpp b/src/blackgui/components/mappingcomponent.cpp index c3ba56e68..92b163dbc 100644 --- a/src/blackgui/components/mappingcomponent.cpp +++ b/src/blackgui/components/mappingcomponent.cpp @@ -204,7 +204,7 @@ namespace BlackGui } else { - CLogMessage(this).info("Model set loaded ('%1'), you can update the model view") << simulator.toQString(true); + CLogMessage(this).info(u"Model set loaded ('%1'), you can update the model view") << simulator.toQString(true); } } @@ -231,7 +231,7 @@ namespace BlackGui if (!saFromBackend.hasValidCallsign()) { return; } // obviously deleted const bool nowEnabled = sa.isEnabled(); if (saFromBackend.isEnabled() == nowEnabled) { return; } // already same value - CLogMessage(this).info("Request to %1 aircraft '%2'") << (nowEnabled ? "enable" : "disable") << saFromBackend.getCallsign().toQString(); + CLogMessage(this).info(u"Request to %1 aircraft '%2'") << (nowEnabled ? "enable" : "disable") << saFromBackend.getCallsign().toQString(); sGui->getIContextNetwork()->updateAircraftEnabled(saFromBackend.getCallsign(), nowEnabled); } @@ -272,7 +272,7 @@ namespace BlackGui const QString cs = ui->le_Callsign->text().trimmed(); if (!CCallsign::isValidAircraftCallsign(cs)) { - this->showOverlayMessage(CStatusMessage(this).validationError("Invalid callsign for mapping"), OverlayMessageMs); + this->showOverlayMessage(CStatusMessage(this).validationError(u"Invalid callsign for mapping"), OverlayMessageMs); return CCallsign(); } @@ -280,7 +280,7 @@ namespace BlackGui const bool hasCallsign = ui->tvp_RenderedAircraft->container().containsCallsign(callsign); if (!hasCallsign) { - const CStatusMessage msg = CStatusMessage(this).validationError("Unmapped callsign '%1' for mapping") << callsign.asString(); + const CStatusMessage msg = CStatusMessage(this).validationError(u"Unmapped callsign '%1' for mapping") << callsign.asString(); this->showOverlayMessage(msg); return CCallsign(); } @@ -316,7 +316,7 @@ namespace BlackGui { if (!sGui || !sGui->getIContextSimulator() || !sGui->getISimulator() || !sGui->getISimulator()->isConnected()) { return; } const int reMatchedNo = sGui->getIContextSimulator()->doMatchingsAgain(); - CLogMessage(this).info("Triggered re-apping of %1 aircraft") << reMatchedNo; + CLogMessage(this).info(u"Triggered re-apping of %1 aircraft") << reMatchedNo; } void CMappingComponent::onSaveAircraft() @@ -327,7 +327,7 @@ namespace BlackGui const QString modelString = ui->completer_ModelStrings->getModelString(); if (modelString.isEmpty()) { - this->showOverlayMessage(CStatusMessage(this).validationError("Missing model for mapping"), OverlayMessageMs); + this->showOverlayMessage(CStatusMessage(this).validationError(u"Missing model for mapping"), OverlayMessageMs); return; } @@ -340,7 +340,7 @@ namespace BlackGui if (!hasModel) { - this->showOverlayMessage(CStatusMessage(this).validationError("Invalid model for mapping, reloading model set"), OverlayMessageMs); + this->showOverlayMessage(CStatusMessage(this).validationError(u"Invalid model for mapping, reloading model set"), OverlayMessageMs); if (ui->tvp_AircraftModels->isEmpty()) { this->onModelsUpdateRequested(); @@ -358,7 +358,7 @@ namespace BlackGui const CAircraftModelList models = sGui->getIContextSimulator()->getModelSetModelsStartingWith(modelString); if (models.isEmpty()) { - const CStatusMessage msg = CStatusMessage(this).validationError("No model for title: '%1'") << modelString; + const CStatusMessage msg = CStatusMessage(this).validationError(u"No model for title: '%1'") << modelString; this->showOverlayMessage(msg, OverlayMessageMs); return; } @@ -372,12 +372,12 @@ namespace BlackGui } else { - const CStatusMessage msg = CStatusMessage(this).validationInfo("Ambigious title: '%1', using '%2'") << modelString << model.getModelString(); + const CStatusMessage msg = CStatusMessage(this).validationInfo(u"Ambigious title: '%1', using '%2'") << modelString << model.getModelString(); this->showOverlayMessage(msg, OverlayMessageMs); } } model.setModelType(CAircraftModel::TypeManuallySet); - CLogMessage(this).info("Requesting changes for '%1'") << callsign.asString(); + CLogMessage(this).info(u"Requesting changes for '%1'") << callsign.asString(); changed = sGui->getIContextNetwork()->updateAircraftModel(aircraftFromBackend.getCallsign(), model, identifier()); } if (aircraftFromBackend.isEnabled() != enabled) @@ -387,7 +387,7 @@ namespace BlackGui if (!changed) { - this->showOverlayMessage(CLogMessage(this).info("Model mapping, nothing to change"), OverlayMessageMs); + this->showOverlayMessage(CLogMessage(this).info(u"Model mapping, nothing to change"), OverlayMessageMs); } } @@ -398,8 +398,8 @@ namespace BlackGui if (callsign.isEmpty()) { return; } const bool reset = sGui->getIContextSimulator()->resetToModelMatchingAircraft(callsign); const CStatusMessage msg = reset ? - CStatusMessage(this).info("Model reset for '%1'") << callsign.toQString() : - CStatusMessage(this).info("Reset failed for '%1'") << callsign.toQString(); + CStatusMessage(this).info(u"Model reset for '%1'") << callsign.toQString() : + CStatusMessage(this).info(u"Reset failed for '%1'") << callsign.toQString(); this->showOverlayMessage(msg, 3000); } diff --git a/src/blackgui/components/settingsfontcomponent.cpp b/src/blackgui/components/settingsfontcomponent.cpp index 4bff4d6e1..c22662abf 100644 --- a/src/blackgui/components/settingsfontcomponent.cpp +++ b/src/blackgui/components/settingsfontcomponent.cpp @@ -98,11 +98,11 @@ namespace BlackGui const bool ok = sGui->updateFont(m_qss); if (ok) { - CLogMessage(this).info("Updated font style"); + CLogMessage(this).info(u"Updated font style"); } else { - CLogMessage(this).warning("Updating style failed"); + CLogMessage(this).warning(u"Updating style failed"); } } emit this->accept(); diff --git a/src/blackgui/components/settingsguicomponent.cpp b/src/blackgui/components/settingsguicomponent.cpp index 06e60b82e..dc6a3235e 100644 --- a/src/blackgui/components/settingsguicomponent.cpp +++ b/src/blackgui/components/settingsguicomponent.cpp @@ -113,7 +113,7 @@ namespace BlackGui if (sGui->getIContextNetwork() && sGui->getIContextNetwork()->isConnected()) { // Style changes freeze the GUI, must not be done in flight mode - CLogMessage(this).validationError("Cannot change style while connected to network"); + CLogMessage(this).validationError(u"Cannot change style while connected to network"); ui->cb_SettingsGuiWidgetStyle->setCurrentText(settings.getWidgetStyle()); return; } diff --git a/src/blackgui/components/settingsmatchingcomponent.cpp b/src/blackgui/components/settingsmatchingcomponent.cpp index 9fb83f0f8..a9c3fe874 100644 --- a/src/blackgui/components/settingsmatchingcomponent.cpp +++ b/src/blackgui/components/settingsmatchingcomponent.cpp @@ -83,7 +83,7 @@ namespace BlackGui { if (!sGui || !sGui->getISimulator() || !sGui->getISimulator()->isConnected()) { return; } const int reMatchedNo = sGui->getIContextSimulator()->doMatchingsAgain(); - CLogMessage(this).info("Triggered re-apping of %1 aircraft") << reMatchedNo; + CLogMessage(this).info(u"Triggered re-apping of %1 aircraft") << reMatchedNo; } void CSettingsMatchingComponent::onSetupChanged() diff --git a/src/blackgui/components/settingssimulatorbasicscomponent.cpp b/src/blackgui/components/settingssimulatorbasicscomponent.cpp index 28e2cd6c1..f83377893 100644 --- a/src/blackgui/components/settingssimulatorbasicscomponent.cpp +++ b/src/blackgui/components/settingssimulatorbasicscomponent.cpp @@ -198,7 +198,7 @@ namespace BlackGui ui->pte_ExcludeDirectories->clear(); this->displayDefaultValuesAsPlaceholder(simulator); - CLogMessage(this).info("Reset values for settings of %1") << simulator.toQString(true); + CLogMessage(this).info(u"Reset values for settings of %1") << simulator.toQString(true); } void CSettingsSimulatorBasicsComponent::onSimulatorChanged() diff --git a/src/blackgui/components/settingssimulatorcomponent.cpp b/src/blackgui/components/settingssimulatorcomponent.cpp index 18df3209a..f1534c790 100644 --- a/src/blackgui/components/settingssimulatorcomponent.cpp +++ b/src/blackgui/components/settingssimulatorcomponent.cpp @@ -156,7 +156,7 @@ namespace BlackGui const CSimulatorPluginInfo selected = simDrivers.findByIdentifier(identifier); if (selected.isUnspecified()) { - CLogMessage(this).error("Simulator plugin does not exist: '%1'") << identifier; + CLogMessage(this).error(u"Simulator plugin does not exist: '%1'") << identifier; return; } @@ -198,11 +198,11 @@ namespace BlackGui const int noRendered = setup.getMaxRenderedAircraft(); if (noRequested == noRendered) { - CLogMessage(this).info("Max.rendered aircraft: %1") << noRendered; + CLogMessage(this).info(u"Max.rendered aircraft: %1") << noRendered; } else { - CLogMessage(this).info("Max.rendered aircraft: %1, requested: %2") << noRendered << noRequested; + CLogMessage(this).info(u"Max.rendered aircraft: %1, requested: %2") << noRendered << noRequested; ui->le_MaxAircraft->setText(QString::number(noRendered)); } this->setGuiValues(); @@ -225,7 +225,7 @@ namespace BlackGui } else { - CLogMessage(this).info("Max.distance requested: %1") << newDistance.valueRoundedWithUnit(2, true); + CLogMessage(this).info(u"Max.distance requested: %1") << newDistance.valueRoundedWithUnit(2, true); setup.setMaxRenderedDistance(newDistance); sGui->getIContextSimulator()->setInterpolationAndRenderingSetupGlobal(setup); this->setGuiValues(); @@ -251,7 +251,7 @@ namespace BlackGui } if (ost.isNull()) { - CLogMessage().validationWarning("Invalid offset time"); + CLogMessage().validationWarning(u"Invalid offset time"); } else { diff --git a/src/blackgui/components/setuploadingdialog.cpp b/src/blackgui/components/setuploadingdialog.cpp index 0fe013e11..312c75afb 100644 --- a/src/blackgui/components/setuploadingdialog.cpp +++ b/src/blackgui/components/setuploadingdialog.cpp @@ -92,14 +92,14 @@ namespace BlackGui for (const CUrl &url : bootstrapUrls) { const CStatusMessage msg = CNetworkUtils::canConnect(url) ? - CStatusMessage(this).info("Can connect to '%1'") << url.getFullUrl() : CStatusMessage(this).warning("Cannot connect to '%1'") << url.getFullUrl(); + CStatusMessage(this).info(u"Can connect to '%1'") << url.getFullUrl() : CStatusMessage(this).warning(u"Cannot connect to '%1'") << url.getFullUrl(); ui->comp_Messages->appendStatusMessageToList(msg); } }); } else { - const CStatusMessage msg = CStatusMessage(this).warning("No loaded bootstrap setup available, skipping URL test"); + const CStatusMessage msg = CStatusMessage(this).warning(u"No loaded bootstrap setup available, skipping URL test"); ui->comp_Messages->appendStatusMessageToList(msg); } } diff --git a/src/blackgui/components/simulatorcomponent.cpp b/src/blackgui/components/simulatorcomponent.cpp index 6abdd0684..27841a5cf 100644 --- a/src/blackgui/components/simulatorcomponent.cpp +++ b/src/blackgui/components/simulatorcomponent.cpp @@ -185,7 +185,7 @@ namespace BlackGui void CSimulatorComponent::onAddingRemoteModelFailed(const CSimulatedAircraft &aircraft, bool disabled, const CStatusMessage &message) { - ui->comp_StatusMessages->appendStatusMessageToList(CStatusMessage(this).warning("Adding model failed, disabled: %1: '%2'") << boolToYesNo(disabled) << aircraft.toQString(true)); + ui->comp_StatusMessages->appendStatusMessageToList(CStatusMessage(this).warning(u"Adding model failed, disabled: %1: '%2'") << boolToYesNo(disabled) << aircraft.toQString(true)); ui->comp_StatusMessages->appendStatusMessageToList(message); } diff --git a/src/blackgui/components/textmessagecomponent.cpp b/src/blackgui/components/textmessagecomponent.cpp index 1e578631a..54a12b6f9 100644 --- a/src/blackgui/components/textmessagecomponent.cpp +++ b/src/blackgui/components/textmessagecomponent.cpp @@ -173,7 +173,7 @@ namespace BlackGui if (msgSettings.popupSelcalMessages()) { - emit this->displayInInfoWindow(CLogMessage(this).info("SELCAL received"), 3 * 1000); + emit this->displayInInfoWindow(CLogMessage(this).info(u"SELCAL received"), 3 * 1000); } continue; } @@ -538,7 +538,7 @@ namespace BlackGui QString cmd(".msg "); if (index < 0 || index == ui->tw_TextMessages->indexOf(ui->tb_TextMessagesAll)) { - CLogMessage(this).validationError("Incorrect message channel"); + CLogMessage(this).validationError(u"Incorrect message channel"); return {}; } else @@ -609,7 +609,7 @@ namespace BlackGui { if (callsign.isEmpty()) { - CLogMessage(this).warning("No callsign to display text message"); + CLogMessage(this).warning(u"No callsign to display text message"); return; } QWidget *w = this->findTextMessageTabByCallsign(callsign, true); diff --git a/src/blackgui/editors/aircraftpartsform.cpp b/src/blackgui/editors/aircraftpartsform.cpp index fd0eb3ee5..7c6ebd50e 100644 --- a/src/blackgui/editors/aircraftpartsform.cpp +++ b/src/blackgui/editors/aircraftpartsform.cpp @@ -72,14 +72,14 @@ namespace BlackGui CAircraftParts parts; if (jsonParts.isEmpty()) { - CLogMessage(this).validationError("No JSON content"); + CLogMessage(this).validationError(u"No JSON content"); return parts; } QJsonParseError jsonError; QJsonDocument jsonDoc(QJsonDocument::fromJson(jsonParts.toUtf8(), &jsonError)); if (jsonError.error != QJsonParseError::NoError) { - CLogMessage(this).validationError("Parse error: %1") << jsonError.errorString(); + CLogMessage(this).validationError(u"Parse error: %1") << jsonError.errorString(); return parts; } diff --git a/src/blackgui/editors/cockpitcomform.cpp b/src/blackgui/editors/cockpitcomform.cpp index 464b5de52..65095206c 100644 --- a/src/blackgui/editors/cockpitcomform.cpp +++ b/src/blackgui/editors/cockpitcomform.cpp @@ -170,7 +170,7 @@ namespace BlackGui } else { - CLogMessage(this).validationWarning("Wrong transponder code, reset"); + CLogMessage(this).validationWarning(u"Wrong transponder code, reset"); ui->sbp_ComPanelTransponder->setValue(transponder.getTransponderCode()); } transponder.setTransponderMode(ui->cbp_ComPanelTransponderMode->getSelectedTransponderMode()); diff --git a/src/blackgui/editors/pilotform.cpp b/src/blackgui/editors/pilotform.cpp index 10ba6a14d..6108050b4 100644 --- a/src/blackgui/editors/pilotform.cpp +++ b/src/blackgui/editors/pilotform.cpp @@ -121,19 +121,19 @@ namespace BlackGui const CUser user(this->getUser()); const bool validId = m_vatsim ? user.hasValidVatsimId() : user.hasId(); ui->lblp_Id->setTicked(validId); - if (!validId) { msgs.push_back(CStatusMessage(this).validationError("Invalid id")); } + if (!validId) { msgs.push_back(CStatusMessage(this).validationError(u"Invalid id")); } const bool validHomeAirport = user.hasValidHomeBase(); ui->lblp_HomeAirport->setTicked(validHomeAirport); - if (!validHomeAirport) { msgs.push_back(CStatusMessage(this).validationError("Wromg home airport")); } + if (!validHomeAirport) { msgs.push_back(CStatusMessage(this).validationError(u"Wromg home airport")); } const bool validCredentials = user.hasCredentials(); ui->lblp_Password->setTicked(validCredentials); - if (!validCredentials) { msgs.push_back(CStatusMessage(this).validationError("Invalid credentials")); } + if (!validCredentials) { msgs.push_back(CStatusMessage(this).validationError(u"Invalid credentials")); } const bool validRealName = user.hasRealName(); ui->lblp_RealName->setTicked(validRealName); - if (!validRealName) { msgs.push_back(CStatusMessage(this).validationError("Invalid real name")); } + if (!validRealName) { msgs.push_back(CStatusMessage(this).validationError(u"Invalid real name")); } return msgs; } diff --git a/src/blackgui/guiapplication.cpp b/src/blackgui/guiapplication.cpp index 33e34be31..d5c3f61af 100644 --- a/src/blackgui/guiapplication.cpp +++ b/src/blackgui/guiapplication.cpp @@ -368,7 +368,7 @@ namespace BlackGui window->restoreGeometry(g); window->restoreState(s); const QString location = settings.fileName(); - CLogMessage(this).info("GUI settings are here: '%1'") << location; + CLogMessage(this).info(u"GUI settings are here: '%1'") << location; return true; } @@ -714,7 +714,7 @@ namespace BlackGui { if (!sGui || sGui->isShuttingDown()) { return; } this->displayTextInConsole(this->getWebDataServices()->getReadersLog()); - CLogMessage(this).info("Displayed services log."); + CLogMessage(this).info(u"Displayed services log."); }); Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed"); } @@ -811,7 +811,7 @@ namespace BlackGui const CUrl helpPage = gs.getHelpPageUrl(context); if (helpPage.isEmpty()) { - CLogMessage(this).warning("No help page"); + CLogMessage(this).warning(u"No help page"); return; } QDesktopServices::openUrl(helpPage); @@ -1067,7 +1067,7 @@ namespace BlackGui // changing style freezes the application, so it must not be done in flight mode if (this->getIContextNetwork() && this->getIContextNetwork()->isConnected()) { - CLogMessage(this).validationError("Cannot change style while connected to network"); + CLogMessage(this).validationError(u"Cannot change style while connected to network"); } else { diff --git a/src/blackgui/infoarea.cpp b/src/blackgui/infoarea.cpp index f97dcf502..b5a529f26 100644 --- a/src/blackgui/infoarea.cpp +++ b/src/blackgui/infoarea.cpp @@ -772,7 +772,7 @@ namespace BlackGui { if (m_lockTabBar) { - CLogMessage(this).info("Locked, double click will not cause floating"); + CLogMessage(this).info(u"Locked, double click will not cause floating"); return; } CDockWidgetInfoArea *dw = this->getDockWidgetInfoAreaByTabBarIndex(tabBarIndex); diff --git a/src/blackgui/menus/aircraftmodelmenus.cpp b/src/blackgui/menus/aircraftmodelmenus.cpp index 1698ef10b..2c09bcaf5 100644 --- a/src/blackgui/menus/aircraftmodelmenus.cpp +++ b/src/blackgui/menus/aircraftmodelmenus.cpp @@ -200,12 +200,12 @@ namespace BlackGui const CAircraftModelList dbModels(sGui->getWebDataServices()->getModels()); if (dbModels.isEmpty()) { - CLogMessage(this).warning("No DB models to consolidate with"); + CLogMessage(this).warning(u"No DB models to consolidate with"); return; } if (!this->modelsTargetSetable()) { - CLogMessage(this).warning("No setable target"); + CLogMessage(this).warning(u"No setable target"); return; } @@ -219,17 +219,17 @@ namespace BlackGui if (filtered) { this->modelsTargetUpdatable()->updateModels(models); - CLogMessage(this).info("Consolidated %1/%2 filtered models with DB") << c << models.size(); + CLogMessage(this).info(u"Consolidated %1/%2 filtered models with DB") << c << models.size(); } else { this->modelsTargetSetable()->setModels(models); - CLogMessage(this).info("Consolidated %1/%2 models with DB") << c << models.size(); + CLogMessage(this).info(u"Consolidated %1/%2 models with DB") << c << models.size(); } } else { - CLogMessage(this).info("No data consolidated with DB"); + CLogMessage(this).info(u"No data consolidated with DB"); this->modelView()->hideLoadIndicator(); } } @@ -243,7 +243,7 @@ namespace BlackGui if (models.isEmpty()) { return; } if (!this->modelsTargetUpdatable()) { - CLogMessage(this).warning("No updatable target"); + CLogMessage(this).warning(u"No updatable target"); return; } const int c = CDatabaseUtils::consolidateModelsWithDbDataAllowsGuiRefresh(models, true, true); @@ -317,7 +317,7 @@ namespace BlackGui { if (!this->modelsTargetUpdatable()) { - CLogMessage(this).warning("No updatable target"); + CLogMessage(this).warning(u"No updatable target"); } else { @@ -327,7 +327,7 @@ namespace BlackGui this->modelView()->hideLoadIndicator(i); if (!removedModelStrings.isEmpty() && this->getMappingComponent()) { - const CStatusMessage m = CStatusMessage(this).info("Removed %1 model(s)") << removedModelStrings.size(); + const CStatusMessage m = CStatusMessage(this).info(u"Removed %1 model(s)") << removedModelStrings.size(); this->getMappingComponent()->showOverlayMessage(m, 5000); } } @@ -339,7 +339,7 @@ namespace BlackGui if (models.isEmpty()) { return; } if (!this->modelsTargetUpdatable()) { - CLogMessage(this).warning("No updatable target"); + CLogMessage(this).warning(u"No updatable target"); return; } @@ -352,7 +352,7 @@ namespace BlackGui this->modelView()->hideLoadIndicator(i); if (!removedModelStrings.isEmpty() && this->getMappingComponent()) { - const CStatusMessage m = CStatusMessage(this).info("Removed %1 model(s)") << removedModelStrings.size(); + const CStatusMessage m = CStatusMessage(this).info(u"Removed %1 model(s)") << removedModelStrings.size(); this->getMappingComponent()->showOverlayMessage(m, 5000); } } diff --git a/src/blackgui/views/viewbase.cpp b/src/blackgui/views/viewbase.cpp index 35dd55ce3..43f12c744 100644 --- a/src/blackgui/views/viewbase.cpp +++ b/src/blackgui/views/viewbase.cpp @@ -691,19 +691,19 @@ namespace BlackGui { if (fileName.isEmpty()) { - m = CStatusMessage(this).error("Load canceled, no file name"); + m = CStatusMessage(this).error(u"Load canceled, no file name"); break; } const QString json(CFileUtils::readFileToString(fileName)); if (json.isEmpty()) { - m = CStatusMessage(this).warning("Reading '%1' yields no data") << fileName; + m = CStatusMessage(this).warning(u"Reading '%1' yields no data") << fileName; break; } if (!Json::looksLikeSwiftJson(json)) { - m = CStatusMessage(this).warning("No swift JSON '%1'") << fileName; + m = CStatusMessage(this).warning(u"No swift JSON '%1'") << fileName; break; } @@ -713,7 +713,7 @@ namespace BlackGui const QJsonObject jsonObject = Json::jsonObjectFromString(json, allowCacheFormat); if (jsonObject.isEmpty()) { - m = CStatusMessage(this).warning("No valid swift JSON '%1'") << fileName; + m = CStatusMessage(this).warning(u"No valid swift JSON '%1'") << fileName; break; } @@ -726,7 +726,7 @@ namespace BlackGui containerVariant.convertFromJson(jsonObject); if (!containerVariant.canConvert()) { - m = CStatusMessage(this).warning("No valid swift JSON '%1'") << fileName; + m = CStatusMessage(this).warning(u"No valid swift JSON '%1'") << fileName; break; } container = containerVariant.value(); diff --git a/src/blackinput/linux/joysticklinux.cpp b/src/blackinput/linux/joysticklinux.cpp index 072bba47a..ae405f793 100644 --- a/src/blackinput/linux/joysticklinux.cpp +++ b/src/blackinput/linux/joysticklinux.cpp @@ -41,7 +41,7 @@ namespace BlackInput strncpy(deviceName, "Unknown", sizeof(deviceName)); } - CLogMessage(this).info("Found joystick: %1") << deviceName; + CLogMessage(this).info(u"Found joystick: %1") << deviceName; fcntl(m_fd->handle(), F_SETFL, O_NONBLOCK); diff --git a/src/blackinput/linux/keyboardlinux.cpp b/src/blackinput/linux/keyboardlinux.cpp index 0c781eaab..7f8be3ff8 100644 --- a/src/blackinput/linux/keyboardlinux.cpp +++ b/src/blackinput/linux/keyboardlinux.cpp @@ -186,7 +186,7 @@ namespace BlackInput // Is it grabbed by someone else? if ((ioctl(fd, EVIOCGRAB, 1) < 0)) { - BlackMisc::CLogMessage(this).warning("Device exclusively grabbed by someone else (X11 using exclusive-mode evdev?)") << deviceName; + BlackMisc::CLogMessage(this).warning(u"Device exclusively grabbed by someone else (X11 using exclusive-mode evdev?)") << deviceName; } else { @@ -194,7 +194,7 @@ namespace BlackInput uint8_t keys[KEY_MAX / 8 + 1]; if ((ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keys)), &keys) >= 0) && (keys[KEY_SPACE / 8] & (1 << (KEY_SPACE % 8)))) { - BlackMisc::CLogMessage(this).info("Found keyboard: %1") << deviceName; + BlackMisc::CLogMessage(this).info(u"Found keyboard: %1") << deviceName; fcntl(inputFile->handle(), F_SETFL, O_NONBLOCK); connect(new QSocketNotifier(inputFile->handle(), QSocketNotifier::Read, inputFile.data()), &QSocketNotifier::activated, this, &CKeyboardLinux::inputReadyRead); diff --git a/src/blackinput/macos/keyboardmacos.mm b/src/blackinput/macos/keyboardmacos.mm index 1d3c0ecdf..45069f91e 100644 --- a/src/blackinput/macos/keyboardmacos.mm +++ b/src/blackinput/macos/keyboardmacos.mm @@ -222,7 +222,7 @@ namespace BlackInput CKeyboardMacOS *keyboardMac = static_cast(refcon); if (type == kCGEventTapDisabledByTimeout) { - BlackMisc::CLogMessage(static_cast(nullptr)).warning("Event tap got disabled by timeout. Enable it again."); + BlackMisc::CLogMessage(static_cast(nullptr)).warning(u"Event tap got disabled by timeout. Enable it again."); CGEventTapEnable(keyboardMac->m_eventTap, true); } else diff --git a/src/blackinput/win/joystickwindows.cpp b/src/blackinput/win/joystickwindows.cpp index c2cf9cdef..ba9d21369 100644 --- a/src/blackinput/win/joystickwindows.cpp +++ b/src/blackinput/win/joystickwindows.cpp @@ -38,7 +38,7 @@ namespace BlackInput IDirectInputDevice8 *diDevice = nullptr; if (FAILED(hr = m_directInput->CreateDevice(m_guidDevice, &diDevice, nullptr))) { - CLogMessage(this).warning("IDirectInput8::CreateDevice failed: ") << hr; + CLogMessage(this).warning(u"IDirectInput8::CreateDevice failed: ") << hr; return false; } m_directInputDevice.reset(diDevice); @@ -48,14 +48,14 @@ namespace BlackInput if (!helperWindow) { return false; } if (FAILED(hr = m_directInputDevice->SetCooperativeLevel(helperWindow, DISCL_NONEXCLUSIVE | DISCL_BACKGROUND))) { - CLogMessage(this).warning("IDirectInputDevice8::SetCooperativeLevel failed: ") << hr; + CLogMessage(this).warning(u"IDirectInputDevice8::SetCooperativeLevel failed: ") << hr; return false; } // Set data format to c_dfDIJoystick2 if (FAILED(hr = m_directInputDevice->SetDataFormat(&c_dfDIJoystick2))) { - CLogMessage(this).warning("IDirectInputDevice8::SetDataFormat failed: ") << hr; + CLogMessage(this).warning(u"IDirectInputDevice8::SetDataFormat failed: ") << hr; return false; } @@ -64,7 +64,7 @@ namespace BlackInput // Get device capabilities - we are interested in the number of buttons. if (FAILED(hr = m_directInputDevice->GetCapabilities(&deviceCaps))) { - CLogMessage(this).warning("IDirectInputDevice8::GetCapabilities failed: ") << hr; + CLogMessage(this).warning(u"IDirectInputDevice8::GetCapabilities failed: ") << hr; return false; } @@ -73,11 +73,11 @@ namespace BlackInput if (FAILED(hr = m_directInputDevice->EnumObjects(enumObjectsCallback, this, DIDFT_BUTTON))) { - CLogMessage(this).warning("IDirectInputDevice8::EnumObjects failed: ") << hr; + CLogMessage(this).warning(u"IDirectInputDevice8::EnumObjects failed: ") << hr; return false; } - CLogMessage(this).info("Created joystick device '%1' with %2 buttons") << m_deviceName << deviceCaps.dwButtons; + CLogMessage(this).info(u"Created joystick device '%1' with %2 buttons") << m_deviceName << deviceCaps.dwButtons; this->startTimer(50); return true; } @@ -100,7 +100,7 @@ namespace BlackInput m_directInputDevice->Acquire(); if (FAILED(hr = m_directInputDevice->Poll())) { - CLogMessage(this).warning("DirectInput error code: ") << hr; + CLogMessage(this).warning(u"DirectInput error code: ") << hr; return hr; } } @@ -113,7 +113,7 @@ namespace BlackInput m_directInputDevice->Acquire(); if (FAILED(hr = m_directInputDevice->GetDeviceState(sizeof(DIJOYSTATE2), &state))) { - CLogMessage(this).warning("DirectInput error code: ") << hr; + CLogMessage(this).warning(u"DirectInput error code: ") << hr; return hr; } } @@ -159,7 +159,7 @@ namespace BlackInput // RPC_E_CHANGED_MODE: CoInitializeEx was already called by someone else in this thread with a different mode. if (hr == RPC_E_CHANGED_MODE) { - CLogMessage(this).debug("CoInitializeEx was already called with a different mode. Trying again."); + CLogMessage(this).debug(u"CoInitializeEx was already called with a different mode. Trying again."); hr = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); } @@ -179,7 +179,7 @@ namespace BlackInput } else { - CLogMessage(this).warning("CoInitializeEx returned error code %1"); + CLogMessage(this).warning(u"CoInitializeEx returned error code %1"); } } @@ -219,20 +219,20 @@ namespace BlackInput { if (!m_directInput) { - CLogMessage(this).warning("No direct input"); + CLogMessage(this).warning(u"No direct input"); return E_FAIL; } HRESULT hr; if (FAILED(hr = m_directInput->EnumDevices(DI8DEVCLASS_GAMECTRL, enumJoysticksCallback, this, DIEDFL_ATTACHEDONLY))) { - CLogMessage(this).error("Error reading joystick devices"); + CLogMessage(this).error(u"Error reading joystick devices"); return hr; } if (m_joystickDevices.empty()) { - CLogMessage(this).info("No joystick device found"); + CLogMessage(this).info(u"No joystick device found"); } return hr; } diff --git a/src/blackmisc/aviation/altitude.cpp b/src/blackmisc/aviation/altitude.cpp index 7f6bcefad..c96da95e6 100644 --- a/src/blackmisc/aviation/altitude.cpp +++ b/src/blackmisc/aviation/altitude.cpp @@ -184,13 +184,13 @@ namespace BlackMisc this->setNull(); if (v.length() < 3) { - if (msgs) { msgs->push_back(CStatusMessage(this).validationError("Altitude empty or too short")); } + if (msgs) { msgs->push_back(CStatusMessage(this).validationError(u"Altitude empty or too short")); } return false; } if (!fpAltitudeRegExp().globalMatch(v).hasNext()) { - if (msgs) { msgs->push_back(CStatusMessage(this).validationError("Altitude '%1' needs to match format '%2'") << v << fpAltitudeExamples()); } + if (msgs) { msgs->push_back(CStatusMessage(this).validationError(u"Altitude '%1' needs to match format '%2'") << v << fpAltitudeExamples()); } return false; } @@ -212,7 +212,7 @@ namespace BlackMisc if (numericPart.isEmpty()) { - if (msgs) { msgs->push_back(CStatusMessage(this).validationError("Altitude '%1' has no numeric part")); } + if (msgs) { msgs->push_back(CStatusMessage(this).validationError(u"Altitude '%1' has no numeric part")); } return false; } @@ -255,7 +255,7 @@ namespace BlackMisc } else { - if (msgs) { msgs->push_back(CStatusMessage(this).validationError("Altitude '%1' needs to match format '%2'") << v << fpAltitudeExamples()); } + if (msgs) { msgs->push_back(CStatusMessage(this).validationError(u"Altitude '%1' needs to match format '%2'") << v << fpAltitudeExamples()); } return false; } @@ -269,29 +269,29 @@ namespace BlackMisc { if (this->isNull()) { - if (msgs) { msgs->push_back(CStatusMessage(this).validationError("Altitude NULL value")); } + if (msgs) { msgs->push_back(CStatusMessage(this).validationError(u"Altitude NULL value")); } return false; } if (!(this->getReferenceDatum() == FlightLevel || this->getReferenceDatum() == MeanSeaLevel)) { - if (msgs) { msgs->push_back(CStatusMessage(this).validationError("Altitude, must be FL or MSL")); } + if (msgs) { msgs->push_back(CStatusMessage(this).validationError(u"Altitude, must be FL or MSL")); } return false; } if (!(this->getUnit() == CLengthUnit::m() || this->getUnit() == CLengthUnit::ft())) { - if (msgs) { msgs->push_back(CStatusMessage(this).validationError("Altitude, valid unit must be 'ft' or 'm'")); } + if (msgs) { msgs->push_back(CStatusMessage(this).validationError(u"Altitude, valid unit must be 'ft' or 'm'")); } return false; } if (this->isNegativeWithEpsilonConsidered()) { - if (msgs) { msgs->push_back(CStatusMessage(this).validationError("Altitude must be positive")); } + if (msgs) { msgs->push_back(CStatusMessage(this).validationError(u"Altitude must be positive")); } return false; } if (this->isFlightLevel()) { if (!this->isInteger()) { - if (msgs) { msgs->push_back(CStatusMessage(this).validationError("FL needs to be positive integer")); } + if (msgs) { msgs->push_back(CStatusMessage(this).validationError(u"FL needs to be positive integer")); } return false; } @@ -300,12 +300,12 @@ namespace BlackMisc const int flInt = this->valueInteger() / 100; // internally represented as ft: FL10->1000 if (flInt < 10 || flInt >= 1000) { - if (msgs) { msgs->push_back(CStatusMessage(this).validationError("FL range is 10-999")); } + if (msgs) { msgs->push_back(CStatusMessage(this).validationError(u"FL range is 10-999")); } return false; } if (!CMathUtils::epsilonZero(fmod(flInt, 5))) { - if (msgs) { msgs->push_back(CStatusMessage(this).validationError("FL needs to end with 0 or 5")); } + if (msgs) { msgs->push_back(CStatusMessage(this).validationError(u"FL needs to end with 0 or 5")); } return false; } } diff --git a/src/blackmisc/aviation/flightplan.cpp b/src/blackmisc/aviation/flightplan.cpp index 2e0a4dc13..c86b9dbeb 100644 --- a/src/blackmisc/aviation/flightplan.cpp +++ b/src/blackmisc/aviation/flightplan.cpp @@ -428,7 +428,7 @@ namespace BlackMisc { if (fileName.isEmpty()) { - if (msgs) { msgs->push_back(CStatusMessage(getLogCategories()).validationError("No file name")); } + if (msgs) { msgs->push_back(CStatusMessage(getLogCategories()).validationError(u"No file name")); } return CFlightPlan(); } else @@ -436,7 +436,7 @@ namespace BlackMisc QFile f(fileName); if (!f.exists()) { - if (msgs) { msgs->push_back(CStatusMessage(getLogCategories()).validationError("File '%1' does not exist") << fileName); } + if (msgs) { msgs->push_back(CStatusMessage(getLogCategories()).validationError(u"File '%1' does not exist") << fileName); } return CFlightPlan(); } } @@ -444,7 +444,7 @@ namespace BlackMisc const QString data = CFileUtils::readFileToString(fileName); if (data.isEmpty()) { - if (msgs) { msgs->push_back(CStatusMessage(getLogCategories()).validationError("File '%1' does not contain data") << fileName); } + if (msgs) { msgs->push_back(CStatusMessage(getLogCategories()).validationError(u"File '%1' does not contain data") << fileName); } return CFlightPlan(); } diff --git a/src/blackmisc/datacache.cpp b/src/blackmisc/datacache.cpp index 93cbb5eae..157640736 100644 --- a/src/blackmisc/datacache.cpp +++ b/src/blackmisc/datacache.cpp @@ -73,7 +73,7 @@ namespace BlackMisc { if (! QDir::root().mkpath(persistentStore())) { - CLogMessage(this).error("Failed to create directory '%1'") << persistentStore(); + CLogMessage(this).error(u"Failed to create directory '%1'") << persistentStore(); } connect(this, &CValueCache::valuesChangedByLocal, this, &CDataCache::saveToStoreAsync); @@ -362,7 +362,7 @@ namespace BlackMisc if (! m_lockFile.lock()) { - CLogMessage(this).error("Failed to lock %1: %2") << m_basename << CFileUtils::lockFileError(m_lockFile); + CLogMessage(this).error(u"Failed to lock %1: %2") << m_basename << CFileUtils::lockFileError(m_lockFile); return {}; } m_updateInProgress = true; @@ -376,7 +376,7 @@ namespace BlackMisc { if (! revisionFile.open(QFile::ReadOnly | QFile::Text)) { - CLogMessage(this).error("Failed to open %1: %2") << revisionFile.fileName() << revisionFile.errorString(); + CLogMessage(this).error(u"Failed to open %1: %2") << revisionFile.fileName() << revisionFile.errorString(); return {}; } @@ -442,7 +442,7 @@ namespace BlackMisc } else if (revisionFile.size() > 0) { - CLogMessage(this).error("Invalid format of %1") << revisionFile.fileName(); + CLogMessage(this).error(u"Invalid format of %1") << revisionFile.fileName(); if (m_pendingWrite) { return guard; } return {}; @@ -464,7 +464,7 @@ namespace BlackMisc CAtomicFile revisionFile(CFileUtils::appendFilePaths(m_basename, ".rev")); if (! revisionFile.open(QFile::WriteOnly | QFile::Text)) { - CLogMessage(this).error("Failed to open %1: %2") << revisionFile.fileName() << revisionFile.errorString(); + CLogMessage(this).error(u"Failed to open %1: %2") << revisionFile.fileName() << revisionFile.errorString(); return; } @@ -492,7 +492,7 @@ namespace BlackMisc if (! revisionFile.checkedClose()) { - CLogMessage(this).error("Failed to write to %1: %2 (%3 %4)") << revisionFile.fileName() << revisionFile.errorString() << QThread::currentThread()->objectName() << Q_FUNC_INFO; + CLogMessage(this).error(u"Failed to write to %1: %2 (%3 %4)") << revisionFile.fileName() << revisionFile.errorString() << QThread::currentThread()->objectName() << Q_FUNC_INFO; } } @@ -632,7 +632,7 @@ namespace BlackMisc if (! m_lockFile.lock()) { - CLogMessage(this).error("Failed to lock %1: %2") << m_basename << CFileUtils::lockFileError(m_lockFile); + CLogMessage(this).error(u"Failed to lock %1: %2") << m_basename << CFileUtils::lockFileError(m_lockFile); m_lockFile.unlock(); return; } @@ -642,7 +642,7 @@ namespace BlackMisc { if (! revisionFile.open(QFile::ReadWrite | QFile::Text)) { - CLogMessage(this).error("Failed to open %1: %2") << revisionFile.fileName() << revisionFile.errorString(); + CLogMessage(this).error(u"Failed to open %1: %2") << revisionFile.fileName() << revisionFile.errorString(); m_lockFile.unlock(); return; } @@ -654,7 +654,7 @@ namespace BlackMisc if (!(revisionFile.seek(0) && revisionFile.resize(0) && revisionFile.write(QJsonDocument(json).toJson()) && revisionFile.checkedClose())) { - CLogMessage(this).error("Failed to write to %1: %2 (%3 %4)") << revisionFile.fileName() << revisionFile.errorString() << QThread::currentThread()->objectName() << Q_FUNC_INFO; + CLogMessage(this).error(u"Failed to write to %1: %2 (%3 %4)") << revisionFile.fileName() << revisionFile.errorString() << QThread::currentThread()->objectName() << Q_FUNC_INFO; } } m_lockFile.unlock(); @@ -668,7 +668,7 @@ namespace BlackMisc if (! m_lockFile.lock()) { - CLogMessage(this).error("Failed to lock %1: %2") << m_basename << CFileUtils::lockFileError(m_lockFile); + CLogMessage(this).error(u"Failed to lock %1: %2") << m_basename << CFileUtils::lockFileError(m_lockFile); m_lockFile.unlock(); return 0; } @@ -684,7 +684,7 @@ namespace BlackMisc } else { - CLogMessage(this).error("Failed to open %1: %2") << revisionFile.fileName() << revisionFile.errorString(); + CLogMessage(this).error(u"Failed to open %1: %2") << revisionFile.fileName() << revisionFile.errorString(); } } m_lockFile.unlock(); @@ -788,7 +788,7 @@ namespace BlackMisc bool ok = file.open(QIODevice::ReadWrite | QFile::Text); if (! ok) { - CLogMessage(this).error("Failed to open session file %1: %2") << m_filename << file.errorString(); + CLogMessage(this).error(u"Failed to open session file %1: %2") << m_filename << file.errorString(); return; } auto json = QJsonDocument::fromJson(file.readAll()).object(); @@ -807,7 +807,7 @@ namespace BlackMisc json.insert("uuid", uuid.toString()); if (!(file.seek(0) && file.resize(0) && file.write(QJsonDocument(json).toJson()) && file.checkedClose())) { - CLogMessage(this).error("Failed to write to session file %1: %2 (%3 %4)") << m_filename << file.errorString() << QThread::currentThread()->objectName() << Q_FUNC_INFO; + CLogMessage(this).error(u"Failed to write to session file %1: %2 (%3 %4)") << m_filename << file.errorString() << QThread::currentThread()->objectName() << Q_FUNC_INFO; } } diff --git a/src/blackmisc/dbusserver.cpp b/src/blackmisc/dbusserver.cpp index 0e9160218..332a1e2bd 100644 --- a/src/blackmisc/dbusserver.cpp +++ b/src/blackmisc/dbusserver.cpp @@ -38,8 +38,8 @@ namespace BlackMisc if (! connection.isConnected() || ! connection.registerService(service)) { // registration fails can either mean something wrong with DBus or service already exists - CLogMessage(this).warning("DBus registration: %1") << connection.lastError().message(); - CLogMessage(this).warning("Cannot register DBus service, check server running: dbus-daemon.exe --session --address=tcp:host=192.168.0.133,port=45000"); + CLogMessage(this).warning(u"DBus registration: %1") << connection.lastError().message(); + CLogMessage(this).warning(u"Cannot register DBus service, check server running: dbus-daemon.exe --session --address=tcp:host=192.168.0.133,port=45000"); } } break; @@ -50,8 +50,8 @@ namespace BlackMisc if (! connection.isConnected() || ! connection.registerService(service)) { // registration fails can either mean something wrong with DBus or service already exists - CLogMessage(this).warning("DBus registration: %1") << connection.lastError().message(); - CLogMessage(this).warning("Cannot register DBus service, check server running: dbus-daemon.exe --system --address=tcp:host=192.168.0.133,port=45000"); + CLogMessage(this).warning(u"DBus registration: %1") << connection.lastError().message(); + CLogMessage(this).warning(u"Cannot register DBus service, check server running: dbus-daemon.exe --system --address=tcp:host=192.168.0.133,port=45000"); } } break; @@ -69,11 +69,11 @@ namespace BlackMisc // Note: P2P has no service name if (m_busServer->isConnected()) { - CLogMessage(this).info("DBus P2P Server listening on address: '%1'") << m_busServer->address(); + CLogMessage(this).info(u"DBus P2P Server listening on address: '%1'") << m_busServer->address(); } else { - CLogMessage(this).warning("DBus P2P connection failed: %1") << lastQDBusServerError().message(); + CLogMessage(this).warning(u"DBus P2P connection failed: %1") << lastQDBusServerError().message(); } connect(m_busServer.data(), &QDBusServer::newConnection, this, &CDBusServer::registerObjectsWithP2PConnection); } @@ -192,7 +192,7 @@ namespace BlackMisc { Q_ASSERT(! m_objects.isEmpty()); m_connections.insert(connection.name(), connection); - CLogMessage(this).info("New Connection from: '%1'") << connection.name(); + CLogMessage(this).info(u"New Connection from: '%1'") << connection.name(); bool success = true; for (auto i = m_objects.cbegin(); i != m_objects.cend(); ++i) { @@ -200,11 +200,11 @@ namespace BlackMisc const bool ok = connection.registerObject(key, i.value(), registerOptions()); if (ok) { - CLogMessage(this).info("Adding '%1' to the new connection '%2'") << key << this->getDBusInterfaceFromClassInfo(i.value()); + CLogMessage(this).info(u"Adding '%1' to the new connection '%2'") << key << this->getDBusInterfaceFromClassInfo(i.value()); } else { - CLogMessage(this).info("Adding '%1' failed, connection '%2', error '%3'") << key << this->getDBusInterfaceFromClassInfo(i.value()) << connection.lastError().message(); + CLogMessage(this).info(u"Adding '%1' failed, connection '%2', error '%3'") << key << this->getDBusInterfaceFromClassInfo(i.value()) << connection.lastError().message(); success = false; } } @@ -223,11 +223,11 @@ namespace BlackMisc QDBusConnection connection = QDBusConnection::connectToBus(QDBusConnection::SessionBus, coreServiceName()); if (connection.registerObject(path, object, registerOptions())) { - CLogMessage(this).info("Adding '%1' '%2' to session DBus") << path << getDBusInterfaceFromClassInfo(object); + CLogMessage(this).info(u"Adding '%1' '%2' to session DBus") << path << getDBusInterfaceFromClassInfo(object); } else { - CLogMessage(this).error("Error, no success with session bus registration"); + CLogMessage(this).error(u"Error, no success with session bus registration"); } } break; @@ -236,11 +236,11 @@ namespace BlackMisc QDBusConnection connection = QDBusConnection::connectToBus(QDBusConnection::SystemBus, coreServiceName()); if (connection.registerObject(path, object, registerOptions())) { - CLogMessage(this).info("Adding '%1' '%2' to system DBus") << path << getDBusInterfaceFromClassInfo(object); + CLogMessage(this).info(u"Adding '%1' '%2' to system DBus") << path << getDBusInterfaceFromClassInfo(object); } else { - CLogMessage(this).error("Error, no success with system bus registration"); + CLogMessage(this).error(u"Error, no success with system bus registration"); } } break; @@ -250,11 +250,11 @@ namespace BlackMisc { if (connection.registerObject(path, object, registerOptions())) { - CLogMessage(this).info("Adding '%1' '%2' to P2P DBus '%3'") << path << getDBusInterfaceFromClassInfo(object) << connection.name(); + CLogMessage(this).info(u"Adding '%1' '%2' to P2P DBus '%3'") << path << getDBusInterfaceFromClassInfo(object) << connection.name(); } else { - CLogMessage(this).error("Error, no success with %1 registration") << connection.name(); + CLogMessage(this).error(u"Error, no success with %1 registration") << connection.name(); } } } diff --git a/src/blackmisc/genericdbusinterface.h b/src/blackmisc/genericdbusinterface.h index 1cb9af76c..89444137a 100644 --- a/src/blackmisc/genericdbusinterface.h +++ b/src/blackmisc/genericdbusinterface.h @@ -64,7 +64,7 @@ namespace BlackMisc const bool c = this->connection().connect(this->service(), this->path(), this->interface(), method.name(), this->parent(), signature); if (!c) { - CLogMessage(this).error("Cannot connect signal: %1") << QString(signature); + CLogMessage(this).error(u"Cannot connect signal: %1") << QString(signature); } } } @@ -86,7 +86,7 @@ namespace BlackMisc pr.waitForFinished(); if(pr.isError()) { - CLogMessage(this).debug("CGenericDBusInterface::callDBusRet(%1) returned: %2") << method << pr.error().message(); + CLogMessage(this).debug(u"CGenericDBusInterface::callDBusRet(%1) returned: %2") << method << pr.error().message(); } return pr; } diff --git a/src/blackmisc/geo/coordinategeodetic.cpp b/src/blackmisc/geo/coordinategeodetic.cpp index 594726904..72ff1da1a 100644 --- a/src/blackmisc/geo/coordinategeodetic.cpp +++ b/src/blackmisc/geo/coordinategeodetic.cpp @@ -57,7 +57,7 @@ namespace BlackMisc BLACK_VERIFY_X(!std::isnan(d), Q_FUNC_INFO, "Distance calculation: NaN in result"); if (std::isnan(d)) { - CLogMessage().debug("Distance calculation: NaN in result (given arguments %1 %2 %3; %4 %5 %6)") << static_cast(v1.x()) << static_cast(v1.y()) << static_cast(v1.z()) << static_cast(v2.x()) << static_cast(v2.y()) << static_cast(v2.z()); + CLogMessage().debug(u"Distance calculation: NaN in result (given arguments %1 %2 %3; %4 %5 %6)") << static_cast(v1.x()) << static_cast(v1.y()) << static_cast(v1.z()) << static_cast(v2.x()) << static_cast(v2.y()) << static_cast(v2.z()); return CLength::null(); } return { static_cast(d), CLengthUnit::m() }; diff --git a/src/blackmisc/pixmap.cpp b/src/blackmisc/pixmap.cpp index a2e2c3c9d..d20fcea99 100644 --- a/src/blackmisc/pixmap.cpp +++ b/src/blackmisc/pixmap.cpp @@ -85,18 +85,18 @@ namespace BlackMisc } if (!QFile(filePath).exists()) { - msg = CStatusMessage().error("file %1 does not exist") << filePath; + msg = CStatusMessage().error(u"file %1 does not exist") << filePath; return CPixmap(); } QPixmap pm; if (pm.load(filePath)) { - msg = CStatusMessage().info("file %1 loaded") << filePath; + msg = CStatusMessage().info(u"file %1 loaded") << filePath; return CPixmap(pm); } else { - msg = CStatusMessage().error("file %1 not loaded") << filePath; + msg = CStatusMessage().error(u"file %1 not loaded") << filePath; return CPixmap(); } } diff --git a/src/blackmisc/processctrl.cpp b/src/blackmisc/processctrl.cpp index d41c30501..582da4053 100644 --- a/src/blackmisc/processctrl.cpp +++ b/src/blackmisc/processctrl.cpp @@ -52,7 +52,7 @@ namespace BlackMisc if (result == 0) { - CLogMessage(static_cast(nullptr)).warning("Failed to start %1: %2") << program << GetLastError(); + CLogMessage(static_cast(nullptr)).warning(u"Failed to start %1: %2") << program << GetLastError(); return false; } diff --git a/src/blackmisc/settingscache.cpp b/src/blackmisc/settingscache.cpp index 7f4f10e84..98d52686e 100644 --- a/src/blackmisc/settingscache.cpp +++ b/src/blackmisc/settingscache.cpp @@ -41,11 +41,11 @@ namespace BlackMisc Q_ASSERT(!lock.isLocked()); if (!QDir::root().mkpath(persistentStore())) { - return CStatusMessage(this).error("Failed to create %1") << persistentStore(); + return CStatusMessage(this).error(u"Failed to create %1") << persistentStore(); } if (!lock.lock()) { - return CStatusMessage(this).error("Failed to lock %1: %2") << lockFileName() << CFileUtils::lockFileError(lock); + return CStatusMessage(this).error(u"Failed to lock %1: %2") << lockFileName() << CFileUtils::lockFileError(lock); } return {}; } diff --git a/src/blackmisc/simulation/aircraftmodel.cpp b/src/blackmisc/simulation/aircraftmodel.cpp index 0b83e7151..1f3d9071d 100644 --- a/src/blackmisc/simulation/aircraftmodel.cpp +++ b/src/blackmisc/simulation/aircraftmodel.cpp @@ -162,18 +162,18 @@ namespace BlackMisc { if (!this->hasExistingCorrespondingFile()) { - const CStatusMessage m = CStatusMessage(this).validationWarning("File '%1' not readable") << this->getFileName(); + const CStatusMessage m = CStatusMessage(this).validationWarning(u"File '%1' not readable") << this->getFileName(); msgs.push_back(m); } else { - const CStatusMessage m = CStatusMessage(this).validationInfo("File '%1' existing") << this->getFileName(); + const CStatusMessage m = CStatusMessage(this).validationInfo(u"File '%1' existing") << this->getFileName(); msgs.push_back(m); } } else { - const CStatusMessage m = CStatusMessage(this).validationError("Invalid model type to check: '%1'") << this->getModelTypeAsString(); + const CStatusMessage m = CStatusMessage(this).validationError(u"Invalid model type to check: '%1'") << this->getModelTypeAsString(); msgs.push_back(m); } return msgs; diff --git a/src/blackmisc/simulation/aircraftmodellist.cpp b/src/blackmisc/simulation/aircraftmodellist.cpp index 9cc3746b3..82ae77ca6 100644 --- a/src/blackmisc/simulation/aircraftmodellist.cpp +++ b/src/blackmisc/simulation/aircraftmodellist.cpp @@ -1066,7 +1066,7 @@ namespace BlackMisc // Any DB distributors? if (distributorsFromDb.isEmpty()) { - const CStatusMessage msg = CStatusMessage(this).validationError("No DB distributors for validation"); + const CStatusMessage msg = CStatusMessage(this).validationError(u"No DB distributors for validation"); msgs.push_back(msg); invalidModels.push_back(*this); return msgs; @@ -1080,7 +1080,7 @@ namespace BlackMisc } else { - const CStatusMessage msg = CStatusMessage(this).validationError("No valid distributor for '%1', was '%2'") << model.getModelString() << model.getDistributor().getDbKey(); + const CStatusMessage msg = CStatusMessage(this).validationError(u"No valid distributor for '%1', was '%2'") << model.getModelString() << model.getDistributor().getDbKey(); msgs.push_back(msg); invalidModels.push_back(model); } diff --git a/src/blackmisc/simulation/aircraftmodelloader.cpp b/src/blackmisc/simulation/aircraftmodelloader.cpp index 04e6a804f..6ed7e757e 100644 --- a/src/blackmisc/simulation/aircraftmodelloader.cpp +++ b/src/blackmisc/simulation/aircraftmodelloader.cpp @@ -214,11 +214,11 @@ namespace BlackMisc if (statusMsgs.hasWarningOrErrorMessages()) { CLogMessage(this).log(m_loadingMessages.worstSeverity(), - "Message loading produced %1 error and %2 warning messages") << errors << warnings; + u"Message loading produced %1 error and %2 warning messages") << errors << warnings; } else { - CLogMessage(this).info("Loading '%1' finished, success for '%2'") << IAircraftModelLoader::enumToString(info) << simulator.toQString(); + CLogMessage(this).info(u"Loading '%1' finished, success for '%2'") << IAircraftModelLoader::enumToString(info) << simulator.toQString(); } } diff --git a/src/blackmisc/simulation/data/modelcaches.cpp b/src/blackmisc/simulation/data/modelcaches.cpp index 3bca82d32..860daa72e 100644 --- a/src/blackmisc/simulation/data/modelcaches.cpp +++ b/src/blackmisc/simulation/data/modelcaches.cpp @@ -182,12 +182,12 @@ namespace BlackMisc if (synchronizeCache) { this->synchronizeCacheImpl(sim); - CLogMessage(this).info("Initialized model caches (%1) for %2") << this->getDescription() << simStr; + CLogMessage(this).info(u"Initialized model caches (%1) for %2") << this->getDescription() << simStr; } else { this->admitCacheImpl(sim); - CLogMessage(this).info("Admit model (%1) caches for %2") << this->getDescription() << simStr; + CLogMessage(this).info(u"Admit model (%1) caches for %2") << this->getDescription() << simStr; } } @@ -293,7 +293,7 @@ namespace BlackMisc CStatusMessage CModelCaches::setCacheTimestamp(const QDateTime &ts, const CSimulatorInfo &simulator) { Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator"); - if (!ts.isValid()) { return CStatusMessage(this).error("Invalid timestamp for '%1'") << simulator.toQString() ; } + if (!ts.isValid()) { return CStatusMessage(this).error(u"Invalid timestamp for '%1'") << simulator.toQString() ; } switch (simulator.getSimulator()) { case CSimulatorInfo::FS9: return m_modelCacheFs9.set(m_modelCacheFs9.get(), ts.toMSecsSinceEpoch()); @@ -398,12 +398,12 @@ namespace BlackMisc if (synchronizeCache) { this->synchronizeCacheImpl(simulator); - CLogMessage(this).info("Initialized model caches (%1) for %2") << this->getDescription() << simStr; + CLogMessage(this).info(u"Initialized model caches (%1) for %2") << this->getDescription() << simStr; } else { this->admitCacheImpl(simulator); - CLogMessage(this).info("Admit model (%1) caches for %2") << this->getDescription() << simStr; + CLogMessage(this).info(u"Admit model (%1) caches for %2") << this->getDescription() << simStr; } } @@ -478,7 +478,7 @@ namespace BlackMisc CStatusMessage CModelSetCaches::setCacheTimestamp(const QDateTime &ts, const CSimulatorInfo &simulator) { Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator"); - if (!ts.isValid()) { return CStatusMessage(this).error("Invalid timestamp for '%1'") << simulator.toQString() ; } + if (!ts.isValid()) { return CStatusMessage(this).error(u"Invalid timestamp for '%1'") << simulator.toQString() ; } switch (simulator.getSimulator()) { case CSimulatorInfo::FS9: return m_modelCacheFs9.set(m_modelCacheFs9.get(), ts.toMSecsSinceEpoch()); diff --git a/src/blackmisc/simulation/fscommon/aircraftcfgentrieslist.cpp b/src/blackmisc/simulation/fscommon/aircraftcfgentrieslist.cpp index fee70aba3..5696e8f41 100644 --- a/src/blackmisc/simulation/fscommon/aircraftcfgentrieslist.cpp +++ b/src/blackmisc/simulation/fscommon/aircraftcfgentrieslist.cpp @@ -85,7 +85,7 @@ namespace BlackMisc if (keys.contains(key)) { CStatusMessage msg(this); - msg.warning("Duplicate model string %1 in %2 %3") + msg.warning(u"Duplicate model string %1 in %2 %3") << entries.getTitle() << entries.getFileDirectory() << entries.getFileName(); msgs.push_back(msg); continue; diff --git a/src/blackmisc/simulation/fscommon/aircraftcfgparser.cpp b/src/blackmisc/simulation/fscommon/aircraftcfgparser.cpp index fc3ff8a47..6653f6a64 100644 --- a/src/blackmisc/simulation/fscommon/aircraftcfgparser.cpp +++ b/src/blackmisc/simulation/fscommon/aircraftcfgparser.cpp @@ -184,7 +184,7 @@ namespace BlackMisc } else { - const CStatusMessage m = CStatusMessage(this).warning("Parsing failed for '%1'") << nextDir; + const CStatusMessage m = CStatusMessage(this).warning(u"Parsing failed for '%1'") << nextDir; messages.push_back(m); } } @@ -200,7 +200,7 @@ namespace BlackMisc CAircraftCfgEntriesList fileResults = CAircraftCfgParser::performParsingOfSingleFile(fileName, fileOk, fileMsgs); if (!fileOk) { - const CStatusMessage m = CStatusMessage(this).warning("Parsing of '%1' failed") << fileName; + const CStatusMessage m = CStatusMessage(this).warning(u"Parsing of '%1' failed") << fileName; messages.push_back(fileMsgs); continue; } @@ -226,7 +226,7 @@ namespace BlackMisc QFile file(fnFixed); // includes path if (!file.open(QFile::ReadOnly | QFile::Text)) { - const CStatusMessage m = CStatusMessage(getLogCategories()).warning("Unable to read file '%1'") << fnFixed; + const CStatusMessage m = CStatusMessage(getLogCategories()).warning(u"Unable to read file '%1'") << fnFixed; msgs.push_back(m); return CAircraftCfgEntriesList(); } @@ -366,7 +366,7 @@ namespace BlackMisc { if (e.getTitle().isEmpty()) { - const CStatusMessage m = CStatusMessage(getLogCategories()).info("FS model in %1, index %2 has no title") << fileName << e.getIndex(); + const CStatusMessage m = CStatusMessage(getLogCategories()).info(u"FS model in %1, index %2 has no title") << fileName << e.getIndex(); msgs.push_back(m); continue; } diff --git a/src/blackmisc/simulation/interpolationlogger.cpp b/src/blackmisc/simulation/interpolationlogger.cpp index 15fb6ebd7..98fede839 100644 --- a/src/blackmisc/simulation/interpolationlogger.cpp +++ b/src/blackmisc/simulation/interpolationlogger.cpp @@ -93,7 +93,7 @@ namespace BlackMisc CStatusMessageList CInterpolationLogger::writeLogFile(const QList &interpolation, const QList &parts) { - if (parts.isEmpty() && interpolation.isEmpty()) { return CStatusMessage(static_cast(nullptr)).warning("No data for log"); } + if (parts.isEmpty() && interpolation.isEmpty()) { return CStatusMessage(static_cast(nullptr)).warning(u"No data for log"); } static const QString html = QStringLiteral("Entries: %1\n\n%2"); const QString htmlTemplate = CFileUtils::readFileToString(CDirectoryUtils::htmlTemplateFilePath()); @@ -124,8 +124,8 @@ namespace BlackMisc CStatusMessage CInterpolationLogger::logStatusFileWriting(bool success, const QString &fileName) { return success ? - CStatusMessage(static_cast(nullptr)).info("Written log file '%1'") << fileName : - CStatusMessage(static_cast(nullptr)).error("Failed to write log file '%1'") << fileName; + CStatusMessage(static_cast(nullptr)).info(u"Written log file '%1'") << fileName : + CStatusMessage(static_cast(nullptr)).error(u"Failed to write log file '%1'") << fileName; } void CInterpolationLogger::logInterpolation(const SituationLog &log) diff --git a/src/blackmisc/simulation/interpolator.cpp b/src/blackmisc/simulation/interpolator.cpp index 5ab3a8480..7bd6d56cf 100644 --- a/src/blackmisc/simulation/interpolator.cpp +++ b/src/blackmisc/simulation/interpolator.cpp @@ -265,13 +265,13 @@ namespace BlackMisc CStatusMessage m; if (noSituation) { - m = CStatusMessage(this).warning("No situation #%1 for interpolation reported for '%2' (Interpolant: %3 interpolation: %4)") << + m = CStatusMessage(this).warning(u"No situation #%1 for interpolation reported for '%2' (Interpolant: %3 interpolation: %4)") << m_invalidSituations << m_callsign.asString() << boolToTrueFalse(isValidInterpolant) << boolToTrueFalse(isValidInterpolation); } else { const qint64 diff = noSituation ? -1 : m_currentTimeMsSinceEpoch - currentSituation.getAdjustedMSecsSinceEpoch(); - m = CStatusMessage(this).warning("Invalid situation, diff. %1ms #%2 for interpolation reported for '%3' (Interpolant: %4 interpolation: %5)") << + m = CStatusMessage(this).warning(u"Invalid situation, diff. %1ms #%2 for interpolation reported for '%3' (Interpolant: %4 interpolation: %5)") << diff << m_invalidSituations << m_callsign.asString() << boolToTrueFalse(isValidInterpolant) << boolToTrueFalse(isValidInterpolation); } if (!m.isEmpty()) @@ -417,7 +417,7 @@ namespace BlackMisc if (log) { - const CStatusMessage m = CStatusMessage(this).warning("NULL parts reported for '%1', '%2')") << m_callsign.asString() << info; + const CStatusMessage m = CStatusMessage(this).warning(u"NULL parts reported for '%1', '%2')") << m_callsign.asString() << info; if (m_interpolationMessages.isEmpty()) { CLogMessage::preformatted(m); } m_interpolationMessages.push_back(m); } diff --git a/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp b/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp index 3cf82629c..1c39ec93b 100644 --- a/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp +++ b/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp @@ -175,7 +175,7 @@ namespace BlackMisc { if (models.containsModelString(model.getModelString())) { - CLogMessage(static_cast(nullptr)).warning("XPlane model '%1' exists already! Potential model string conflict! Ignoring it.") << model.getModelString(); + CLogMessage(static_cast(nullptr)).warning(u"XPlane model '%1' exists already! Potential model string conflict! Ignoring it.") << model.getModelString(); } models.push_back(model); } @@ -270,7 +270,7 @@ namespace BlackMisc { if (installedModels.containsModelString(plane.getModelName())) { - const CStatusMessage msg = CStatusMessage(this).warning("XPlane model '%1' exists already! Potential model string conflict! Ignoring it.") << plane.getModelName(); + const CStatusMessage msg = CStatusMessage(this).warning(u"XPlane model '%1' exists already! Potential model string conflict! Ignoring it.") << plane.getModelName(); m_loadingMessages.push_back(msg); continue; } @@ -316,7 +316,7 @@ namespace BlackMisc { if (tokens.size() != 2) { - CLogMessage(this).error("XPlane '%1' - '%2': EXPORT_NAME command requires 1 argument.") << path << lineNum; + CLogMessage(this).error(u"XPlane '%1' - '%2': EXPORT_NAME command requires 1 argument.") << path << lineNum; return false; } @@ -329,7 +329,7 @@ namespace BlackMisc } else { - CLogMessage(this).error("XPlane package name '%1' already in use by '%2' reqested by use by '%3'") << tokens[1] << p->path << path; + CLogMessage(this).error(u"XPlane package name '%1' already in use by '%2' reqested by use by '%3'") << tokens[1] << p->path << path; return false; } } @@ -339,13 +339,13 @@ namespace BlackMisc Q_UNUSED(package); if (tokens.size() != 2) { - CLogMessage(this).error("'%1' - '%2': DEPENDENCY command requires 1 argument.") << path << lineNum; + CLogMessage(this).error(u"'%1' - '%2': DEPENDENCY command requires 1 argument.") << path << lineNum; return false; } if (std::count_if(m_cslPackages.cbegin(), m_cslPackages.cend(), [&tokens](const CSLPackage & p) { return p.name == tokens[1]; }) == 0) { - CLogMessage(this).error("XPlane required package %1 not found. Aborting processing of this package.") << tokens[1]; + CLogMessage(this).error(u"XPlane required package %1 not found. Aborting processing of this package.") << tokens[1]; return false; } @@ -369,7 +369,7 @@ namespace BlackMisc { if (tokens.size() != 2) { - CLogMessage(this).error("XPlane '%1' - '%2': OBJECT command requires 1 argument.") << path << lineNum; + CLogMessage(this).error(u"XPlane '%1' - '%2': OBJECT command requires 1 argument.") << path << lineNum; return false; } @@ -378,7 +378,7 @@ namespace BlackMisc QString fullPath(relativePath); if (!doPackageSub(fullPath)) { - CLogMessage(this).error("XPlane '%1' - '%2: package not found.") << path << lineNum; + CLogMessage(this).error(u"XPlane '%1' - '%2: package not found.") << path << lineNum; return false; } @@ -386,7 +386,7 @@ namespace BlackMisc QFile objFile(fullPath); if (!objFile.open(QIODevice::ReadOnly | QIODevice::Text)) { - CLogMessage(this).error("XPlane object '%1' does not exist.") << fullPath; + CLogMessage(this).error(u"XPlane object '%1' does not exist.") << fullPath; return false; } QTextStream ts(&objFile); @@ -432,7 +432,7 @@ namespace BlackMisc { if (tokens.size() != 2) { - CLogMessage(this).error("XPlane '%1' - '%2': TEXTURE command requires 1 argument.") << path << lineNum; + CLogMessage(this).error(u"XPlane '%1' - '%2': TEXTURE command requires 1 argument.") << path << lineNum; return false; } @@ -443,14 +443,14 @@ namespace BlackMisc if (!doPackageSub(absoluteTexPath)) { - CLogMessage(this).error("XPlane '%1' - '%2': package not found.") << path << lineNum; + CLogMessage(this).error(u"XPlane '%1' - '%2': package not found.") << path << lineNum; return false; } QFileInfo fileInfo(absoluteTexPath); if (!fileInfo.exists()) { - CLogMessage(this).error("XPlane texture '%1' does not exist.") << absoluteTexPath; + CLogMessage(this).error(u"XPlane texture '%1' does not exist.") << absoluteTexPath; return false; } @@ -464,12 +464,12 @@ namespace BlackMisc // AIRCAFT if (tokens.size() != 4) { - CLogMessage(this).error("XPlane '%1' - '%2': AIRCRAFT command requires 3 arguments.") << path << lineNum; + CLogMessage(this).error(u"XPlane '%1' - '%2': AIRCRAFT command requires 3 arguments.") << path << lineNum; } // Flyable aircrafts are parsed by a different method. We don't know any aircraft files in CSL packages. // If there is one, implement this method here. - CLogMessage(this).warning("Not implemented yet."); + CLogMessage(this).warning(u"Not implemented yet."); return true; } @@ -478,7 +478,7 @@ namespace BlackMisc // OBJ8_AIRCRAFT if (tokens.size() != 2) { - CLogMessage(this).error("XPlane '%1' - '%2': OBJ8_AIRCARFT command requires 1 argument.") << path << lineNum; + CLogMessage(this).error(u"XPlane '%1' - '%2': OBJ8_AIRCARFT command requires 1 argument.") << path << lineNum; } package.planes.push_back(CSLPlane()); @@ -490,7 +490,7 @@ namespace BlackMisc // OBJ8 { {}} if (tokens.size() < 4 || tokens.size() > 6) { - CLogMessage(this).error("XPlane '%1' - '%2': OBJ8 command takes 3-5 arguments.") << path << lineNum; + CLogMessage(this).error(u"XPlane '%1' - '%2': OBJ8 command takes 3-5 arguments.") << path << lineNum; } if (tokens[1] != "SOLID") { return true; } @@ -500,7 +500,7 @@ namespace BlackMisc QString fullPath(relativePath); if (!doPackageSub(fullPath)) { - CLogMessage(this).error("XPlane '%1' - '%2': package not found.") << path << lineNum; + CLogMessage(this).error(u"XPlane '%1' - '%2': package not found.") << path << lineNum; return false; } @@ -529,14 +529,14 @@ namespace BlackMisc if (!doPackageSub(absoluteTexPath)) { - CLogMessage(this).error("XPlane '%1' - '%2': package not found.") << path << lineNum; + CLogMessage(this).error(u"XPlane '%1' - '%2': package not found.") << path << lineNum; return false; } QFileInfo fileInfo(absoluteTexPath); if (!fileInfo.exists()) { - CLogMessage(this).error("XPlane texture '%1' does not exist.") << absoluteTexPath; + CLogMessage(this).error(u"XPlane texture '%1' does not exist.") << absoluteTexPath; return false; } @@ -559,7 +559,7 @@ namespace BlackMisc // ICAO if (tokens.size() != 2) { - CLogMessage(this).error("XPlane '%1' - '%2': ICAO command requires 1 argument.") << path << lineNum; + CLogMessage(this).error(u"XPlane '%1' - '%2': ICAO command requires 1 argument.") << path << lineNum; return false; } @@ -573,7 +573,7 @@ namespace BlackMisc // AIRLINE if (tokens.size() != 3) { - CLogMessage(this).error("XPlane '%1' - '%2': AIRLINE command requires 2 arguments.") << path << lineNum; + CLogMessage(this).error(u"XPlane '%1' - '%2': AIRLINE command requires 2 arguments.") << path << lineNum; return false; } @@ -589,7 +589,7 @@ namespace BlackMisc // LIVERY if (tokens.size() != 4) { - CLogMessage(this).error("XPlane '%1' - '%2': LIVERY command requires 3 arguments.") << path << lineNum; + CLogMessage(this).error(u"XPlane '%1' - '%2': LIVERY command requires 3 arguments.") << path << lineNum; return false; } @@ -681,14 +681,14 @@ namespace BlackMisc bool result = it.value()(tokens, package, package.path, lineNum); if (!result) { - const CStatusMessage m = CStatusMessage(this).warning("XPlane ignoring CSL package '%1'") << package.name; + const CStatusMessage m = CStatusMessage(this).warning(u"XPlane ignoring CSL package '%1'") << package.name; m_loadingMessages.push_back(m); break; } } else { - const CStatusMessage m = CStatusMessage(this).warning("XPlane unrecognized command '%1' in '%2'") << tokens[0] << package.name; + const CStatusMessage m = CStatusMessage(this).warning(u"XPlane unrecognized command '%1' in '%2'") << tokens[0] << package.name; m_loadingMessages.push_back(m); break; } diff --git a/src/blackmisc/valuecache.cpp b/src/blackmisc/valuecache.cpp index d029f8628..c32cf33ef 100644 --- a/src/blackmisc/valuecache.cpp +++ b/src/blackmisc/valuecache.cpp @@ -373,33 +373,33 @@ namespace BlackMisc } if (! QDir::root().mkpath(dir)) { - return CStatusMessage(this).error("Failed to create directory '%1'") << dir; + return CStatusMessage(this).error(u"Failed to create directory '%1'") << dir; } for (auto it = namespaces.cbegin(); it != namespaces.cend(); ++it) { CAtomicFile file(dir + "/" + it.key() + ".json"); if (! QDir::root().mkpath(QFileInfo(file).path())) { - return CStatusMessage(this).error("Failed to create directory '%1'") << QFileInfo(file).path(); + return CStatusMessage(this).error(u"Failed to create directory '%1'") << QFileInfo(file).path(); } if (! file.open(QFile::ReadWrite | QFile::Text)) { - return CStatusMessage(this).error("Failed to open %1: %2") << file.fileName() << file.errorString(); + return CStatusMessage(this).error(u"Failed to open %1: %2") << file.fileName() << file.errorString(); } auto json = QJsonDocument::fromJson(file.readAll()); if (json.isArray() || (json.isNull() && ! json.isEmpty())) { - return CStatusMessage(this).error("Invalid JSON format in %1") << file.fileName(); + return CStatusMessage(this).error(u"Invalid JSON format in %1") << file.fileName(); } auto object = json.object(); json.setObject(it->mergeToMemoizedJson(object)); if (!(file.seek(0) && file.resize(0) && file.write(json.toJson()) > 0 && file.checkedClose())) { - return CStatusMessage(this).error("Failed to write to %1: %2") << file.fileName() << file.errorString(); + return CStatusMessage(this).error(u"Failed to write to %1: %2") << file.fileName() << file.errorString(); } } - return CStatusMessage(this).info("Written '%1' to value cache in '%2'") << + return CStatusMessage(this).info(u"Written '%1' to value cache in '%2'") << (keysMessage.isEmpty() ? values.keys().to().join(",") : keysMessage) << dir; } @@ -417,11 +417,11 @@ namespace BlackMisc { if (! QDir(dir).exists()) { - return CStatusMessage(this).warning("No such directory '%1'") << dir; + return CStatusMessage(this).warning(u"No such directory '%1'") << dir; } if (! QDir(dir).isReadable()) { - return CStatusMessage(this).error("Failed to read from directory '%1'") << dir; + return CStatusMessage(this).error(u"Failed to read from directory '%1'") << dir; } QMap keysInFiles; @@ -447,12 +447,12 @@ namespace BlackMisc } if (! file.open(QFile::ReadOnly | QFile::Text)) { - return CStatusMessage(this).error("Failed to open %1: %2") << file.fileName() << file.errorString(); + return CStatusMessage(this).error(u"Failed to open %1: %2") << file.fileName() << file.errorString(); } auto json = QJsonDocument::fromJson(file.readAll()); if (json.isArray() || (json.isNull() && ! json.isEmpty())) { - return CStatusMessage(this).error("Invalid JSON format in %1") << file.fileName(); + return CStatusMessage(this).error(u"Invalid JSON format in %1") << file.fileName(); } CVariantMap temp; @@ -475,7 +475,7 @@ namespace BlackMisc temp.removeDuplicates(currentValues); o_values.insert(temp, QFileInfo(file).lastModified().toMSecsSinceEpoch()); } - return CStatusMessage(this).info("Loaded cache values '%1' from '%2' '%3'") << + return CStatusMessage(this).info(u"Loaded cache values '%1' from '%2' '%3'") << (keysMessage.isEmpty() ? o_values.keys().to().join(",") : keysMessage) << dir << (ok ? "successfully" : "with errors"); } @@ -488,15 +488,15 @@ namespace BlackMisc if (QFile::exists(absolute)) { return; } if (! dir.mkpath(QFileInfo(relative).path())) { - CLogMessage(this).error("Failed to create %1") << QFileInfo(absolute).path(); + CLogMessage(this).error(u"Failed to create %1") << QFileInfo(absolute).path(); return; } if (! file.copy(absolute)) { - CLogMessage(this).error("Failed to back up %1: %2") << QFileInfo(file).fileName() << file.errorString(); + CLogMessage(this).error(u"Failed to back up %1: %2") << QFileInfo(file).fileName() << file.errorString(); return; } - CLogMessage(this).info("Backed up %1 to %2") << QFileInfo(file).fileName() << dir.absoluteFilePath("backups"); + CLogMessage(this).info(u"Backed up %1 to %2") << QFileInfo(file).fileName() << dir.absoluteFilePath("backups"); } void CValueCache::markAllAsSaved(const QString &keyPrefix) @@ -732,7 +732,7 @@ namespace BlackMisc emit valuesWantToCache({ { { element.m_key, value } }, timestamp, save }); } // All good info - status = CStatusMessage(this).info("Set value '%1'") << element.m_nameWithKey; + status = CStatusMessage(this).info(u"Set value '%1'") << element.m_nameWithKey; } return status; } @@ -842,11 +842,11 @@ namespace BlackMisc } else if (value.userType() != element.m_metaType) { - return CStatusMessage(this).error("Expected %1 but got %2 for %3") << QMetaType::typeName(element.m_metaType) << value.typeName() << element.m_nameWithKey; + return CStatusMessage(this).error(u"Expected %1 but got %2 for %3") << QMetaType::typeName(element.m_metaType) << value.typeName() << element.m_nameWithKey; } else if (element.m_validator && ! element.m_validator(value)) { - return CStatusMessage(this).error("%1 is not valid for %2") << value.toQString() << element.m_nameWithKey; + return CStatusMessage(this).error(u"%1 is not valid for %2") << value.toQString() << element.m_nameWithKey; } else { diff --git a/src/blackmisc/variant.cpp b/src/blackmisc/variant.cpp index c9d1b1ec4..844157f90 100644 --- a/src/blackmisc/variant.cpp +++ b/src/blackmisc/variant.cpp @@ -97,7 +97,7 @@ namespace BlackMisc } else { - CLogMessage(&a).warning("Comparing two CVariants containing unrelated value objects: %1 (%2) and %3 (%4)") + CLogMessage(&a).warning(u"Comparing two CVariants containing unrelated value objects: %1 (%2) and %3 (%4)") << a.typeName() << a.userType() << b.typeName() << b.userType(); return 0; } @@ -148,7 +148,7 @@ namespace BlackMisc } else { - CLogMessage(this).warning("Unsupported CVariant type for toJson: %1 (%2)") << typeName() << userType(); + CLogMessage(this).warning(u"Unsupported CVariant type for toJson: %1 (%2)") << typeName() << userType(); } } catch (const Private::CVariantException &ex) @@ -335,7 +335,7 @@ namespace BlackMisc } else { - CLogMessage(this).warning("Unsupported CVariant type for getValueHash: %1 (%2)") << typeName() << userType(); + CLogMessage(this).warning(u"Unsupported CVariant type for getValueHash: %1 (%2)") << typeName() << userType(); return 0; } } @@ -475,7 +475,7 @@ namespace BlackMisc { if (localUserType == static_cast(QVariant::Invalid)) { - CLogMessage(&variant).warning("Invalid type for unmarshall: %1") << typeName; + CLogMessage(&variant).warning(u"Invalid type for unmarshall: %1") << typeName; } // my business? diff --git a/src/blackmisc/verify.cpp b/src/blackmisc/verify.cpp index f4ae9c08b..c0d245288 100644 --- a/src/blackmisc/verify.cpp +++ b/src/blackmisc/verify.cpp @@ -66,11 +66,11 @@ namespace BlackMisc # endif if (context && message) { - CLogMessage(CLogCategory::verification()).warning("Failed to verify: %1 (%2 in %3) in %4 line %5") << condition << message << context << filename << line; + CLogMessage(CLogCategory::verification()).warning(u"Failed to verify: %1 (%2 in %3) in %4 line %5") << condition << message << context << filename << line; } else { - CLogMessage(CLogCategory::verification()).warning("Failed to verify: %1 in %2 line %3") << condition << filename << line; + CLogMessage(CLogCategory::verification()).warning(u"Failed to verify: %1 in %2 line %3") << condition << filename << line; } #endif } diff --git a/src/plugins/simulator/emulated/simulatoremulated.cpp b/src/plugins/simulator/emulated/simulatoremulated.cpp index 5000474a9..fa472bfb0 100644 --- a/src/plugins/simulator/emulated/simulatoremulated.cpp +++ b/src/plugins/simulator/emulated/simulatoremulated.cpp @@ -368,7 +368,7 @@ namespace BlackSimPlugin } else { - CLogMessage(this).validationError("No valid plugin for '%1'") << simulator.toQString(); + CLogMessage(this).validationError(u"No valid plugin for '%1'") << simulator.toQString(); } // update provider, own name, title diff --git a/src/plugins/simulator/emulated/simulatoremulatedmonitordialog.cpp b/src/plugins/simulator/emulated/simulatoremulatedmonitordialog.cpp index ecc730ed3..b131eacfe 100644 --- a/src/plugins/simulator/emulated/simulatoremulatedmonitordialog.cpp +++ b/src/plugins/simulator/emulated/simulatoremulatedmonitordialog.cpp @@ -249,7 +249,7 @@ namespace BlackSimPlugin } else { - CLogMessage(this).warning("Need a (valid) callsign to write a log"); + CLogMessage(this).warning(u"Need a (valid) callsign to write a log"); ok = true; // already a warning } } @@ -267,7 +267,7 @@ namespace BlackSimPlugin { Q_ASSERT_X(false, Q_FUNC_INFO, "Unhandled button"); } - if (!ok) { CLogMessage(this).warning("Cannot parse command for button: %1") << sender->objectName(); } + if (!ok) { CLogMessage(this).warning(u"Cannot parse command for button: %1") << sender->objectName(); } } void CSimulatorEmulatedMonitorDialog::enableInterpolationLogButtons(bool enable) diff --git a/src/plugins/simulator/fs9/directplaypeer.cpp b/src/plugins/simulator/fs9/directplaypeer.cpp index b99dff36c..05e4d1d44 100644 --- a/src/plugins/simulator/fs9/directplaypeer.cpp +++ b/src/plugins/simulator/fs9/directplaypeer.cpp @@ -132,7 +132,7 @@ namespace BlackSimPlugin // Copy the Host Address if (FAILED(hr = enumHostsResponseMsg->pAddressSender->Duplicate(hostNode.getHostAddressPtr()))) { - CLogMessage(this).warning("Failed to duplicate host address!"); + CLogMessage(this).warning(u"Failed to duplicate host address!"); return hr; } @@ -176,14 +176,14 @@ namespace BlackSimPlugin IID_IDirectPlay8Peer, reinterpret_cast(&m_directPlayPeer)))) { - CLogMessage(this).warning("Failed to create DirectPlay8Peer object!"); + CLogMessage(this).warning(u"Failed to create DirectPlay8Peer object!"); return hr; } // Init DirectPlay if (FAILED(hr = m_directPlayPeer->Initialize(&m_callbackWrapper, m_callbackWrapper.messageHandler, 0))) { - CLogMessage(this).warning("Failed to initialize directplay peer!"); + CLogMessage(this).warning(u"Failed to initialize directplay peer!"); return hr; } @@ -191,7 +191,7 @@ namespace BlackSimPlugin if (!isServiceProviderValid(&CLSID_DP8SP_TCPIP)) { hr = E_FAIL; - CLogMessage(this).warning("Service provider is invalid!"); + CLogMessage(this).warning(u"Service provider is invalid!"); return hr; } @@ -208,7 +208,7 @@ namespace BlackSimPlugin if (hr != DPNERR_BUFFERTOOSMALL) { - CLogMessage(this).warning("Failed to enumerate service providers!"); + CLogMessage(this).warning(u"Failed to enumerate service providers!"); return false; } @@ -219,7 +219,7 @@ namespace BlackSimPlugin if (FAILED(hr = m_directPlayPeer->EnumServiceProviders(&CLSID_DP8SP_TCPIP, nullptr, dpnSPInfo, &dwSize, &dwItems, 0))) { - CLogMessage(this).warning("Failed to enumerate service providers!"); + CLogMessage(this).warning(u"Failed to enumerate service providers!"); return false; } @@ -240,14 +240,14 @@ namespace BlackSimPlugin IID_IDirectPlay8Address, reinterpret_cast(&m_deviceAddress)))) { - CLogMessage(this).warning("Failed to create DirectPlay8Address instance!"); + CLogMessage(this).warning(u"Failed to create DirectPlay8Address instance!"); return hr; } // Set the SP for our Device Address if (FAILED(hr = m_deviceAddress->SetSP(&CLSID_DP8SP_TCPIP))) { - CLogMessage(this).warning("Failed to set SP!"); + CLogMessage(this).warning(u"Failed to set SP!"); return hr; } @@ -292,7 +292,7 @@ namespace BlackSimPlugin DPNSEND_SYNC | DPNSEND_NOLOOPBACK))) { const QString m(message); - CLogMessage(this).warning("DirectPlay: Failed to send message!"); + CLogMessage(this).warning(u"DirectPlay: Failed to send message!"); CLogMessage(this).debug() << m; } return hr; diff --git a/src/plugins/simulator/fs9/fs9host.cpp b/src/plugins/simulator/fs9/fs9host.cpp index 3e8cdc754..4ed3640d2 100644 --- a/src/plugins/simulator/fs9/fs9host.cpp +++ b/src/plugins/simulator/fs9/fs9host.cpp @@ -141,7 +141,7 @@ namespace BlackSimPlugin } else { - CLogMessage(this).info("Hosting successfully started"); + CLogMessage(this).info(u"Hosting successfully started"); m_hostStatus = Hosting; } @@ -171,7 +171,7 @@ namespace BlackSimPlugin if (m_hostStatus == Terminated) return hr; - CLogMessage(this).info("Hosting terminated!"); + CLogMessage(this).info(u"Hosting terminated!"); if (FAILED(hr = m_directPlayPeer->TerminateSession(nullptr, 0, 0))) { return logDirectPlayError(hr); diff --git a/src/plugins/simulator/fs9/simulatorfs9.cpp b/src/plugins/simulator/fs9/simulatorfs9.cpp index 1db3eee77..2f33746c6 100644 --- a/src/plugins/simulator/fs9/simulatorfs9.cpp +++ b/src/plugins/simulator/fs9/simulatorfs9.cpp @@ -87,7 +87,7 @@ namespace BlackSimPlugin FS_PBH pbhstrct; pbhstrct.pbh = positionVelocity.pbh; int pitch = qRound(std::floor(pbhstrct.pitch / CFs9Sdk::pitchMultiplier())); - if (pitch < -90 || pitch > 89) { CLogMessage().warning("FS9: Pitch value out of limits: %1") << pitch; } + if (pitch < -90 || pitch > 89) { CLogMessage().warning(u"FS9: Pitch value out of limits: %1") << pitch; } int bank = qRound(std::floor(pbhstrct.bank / CFs9Sdk::bankMultiplier())); // MSFS has inverted pitch and bank angles @@ -187,7 +187,7 @@ namespace BlackSimPlugin { emit aircraftRenderingChanged(remoteAircraftCopy); } - CLogMessage(this).info("FS9: Added aircraft %1") << callsign.toQString(); + CLogMessage(this).info(u"FS9: Added aircraft %1") << callsign.toQString(); return true; } @@ -199,7 +199,7 @@ namespace BlackSimPlugin fs9Client->quit(); m_hashFs9Clients.remove(callsign); updateAircraftRendered(callsign, false); - CLogMessage(this).info("FS9: Removed aircraft %1") << callsign.toQString(); + CLogMessage(this).info(u"FS9: Removed aircraft %1") << callsign.toQString(); return true; } @@ -453,7 +453,7 @@ namespace BlackSimPlugin if (m_isConnecting || isOk(m_lobbyClient->connectFs9ToHost(m_fs9Host->getHostAddress()))) { m_isConnecting = true; - CLogMessage(this).info("swift is joining FS9 to the multiplayer session..."); + CLogMessage(this).info(u"swift is joining FS9 to the multiplayer session..."); } } diff --git a/src/plugins/simulator/fscommon/fsuipcimpl.cpp b/src/plugins/simulator/fscommon/fsuipcimpl.cpp index fda78b6ce..883d72458 100644 --- a/src/plugins/simulator/fscommon/fsuipcimpl.cpp +++ b/src/plugins/simulator/fscommon/fsuipcimpl.cpp @@ -96,11 +96,11 @@ namespace BlackSimPlugin .arg(QLatin1Char(48 + (0x0f & (FSUIPC_Version >> 16)))) .arg((FSUIPC_Version & 0xffff) ? QString(QLatin1Char('a' + static_cast(FSUIPC_Version & 0xff) - 1)) : ""); m_fsuipcVersion = QStringLiteral("FSUIPC %1 (%2)").arg(ver, sim); - CLogMessage(this).info("FSUIPC connected: %1") << m_fsuipcVersion; + CLogMessage(this).info(u"FSUIPC connected: %1") << m_fsuipcVersion; } else { - CLogMessage(this).warning("FSUIPC opened, but verification failed"); + CLogMessage(this).warning(u"FSUIPC opened, but verification failed"); m_opened = false; FSUIPC_Close(); // under any circumstances close } @@ -110,7 +110,7 @@ namespace BlackSimPlugin const int index = static_cast(dwResult); m_lastErrorIndex = index; m_lastErrorMessage = CFsuipc::errorMessages().at(index); - CLogMessage(this).warning("FSUIPC not connected: %1") << m_lastErrorMessage; + CLogMessage(this).warning(u"FSUIPC not connected: %1") << m_lastErrorMessage; m_opened = false; FSUIPC_Close(); // under any circumstances close } @@ -123,7 +123,7 @@ namespace BlackSimPlugin Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe"); if (m_opened) { - CLogMessage(this).info("Closing FSUIPC: %1") << m_fsuipcVersion; + CLogMessage(this).info(u"Closing FSUIPC: %1") << m_fsuipcVersion; } FSUIPC_Close(); // Closing when it wasn't open is okay, so this is safe here m_closeCount++; @@ -345,7 +345,7 @@ namespace BlackSimPlugin m_openCount++; if (m_openCount < 10) { - CLogMessage(this).warning("Used FSUIPC open/close workaround"); + CLogMessage(this).warning(u"Used FSUIPC open/close workaround"); } } @@ -454,7 +454,7 @@ namespace BlackSimPlugin // MSFS has inverted pitch and bank angles pitchRaw = ~pitchRaw; bankRaw = ~bankRaw; - if (pitchRaw < -90 || pitchRaw > 89) { CLogMessage(this).warning("FSUIPC: Pitch value out of limits: %1") << pitchRaw; } + if (pitchRaw < -90 || pitchRaw > 89) { CLogMessage(this).warning(u"FSUIPC: Pitch value out of limits: %1") << pitchRaw; } // speeds, situation CAngle pitch = CAngle(pitchRaw, CAngleUnit::deg()); @@ -504,7 +504,7 @@ namespace BlackSimPlugin { m_lastErrorIndex = result; m_lastErrorMessage = CFsuipc::errorMessage(result); - CLogMessage(this).warning("FSUIPC read error '%1'") << m_lastErrorMessage; + CLogMessage(this).warning(u"FSUIPC read error '%1'") << m_lastErrorMessage; } return read; } diff --git a/src/plugins/simulator/fscommon/simulatorfscommon.cpp b/src/plugins/simulator/fscommon/simulatorfscommon.cpp index a2f5a63e9..afb9f6080 100644 --- a/src/plugins/simulator/fscommon/simulatorfscommon.cpp +++ b/src/plugins/simulator/fscommon/simulatorfscommon.cpp @@ -63,7 +63,7 @@ namespace BlackSimPlugin { const bool on = parser.toBool(2); const bool s = this->useFsuipc(on); - CLogMessage(this, CLogCategory::cmdLine()).info("FSUIPC is '%1'") << boolToOnOff(s); + CLogMessage(this, CLogCategory::cmdLine()).info(u"FSUIPC is '%1'") << boolToOnOff(s); return s; } return CSimulatorPluginCommon::parseDetails(parser); diff --git a/src/plugins/simulator/fsxcommon/simconnectdatadefinition.cpp b/src/plugins/simulator/fsxcommon/simconnectdatadefinition.cpp index 79dda1aee..c2f916e85 100644 --- a/src/plugins/simulator/fsxcommon/simconnectdatadefinition.cpp +++ b/src/plugins/simulator/fsxcommon/simconnectdatadefinition.cpp @@ -125,7 +125,7 @@ namespace BlackSimPlugin hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataOwnAircraftTitle, "TITLE", nullptr, SIMCONNECT_DATATYPE_STRING256); if (isFailure(hr)) { - CLogMessage(static_cast(nullptr)).error("SimConnect error: initOwnAircraft %1") << hr; + CLogMessage(static_cast(nullptr)).error(u"SimConnect error: initOwnAircraft %1") << hr; } return hr; } @@ -170,7 +170,7 @@ namespace BlackSimPlugin if (isFailure(hr)) { - CLogMessage(static_cast(nullptr)).error("SimConnect error: initRemoteAircraftSituation %1") << hr; + CLogMessage(static_cast(nullptr)).error(u"SimConnect error: initRemoteAircraftSituation %1") << hr; } return hr; } @@ -185,7 +185,7 @@ namespace BlackSimPlugin hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataRemoteAircraftGetPosition, "STATIC CG TO GROUND", "Feet"); if (isFailure(hr)) { - CLogMessage(static_cast(nullptr)).error("SimConnect error: initRemoteAircraftSimData DataRemoteAircraftGetPosition %1") << hr; + CLogMessage(static_cast(nullptr)).error(u"SimConnect error: initRemoteAircraftSimData DataRemoteAircraftGetPosition %1") << hr; } hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataRemoteAircraftModelData, "STATIC CG TO GROUND", "Feet"); @@ -197,7 +197,7 @@ namespace BlackSimPlugin hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataRemoteAircraftModelData, "TITLE", nullptr, SIMCONNECT_DATATYPE_STRING256); if (isFailure(hr)) { - CLogMessage(static_cast(nullptr)).error("SimConnect error: initRemoteAircraftSimData DataRemoteAircraftModelData %1") << hr; + CLogMessage(static_cast(nullptr)).error(u"SimConnect error: initRemoteAircraftSimData DataRemoteAircraftModelData %1") << hr; } return hr; @@ -210,7 +210,7 @@ namespace BlackSimPlugin hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataSimEnvironment, "LOCAL TIME", "", SIMCONNECT_DATATYPE_INT32); if (isFailure(hr)) { - CLogMessage(static_cast(nullptr)).error("SimConnect error: initSimulatorEnvironment %1") << hr; + CLogMessage(static_cast(nullptr)).error(u"SimConnect error: initSimulatorEnvironment %1") << hr; } return hr; } @@ -224,7 +224,7 @@ namespace BlackSimPlugin hr += SimConnect_MapClientDataNameToID(hSimConnect, "SquawkBox Data", ClientAreaSquawkBox); if (isFailure(hr)) { - CLogMessage(static_cast(nullptr)).error("SimConnect error: SimConnect_MapClientDataNameToID %1") << hr; + CLogMessage(static_cast(nullptr)).error(u"SimConnect error: SimConnect_MapClientDataNameToID %1") << hr; return hr; } @@ -232,7 +232,7 @@ namespace BlackSimPlugin hr += SimConnect_CreateClientData(hSimConnect, ClientAreaSquawkBox, sbSize, SIMCONNECT_CREATE_CLIENT_DATA_FLAG_DEFAULT); if (isFailure(hr)) { - CLogMessage(static_cast(nullptr)).error("SimConnect error: SimConnect_CreateClientData %1") << hr; + CLogMessage(static_cast(nullptr)).error(u"SimConnect error: SimConnect_CreateClientData %1") << hr; return hr; } @@ -245,7 +245,7 @@ namespace BlackSimPlugin if (isFailure(hr)) { - CLogMessage(static_cast(nullptr)).error("SimConnect error: SB data area data definitions %1") << hr; + CLogMessage(static_cast(nullptr)).error(u"SimConnect error: SB data area data definitions %1") << hr; return hr; } @@ -257,7 +257,7 @@ namespace BlackSimPlugin hr += SimConnect_SetClientData(hSimConnect, ClientAreaSquawkBox, CSimConnectDefinitions::DataClientAreaSbRunning, SIMCONNECT_CLIENT_DATA_SET_FLAG_DEFAULT, 0, 1, &sbRunning); if (isFailure(hr)) { - CLogMessage(static_cast(nullptr)).error("SimConnect error: SimConnect_SetClientData %1") << hr; + CLogMessage(static_cast(nullptr)).error(u"SimConnect error: SimConnect_SetClientData %1") << hr; } return hr; } diff --git a/src/plugins/simulator/fsxcommon/simconnectsettingscomponent.cpp b/src/plugins/simulator/fsxcommon/simconnectsettingscomponent.cpp index 391bfae91..2507003e3 100644 --- a/src/plugins/simulator/fsxcommon/simconnectsettingscomponent.cpp +++ b/src/plugins/simulator/fsxcommon/simconnectsettingscomponent.cpp @@ -207,7 +207,7 @@ namespace BlackSimPlugin { const bool written = CFileUtils::writeStringToFile(iniFile, fileName); if (!written && madeDir) { d.removeRecursively(); } // clean up own created dir - if (written) { CLogMessage(this).info("Written '%1'") << fileName; } + if (written) { CLogMessage(this).info(u"Written '%1'") << fileName; } } // always refresh info, as the dialog can also be used to delete the file this->setSimConnectInfo(); @@ -259,7 +259,7 @@ namespace BlackSimPlugin const CStatusMessage saveMsg = m_p3dVersion.setAndSave(version); if (saveMsg.isSuccess()) { - const CStatusMessage m = CStatusMessage(this).info("Changed P3D version to '%1'. Requires a new start of swift to become effective!") << version; + const CStatusMessage m = CStatusMessage(this).info(u"Changed P3D version to '%1'. Requires a new start of swift to become effective!") << version; this->showOverlayMessage(m); } } diff --git a/src/plugins/simulator/fsxcommon/simconnectsymbols.cpp b/src/plugins/simulator/fsxcommon/simconnectsymbols.cpp index 419ff3f67..ae53a040f 100644 --- a/src/plugins/simulator/fsxcommon/simconnectsymbols.cpp +++ b/src/plugins/simulator/fsxcommon/simconnectsymbols.cpp @@ -120,7 +120,7 @@ bool resolveSimConnectSymbol(QLibrary &library, FuncPtr &funcPtr, const char *fu funcPtr = reinterpret_cast(library.resolve(funcName)); if (! funcPtr) { - CLogMessage(CLogCategory::driver()).error("Failed to resolve %1: %2") << funcName << library.errorString(); + CLogMessage(CLogCategory::driver()).error(u"Failed to resolve %1: %2") << funcName << library.errorString(); return false; } return true; @@ -211,21 +211,21 @@ bool loadAndResolveP3DSimConnect(P3DSimConnectVersion version) const bool resolvedP3DSimConnectSymbols = resolveP3DSimConnectSymbols(simConnectDll); if (!resolvedCommon) { - CLogMessage(CLogCategory::driver()).error("Failed to resolve common symbols from SimConnect.dll: '%1'") << simConnectFileName; + CLogMessage(CLogCategory::driver()).error(u"Failed to resolve common symbols from SimConnect.dll: '%1'") << simConnectFileName; return false; } if (!resolvedP3DSimConnectSymbols) { - CLogMessage(CLogCategory::driver()).error("Failed to resolve P3D symbols from SimConnect.dll: '%1'") << simConnectFileName; + CLogMessage(CLogCategory::driver()).error(u"Failed to resolve P3D symbols from SimConnect.dll: '%1'") << simConnectFileName; return false; } - CLogMessage(CLogCategory::driver()).info("Loaded and resolved P3D symbols from SimConnect.dll: '%1'") << simConnectFileName; + CLogMessage(CLogCategory::driver()).info(u"Loaded and resolved P3D symbols from SimConnect.dll: '%1'") << simConnectFileName; return resolvedCommon && resolvedP3DSimConnectSymbols; } else { - CLogMessage(CLogCategory::driver()).error("Failed to load SimConnect.dll: '%1' '%2'") << simConnectFileName << simConnectDll.errorString(); + CLogMessage(CLogCategory::driver()).error(u"Failed to load SimConnect.dll: '%1' '%2'") << simConnectFileName << simConnectDll.errorString(); return false; } } @@ -289,7 +289,7 @@ bool loadAndResolveFsxSimConnect(bool manifestProbing) } else { - CLogMessage(CLogCategory::driver()).error("Failed to load SimConnect.dll: %1") << simConnectDll.errorString(); + CLogMessage(CLogCategory::driver()).error(u"Failed to load SimConnect.dll: %1") << simConnectDll.errorString(); return false; } } diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp index b0cd37ef3..edf3de37f 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp @@ -207,7 +207,7 @@ namespace BlackSimPlugin if (isFailure(hr)) { this->triggerAutoTraceSendId(); - CLogMessage(this).warning("Setting transponder mode failed (SB offsets)"); + CLogMessage(this).warning(u"Setting transponder mode failed (SB offsets)"); } changed = true; } @@ -276,9 +276,9 @@ namespace BlackSimPlugin CStatusMessageList msgs; if (!CBuildConfig::isLocalDeveloperDebugBuild()) { return msgs; } msgs = CSimulatorFsCommon::debugVerifyStateAfterAllAircraftRemoved(); - if (!m_simConnectObjects.isEmpty()) { msgs.push_back(CStatusMessage(this).error("m_simConnectObjects not empty: '%1'") << m_simConnectObjects.getAllCallsignStringsAsString(true)); } - if (!m_simConnectObjectsPositionAndPartsTraces.isEmpty()) { msgs.push_back(CStatusMessage(this).error("m_simConnectObjectsPositionAndPartsTraces not empty: '%1'") << m_simConnectObjectsPositionAndPartsTraces.getAllCallsignStringsAsString(true)); } - if (!m_addAgainAircraftWhenRemoved.isEmpty()) { msgs.push_back(CStatusMessage(this).error("m_addAgainAircraftWhenRemoved not empty: '%1'") << m_addAgainAircraftWhenRemoved.getCallsignStrings(true).join(", ")); } + if (!m_simConnectObjects.isEmpty()) { msgs.push_back(CStatusMessage(this).error(u"m_simConnectObjects not empty: '%1'") << m_simConnectObjects.getAllCallsignStringsAsString(true)); } + if (!m_simConnectObjectsPositionAndPartsTraces.isEmpty()) { msgs.push_back(CStatusMessage(this).error(u"m_simConnectObjectsPositionAndPartsTraces not empty: '%1'") << m_simConnectObjectsPositionAndPartsTraces.getAllCallsignStringsAsString(true)); } + if (!m_addAgainAircraftWhenRemoved.isEmpty()) { msgs.push_back(CStatusMessage(this).error(u"m_addAgainAircraftWhenRemoved not empty: '%1'") << m_addAgainAircraftWhenRemoved.getCallsignStrings(true).join(", ")); } return msgs; } @@ -369,7 +369,7 @@ namespace BlackSimPlugin HRESULT hr = SimConnect_SetClientData(m_hSimConnect, ClientAreaSquawkBox, CSimConnectDefinitions::DataClientAreaSbConnected, SIMCONNECT_CLIENT_DATA_SET_FLAG_DEFAULT, 0, 1, &sbNetworkConnected); if (isFailure(hr)) { - CLogMessage(this).warning("Setting network connected failed (SB offsets)"); + CLogMessage(this).warning(u"Setting network connected failed (SB offsets)"); } ISimulator::setFlightNetworkConnected(connected); @@ -472,7 +472,7 @@ namespace BlackSimPlugin void CSimulatorFsxCommon::onSimStopped() { // stopping events in FSX: Load menu, weather and season - CLogMessage(this).info("Simulator stopped: %1") << this->getSimulatorDetails(); + CLogMessage(this).info(u"Simulator stopped: %1") << this->getSimulatorDetails(); const SimulatorStatus oldStatus = this->getSimulatorStatus(); m_simSimulating = false; m_simulatingChangedTs = QDateTime::currentMSecsSinceEpoch(); @@ -493,7 +493,7 @@ namespace BlackSimPlugin void CSimulatorFsxCommon::onSimExit() { - CLogMessage(this).info("Simulator exit: %1") << this->getSimulatorDetails(); + CLogMessage(this).info(u"Simulator exit: %1") << this->getSimulatorDetails(); // reset complete state, we are going down m_simulatingChangedTs = QDateTime::currentMSecsSinceEpoch(); @@ -582,7 +582,7 @@ namespace BlackSimPlugin static const QString format("hh:mm:ss.zzz"); const QString untilString = QDateTime::fromMSecsSinceEpoch(traceUntil).toString(format); - CLogMessage(this).info("Triggered auto trace until %1") << untilString; + CLogMessage(this).info(u"Triggered auto trace until %1") << untilString; const QPointer myself(this); QTimer::singleShot(traceTimeMs * 1.2, this, [ = ] { @@ -590,7 +590,7 @@ namespace BlackSimPlugin if (!myself) { return; } if (m_traceAutoUntilTs > QDateTime::currentMSecsSinceEpoch()) { return; } if (m_traceAutoUntilTs < 0) { return; } // alread off - CLogMessage(this).info("Auto trace id off"); + CLogMessage(this).info(u"Auto trace id off"); m_traceAutoUntilTs = -1; }); return true; @@ -607,7 +607,7 @@ namespace BlackSimPlugin if (simulatorOwnAircraft.pitch < -90.0 || simulatorOwnAircraft.pitch >= 90.0) { - CLogMessage(this).warning("FSX: Pitch value (own aircraft) out of limits: %1") << simulatorOwnAircraft.pitch; + CLogMessage(this).warning(u"FSX: Pitch value (own aircraft) out of limits: %1") << simulatorOwnAircraft.pitch; } CAircraftSituation aircraftSituation; aircraftSituation.setMSecsSinceEpoch(ts); @@ -884,7 +884,7 @@ namespace BlackSimPlugin // no callsign if (callsign.isEmpty()) { - msg = CLogMessage(this).error("Cannot confirm AI object, empty callsign"); + msg = CLogMessage(this).error(u"Cannot confirm AI object, empty callsign"); break; } @@ -894,12 +894,12 @@ namespace BlackSimPlugin { if (aircraftStillInRange) { - msg = CLogMessage(this).warning("Callsign '%1' removed in meantime from AI objects, but still in range") << callsign.toQString(); + msg = CLogMessage(this).warning(u"Callsign '%1' removed in meantime from AI objects, but still in range") << callsign.toQString(); } else { this->removeFromAddPendingAndAddAgainAircraft(callsign); - msg = CLogMessage(this).info("Callsign '%1' removed in meantime and no longer in range") << callsign.toQString(); + msg = CLogMessage(this).info(u"Callsign '%1' removed in meantime and no longer in range") << callsign.toQString(); } break; } @@ -909,7 +909,7 @@ namespace BlackSimPlugin if (!simObject.hasValidRequestAndObjectId() || simObject.isPendingRemoved()) { - msg = CStatusMessage(this).warning("Object for callsign '%1'/id: %2 removed in meantime/invalid") << callsign.toQString() << simObject.getObjectId(); + msg = CStatusMessage(this).warning(u"Object for callsign '%1'/id: %2 removed in meantime/invalid") << callsign.toQString() << simObject.getObjectId(); break; } @@ -919,7 +919,7 @@ namespace BlackSimPlugin if (!released) { - msg = CStatusMessage(this).error("Cannot confirm model '%1' %2") << remoteAircraft.getModelString() << simObject.toQString(); + msg = CStatusMessage(this).error(u"Cannot confirm model '%1' %2") << remoteAircraft.getModelString() << simObject.toQString(); break; } @@ -942,7 +942,7 @@ namespace BlackSimPlugin } else { - CLogMessage(this).warning("Verified aircraft '%1' model '%2', request/object id: %3 %4 was already marked rendered") << callsign.asString() << remoteAircraft.getModelString() << simObject.getRequestId() << simObject.getObjectId(); + CLogMessage(this).warning(u"Verified aircraft '%1' model '%2', request/object id: %3 %4 was already marked rendered") << callsign.asString() << remoteAircraft.getModelString() << simObject.getRequestId() << simObject.getObjectId(); } } while (false); @@ -970,7 +970,7 @@ namespace BlackSimPlugin m_simConnectObjects.removeByOtherSimObject(simObject); this->removeFromAddPendingAndAddAgainAircraft(simObject.getCallsign()); - CLogMessage(this).warning("Model failed to be added: '%1' details: %2") << simObject.getAircraftModelString() << simObject.getAircraft().toQString(true); + CLogMessage(this).warning(u"Model failed to be added: '%1' details: %2") << simObject.getAircraftModelString() << simObject.getAircraft().toQString(true); CStatusMessage verifyMsg; const bool canBeUsed = this->verifyFailedAircraftInfo(simObject, verifyMsg); // aircraft.cfg existing? if (!verifyMsg.isEmpty()) { CLogMessage::preformatted(verifyMsg); } @@ -978,14 +978,14 @@ namespace BlackSimPlugin if (!canBeUsed || simObject.getAddingExceptions() >= ThresholdAddException) { const CStatusMessage m = !canBeUsed ? - CLogMessage(this).warning("Model '%1' %2 failed verification and will be disabled") << simObject.getAircraftModelString() << simObject.toQString() : - CLogMessage(this).warning("Model '%1' %2 failed %3 time(s) before and will be disabled") << simObject.getAircraftModelString() << simObject.toQString() << simObject.getAddingExceptions(); + CLogMessage(this).warning(u"Model '%1' %2 failed verification and will be disabled") << simObject.getAircraftModelString() << simObject.toQString() : + CLogMessage(this).warning(u"Model '%1' %2 failed %3 time(s) before and will be disabled") << simObject.getAircraftModelString() << simObject.toQString() << simObject.getAddingExceptions(); this->updateAircraftEnabled(simObject.getCallsign(), false); // disable emit this->physicallyAddingRemoteModelFailed(simObject.getAircraft(), true, m); } else { - CLogMessage(this).info("Will try '%1' again, aircraft: %2") << simObject.getAircraftModelString() << simObject.getAircraft().toQString(true); + CLogMessage(this).info(u"Will try '%1' again, aircraft: %2") << simObject.getAircraftModelString() << simObject.getAircraft().toQString(true); CSimConnectObject simObjAddAgain(simObject); simObjAddAgain.increaseAddingExceptions(); @@ -1018,18 +1018,18 @@ namespace BlackSimPlugin { if (entries.containsTitle(model.getModelString())) { - messages.push_back(CStatusMessage(this).info("Model '%1' exists in re-parsed file '%2'.") << model.getModelString() << model.getFileName()); + messages.push_back(CStatusMessage(this).info(u"Model '%1' exists in re-parsed file '%2'.") << model.getModelString() << model.getFileName()); canBeUsed = true; // all OK } else { - messages.push_back(CStatusMessage(this).warning("Model '%1' no longer in re-parsed file '%2'. Models are: %3.") << model.getModelString() << model.getFileName() << entries.getTitlesAsString(true)); + messages.push_back(CStatusMessage(this).warning(u"Model '%1' no longer in re-parsed file '%2'. Models are: %3.") << model.getModelString() << model.getFileName() << entries.getTitlesAsString(true)); canBeUsed = false; // absolute no chance to use that one } } else { - messages.push_back(CStatusMessage(this).warning("CS: '%1' Cannot parse file: '%2' (existing: %3)") << model.getCallsign().asString() << model.getFileName() << boolToYesNo(model.hasExistingCorrespondingFile())); + messages.push_back(CStatusMessage(this).warning(u"CS: '%1' Cannot parse file: '%2' (existing: %3)") << model.getCallsign().asString() << model.getFileName() << boolToYesNo(model.hasExistingCorrespondingFile())); } } else @@ -1065,7 +1065,7 @@ namespace BlackSimPlugin simObject.setConfirmedAdded(true); // terrain probe simObject.resetTimestampToNow(); cs = simObject.getCallsign(); - CLogMessage(this).info("Probe: '%1' '%2' confirmed, %3") << simObject.getCallsignAsString() << simObject.getAircraftModelString() << simObject.toQString(); + CLogMessage(this).info(u"Probe: '%1' '%2' confirmed, %3") << simObject.getCallsignAsString() << simObject.getAircraftModelString() << simObject.toQString(); // fails for probe // SIMCONNECT_DATA_REQUEST_ID requestId = this->obtainRequestIdForSimObjTerrainProbe(); @@ -1075,7 +1075,7 @@ namespace BlackSimPlugin if (!verified) { - CLogMessage(this).info("Disable probes: '%1' failed to relase control") << cs.asString(); + CLogMessage(this).info(u"Disable probes: '%1' failed to relase control") << cs.asString(); m_useFsxTerrainProbe = false; } @@ -1137,7 +1137,7 @@ namespace BlackSimPlugin } else { - CLogMessage(this).warning("Pending aircraft without model string will be removed"); + CLogMessage(this).warning(u"Pending aircraft without model string will be removed"); m_addPendingAircraft.removeByOtherSimObject(oldestSimObject); } } @@ -1187,19 +1187,19 @@ namespace BlackSimPlugin m_simConnectObjects.removeByOtherSimObject(simObject); // we have it in pending now, no need to keep it in this list const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(callsign); - msg = CLogMessage(this).warning("Aircraft removed, '%1' '%2' object id '%3' out of reality bubble or other reason. Interpolator: '%4'") + msg = CLogMessage(this).warning(u"Aircraft removed, '%1' '%2' object id '%3' out of reality bubble or other reason. Interpolator: '%4'") << callsign.toQString() << simObject.getAircraftModelString() << objectID << simObject.getInterpolatorInfo(setup.getInterpolatorMode()); } else if (simObject.getAddingDirectlyRemoved() < ThresholdAddedAndDirectlyRemoved) { - const CStatusMessage m = CLogMessage(this).warning("Aircraft removed again multiple times and will be disabled, '%1' '%2' object id '%3'") << callsign.toQString() << simObject.getAircraftModelString() << objectID; + const CStatusMessage m = CLogMessage(this).warning(u"Aircraft removed again multiple times and will be disabled, '%1' '%2' object id '%3'") << callsign.toQString() << simObject.getAircraftModelString() << objectID; this->updateAircraftEnabled(simObject.getCallsign(), false); emit this->physicallyAddingRemoteModelFailed(simObject.getAircraft(), true, m); } else { - msg = CLogMessage(this).warning("Removed '%1' from simulator, but was not initiated by us (swift): %1 '%2' object id %3") << callsign.toQString() << simObject.getAircraftModelString() << objectID; + msg = CLogMessage(this).warning(u"Removed '%1' from simulator, but was not initiated by us (swift): %1 '%2' object id %3") << callsign.toQString() << simObject.getAircraftModelString() << objectID; } // in all cases add verification details @@ -1272,7 +1272,7 @@ namespace BlackSimPlugin { const bool trace = parser.toBool(2); this->setTraceSendId(trace); - CLogMessage(this, CLogCategory::cmdLine()).info("Tracing %1 driver sendIds is '%2'") << this->getSimulatorPluginInfo().getIdentifier() << boolToOnOff(trace); + CLogMessage(this, CLogCategory::cmdLine()).info(u"Tracing %1 driver sendIds is '%2'") << this->getSimulatorPluginInfo().getIdentifier() << boolToOnOff(trace); return true; } @@ -1281,7 +1281,7 @@ namespace BlackSimPlugin { const bool on = parser.toBool(2); this->setUsingSbOffsetValues(on); - CLogMessage(this, CLogCategory::cmdLine()).info("SB offsets is '%1'") << boolToOnOff(on); + CLogMessage(this, CLogCategory::cmdLine()).info(u"SB offsets is '%1'") << boolToOnOff(on); return true; } @@ -1354,12 +1354,12 @@ namespace BlackSimPlugin { // 2nd time, an error / avoid multiple messages // idea: if it happens once ignore - CLogMessage(this).error("%1: Dispatch error") << this->getSimulatorPluginInfo().getIdentifier(); + CLogMessage(this).error(u"%1: Dispatch error") << this->getSimulatorPluginInfo().getIdentifier(); } else if (m_dispatchErrors > 5) { // this normally happens during a FSX crash or shutdown with simconnect - CLogMessage(this).error("%1: Multiple dispatch errors, disconnecting") << this->getSimulatorPluginInfo().getIdentifier(); + CLogMessage(this).error(u"%1: Multiple dispatch errors, disconnecting") << this->getSimulatorPluginInfo().getIdentifier(); this->disconnectFrom(); } return; @@ -1405,7 +1405,7 @@ namespace BlackSimPlugin if (!outdatedAdded.isEmpty()) { const CCallsignSet callsigns = outdatedAdded.getAllCallsigns(false); - CLogMessage(this).warning("Removed %1 outdated objects pending for added: %2") << outdatedAdded.size() << callsigns.getCallsignsAsString(true); + CLogMessage(this).warning(u"Removed %1 outdated objects pending for added: %2") << outdatedAdded.size() << callsigns.getCallsignsAsString(true); this->updateMultipleAircraftEnabled(callsigns, false); static const QString msgText("%1 oudated adding, %2"); @@ -1441,7 +1441,7 @@ namespace BlackSimPlugin // same model, nothing will change, otherwise add again when removed if (sameModel) { - CLogMessage(this).info("CS: '%1' re-added same model '%2'") << newRemoteAircraft.getCallsignAsString() << newModelString; + CLogMessage(this).info(u"CS: '%1' re-added same model '%2'") << newRemoteAircraft.getCallsignAsString() << newModelString; // we restore rendered flag in case we are sure we are rendered // this is used with rematching @@ -1464,12 +1464,12 @@ namespace BlackSimPlugin const CAircraftSituationList situations(this->remoteAircraftSituations(callsign)); if (situations.isEmpty()) { - CLogMessage(this).warning("No valid situations for '%1', will be added as pending") << callsign.asString(); + CLogMessage(this).warning(u"No valid situations for '%1', will be added as pending") << callsign.asString(); canAdd = false; } else { - CLogMessage(this).warning("Invalid aircraft situation for new aircraft '%1', use closest situation") << callsign.asString(); + CLogMessage(this).warning(u"Invalid aircraft situation for new aircraft '%1', use closest situation") << callsign.asString(); situation = situations.findClosestTimeDistanceAdjusted(QDateTime::currentMSecsSinceEpoch()); Q_ASSERT_X(!situation.isPositionOrAltitudeNull(), Q_FUNC_INFO, "Invalid situation for new aircraft"); } @@ -1480,7 +1480,7 @@ namespace BlackSimPlugin if (CBuildConfig::isLocalDeveloperDebugBuild()) { BLACK_VERIFY_X(invalidSituation, Q_FUNC_INFO, "Expect valid situation"); - CLogMessage(this).warning("Invalid situation for '%1'") << callsign; + CLogMessage(this).warning(u"Invalid situation for '%1'") << callsign; } } @@ -1499,7 +1499,7 @@ namespace BlackSimPlugin // create AI after crosschecking it if (!probe && !this->isAircraftInRange(callsign)) { - CLogMessage(this).info("Skipping adding of '%1' since it is no longer in range") << callsign.asString(); + CLogMessage(this).info(u"Skipping adding of '%1' since it is no longer in range") << callsign.asString(); return false; } @@ -1540,12 +1540,12 @@ namespace BlackSimPlugin if (!underflowStatus.isEmpty()) { - CStatusMessage(this).warning("Underflow detecion for '%1', details '%2'") << callsign.asString() << underflowStatus.getMessage(); + CStatusMessage(this).warning(u"Underflow detecion for '%1', details '%2'") << callsign.asString() << underflowStatus.getMessage(); } if (isFailure(hr)) { - const CStatusMessage msg = CStatusMessage(this).error("SimConnect, can not create AI traffic: '%1' '%2'") << callsign.toQString() << modelString; + const CStatusMessage msg = CStatusMessage(this).error(u"SimConnect, can not create AI traffic: '%1' '%2'") << callsign.toQString() << modelString; CLogMessage::preformatted(msg); emit this->physicallyAddingRemoteModelFailed(newRemoteAircraft, true, msg); } @@ -1600,7 +1600,7 @@ namespace BlackSimPlugin if (this->physicallyAddAITerrainProbe(coordinate, n)) { c++; } } - CLogMessage(this).info("Adding %1 FSX terrain probes") << number; + CLogMessage(this).info(u"Adding %1 FSX terrain probes") << number; m_addedProbes = c; return c; } @@ -1628,7 +1628,7 @@ namespace BlackSimPlugin { // problem: we try to delete an aircraft just requested to be added // best solution so far, call remove again with a delay - CLogMessage(this).warning("'%1' requested to be removed, but pending added (%2) / or pending lights(%3). Object will be removed again: %4") + CLogMessage(this).warning(u"'%1' requested to be removed, but pending added (%2) / or pending lights(%3). Object will be removed again: %4") << callsign.asString() << boolToYesNo(pendingAdded) << boolToYesNo(stillWaitingForLights) << simObject.toQString(); simObject.setRemovedWhileAdding(true); // next time kill @@ -1636,7 +1636,7 @@ namespace BlackSimPlugin QTimer::singleShot(2000, this, [ = ] { if (!myself) { return; } - CLogMessage(this).info("Next trail to remove '%1'") << callsign.asString(); + CLogMessage(this).info(u"Next trail to remove '%1'") << callsign.asString(); myself->physicallyRemoveRemoteAircraft(callsign); }); return false; // not yet deleted @@ -1660,7 +1660,7 @@ namespace BlackSimPlugin } else { - CLogMessage(this).warning("Removing aircraft '%1' from simulator failed") << callsign.asString(); + CLogMessage(this).warning(u"Removing aircraft '%1' from simulator failed") << callsign.asString(); } // mark in provider @@ -1711,7 +1711,7 @@ namespace BlackSimPlugin hr += SimConnect_SubscribeToSystemEvent(m_hSimConnect, SystemEventFlightLoaded, "FlightLoaded"); if (isFailure(hr)) { - CLogMessage(this).error("FSX plugin error: %1") << "SimConnect_SubscribeToSystemEvent failed"; + CLogMessage(this).error(u"FSX plugin error: %1") << "SimConnect_SubscribeToSystemEvent failed"; return hr; } @@ -1755,7 +1755,7 @@ namespace BlackSimPlugin if (isFailure(hr)) { - CLogMessage(this).error("FSX plugin error: %1") << "SimConnect_MapClientEventToSimEvent failed"; + CLogMessage(this).error(u"FSX plugin error: %1") << "SimConnect_MapClientEventToSimEvent failed"; return hr; } @@ -1764,7 +1764,7 @@ namespace BlackSimPlugin hr += SimConnect_SubscribeToFacilities(m_hSimConnect, SIMCONNECT_FACILITY_LIST_TYPE_AIRPORT, requestId); if (isFailure(hr)) { - CLogMessage(this).error("FSX plugin error: %1") << "SimConnect_SubscribeToFacilities failed"; + CLogMessage(this).error(u"FSX plugin error: %1") << "SimConnect_SubscribeToFacilities failed"; return hr; } return hr; @@ -1782,7 +1782,7 @@ namespace BlackSimPlugin HRESULT hr = this->initEvents(); if (isFailure(hr)) { - CLogMessage(this).error("FSX plugin: initEvents failed"); + CLogMessage(this).error(u"FSX plugin: initEvents failed"); return hr; } @@ -1790,7 +1790,7 @@ namespace BlackSimPlugin hr += this->initDataDefinitionsWhenConnected(); if (isFailure(hr)) { - CLogMessage(this).error("FSX plugin: initDataDefinitionsWhenConnected failed"); + CLogMessage(this).error(u"FSX plugin: initDataDefinitionsWhenConnected failed"); return hr; } @@ -2088,7 +2088,7 @@ namespace BlackSimPlugin if (position.Airspeed < 2) { position.OnGround = 1U; - if (details) { *details = CStatusMessage(getLogCategories()).warning("Force GND flag for underflow protection"); } + if (details) { *details = CStatusMessage(getLogCategories()).warning(u"Force GND flag for underflow protection"); } break; } } @@ -2193,12 +2193,12 @@ namespace BlackSimPlugin if (isFailure(hr1, hr2)) { - CLogMessage(this).warning("Sending time sync failed!"); + CLogMessage(this).warning(u"Sending time sync failed!"); } else { m_syncTimeDeferredCounter = 5; // allow some time to sync - CLogMessage(this).info("Synchronized time to UTC: '%1'") << myTime.toString(); + CLogMessage(this).info(u"Synchronized time to UTC: '%1'") << myTime.toString(); } } @@ -2474,7 +2474,7 @@ namespace BlackSimPlugin } else { - CLogMessage(this).warning("Removing probe '%1' from simulator failed") << probeSimObject.getObjectId(); + CLogMessage(this).warning(u"Removing probe '%1' from simulator failed") << probeSimObject.getObjectId(); } } m_simConnectObjects.removeAllProbes(); @@ -2689,7 +2689,7 @@ namespace BlackSimPlugin simListener->m_simConnectVersion = QStringLiteral("%1.%2.%3.%4").arg(event->dwSimConnectVersionMajor).arg(event->dwSimConnectVersionMinor).arg(event->dwSimConnectBuildMajor).arg(event->dwSimConnectBuildMinor); simListener->m_simulatorName = CSimulatorFsxCommon::fsxCharToQString(event->szApplicationName); simListener->m_simulatorDetails = QStringLiteral("Name: '%1' Version: %2 SimConnect: %3").arg(simListener->m_simulatorName, simListener->m_simulatorVersion, simListener->m_simConnectVersion); - const CStatusMessage msg = CStatusMessage(simListener).info("Connect to %1: '%2'") << simListener->getPluginInfo().getIdentifier() << simListener->backendInfo(); + const CStatusMessage msg = CStatusMessage(simListener).info(u"Connect to %1: '%2'") << simListener->getPluginInfo().getIdentifier() << simListener->backendInfo(); // avoid the same message over and over again if (msg.getMessage() != simListener->m_lastMessage.getMessage()) diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxsimconnectproc.cpp b/src/plugins/simulator/fsxcommon/simulatorfsxsimconnectproc.cpp index 280e766db..ebd4bc5d4 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxsimconnectproc.cpp +++ b/src/plugins/simulator/fsxcommon/simulatorfsxsimconnectproc.cpp @@ -56,7 +56,7 @@ namespace BlackSimPlugin const QString details = QStringLiteral("Name: '%1' Version: %2 SimConnect: %3").arg(name, version, simConnectVersion); simulatorFsxP3D->setSimulatorDetails(name, details, version); simulatorFsxP3D->m_simConnectVersion = simConnectVersion; - CLogMessage(simulatorFsxP3D).info("Connected to %1: '%2'") << simulatorFsxP3D->getSimulatorPluginInfo().getIdentifier() << details; + CLogMessage(simulatorFsxP3D).info(u"Connected to %1: '%2'") << simulatorFsxP3D->getSimulatorPluginInfo().getIdentifier() << details; simulatorFsxP3D->setSimConnected(); break; // SIMCONNECT_RECV_ID_OPEN } @@ -95,10 +95,10 @@ namespace BlackSimPlugin { const bool removed = simulatorFsxP3D->m_simConnectObjects.remove(simObject.getCallsign()); Q_UNUSED(removed); - CLogMessage(simulatorFsxP3D).warning("Adding probe failed: %1 %2") << simObject.getCallsign().asString() << simObject.getAircraftModelString(); + CLogMessage(simulatorFsxP3D).warning(u"Adding probe failed: %1 %2") << simObject.getCallsign().asString() << simObject.getAircraftModelString(); if (simulatorFsxP3D->isUsingFsxTerrainProbe()) { - CLogMessage(simulatorFsxP3D).warning("Disabling terrain probe"); + CLogMessage(simulatorFsxP3D).warning(u"Disabling terrain probe"); simulatorFsxP3D->setUsingFsxTerrainProbe(false); } logGenericExceptionInfo = false; @@ -118,7 +118,7 @@ namespace BlackSimPlugin ex.sprintf("Exception=%lu | SendID=%lu | Index=%lu | cbData=%lu", exceptionId, sendId, index, data); const QString exceptionString(CSimConnectUtilities::simConnectExceptionToString(static_cast(exception->dwException))); const QString sendIdDetails = simulatorFsxP3D->getSendIdTraceDetails(sendId); - CLogMessage(simulatorFsxP3D).warning("Caught simConnect exception: '%1' '%2' | send details: '%3'") + CLogMessage(simulatorFsxP3D).warning(u"Caught simConnect exception: '%1' '%2' | send details: '%3'") << exceptionString << ex << (sendIdDetails.isEmpty() ? "N/A" : sendIdDetails); } @@ -221,7 +221,7 @@ namespace BlackSimPlugin { const CSimConnectObject simObject = simulatorFsxP3D->getSimObjectForObjectId(objectId); const CSimulatedAircraft remoteAircraft(simObject.getAircraft()); - const CStatusMessage msg = CStatusMessage(simulatorFsxP3D).error("Cannot add object %1, cs: '%2' model: '%3'") << objectId << remoteAircraft.getCallsignAsString() << remoteAircraft.getModelString(); + const CStatusMessage msg = CStatusMessage(simulatorFsxP3D).error(u"Cannot add object %1, cs: '%2' model: '%3'") << objectId << remoteAircraft.getCallsignAsString() << remoteAircraft.getModelString(); CLogMessage::preformatted(msg); emit simulatorFsxP3D->physicallyAddingRemoteModelFailed(remoteAircraft, false, msg); } @@ -312,7 +312,7 @@ namespace BlackSimPlugin { if (CBuildConfig::isLocalDeveloperDebugBuild()) { - CLogMessage(simulatorFsxP3D).error("Unknown subrequest (aircraft): '%1' %2") + CLogMessage(simulatorFsxP3D).error(u"Unknown subrequest (aircraft): '%1' %2") << CSimConnectDefinitions::simObjectRequestToString(subRequest) << simObject.toQString(); } @@ -341,7 +341,7 @@ namespace BlackSimPlugin { if (CBuildConfig::isLocalDeveloperDebugBuild()) { - CLogMessage(simulatorFsxP3D).error("Unknown subrequest (probe): '%1' %2") + CLogMessage(simulatorFsxP3D).error(u"Unknown subrequest (probe): '%1' %2") << CSimConnectDefinitions::simObjectRequestToString(subRequest) << probeObj.toQString(); } diff --git a/src/plugins/simulator/p3d/simulatorp3d.cpp b/src/plugins/simulator/p3d/simulatorp3d.cpp index e9356f4ed..ea8d7a076 100644 --- a/src/plugins/simulator/p3d/simulatorp3d.cpp +++ b/src/plugins/simulator/p3d/simulatorp3d.cpp @@ -138,7 +138,7 @@ namespace BlackSimPlugin } else { - const CStatusMessage msg = CStatusMessage(this).error("SimConnect, can not request ground info: '%1' '%2'") << requestId << callsign.asString(); + const CStatusMessage msg = CStatusMessage(this).error(u"SimConnect, can not request ground info: '%1' '%2'") << requestId << callsign.asString(); CLogMessage::preformatted(msg); } @@ -236,7 +236,7 @@ namespace BlackSimPlugin HRESULT hr = s_ok(); if (isFailure(hr)) { - CLogMessage(this).error("P3D plugin error: %1") << "initEventsP3D failed"; + CLogMessage(this).error(u"P3D plugin error: %1") << "initEventsP3D failed"; return hr; } return hr; diff --git a/src/plugins/simulator/xplane/simulatorxplane.cpp b/src/plugins/simulator/xplane/simulatorxplane.cpp index c8aa69a1b..ec8b1cb9e 100644 --- a/src/plugins/simulator/xplane/simulatorxplane.cpp +++ b/src/plugins/simulator/xplane/simulatorxplane.cpp @@ -468,7 +468,7 @@ namespace BlackSimPlugin Q_UNUSED(offset); if (enable) { - CLogMessage(this).info("X-Plane provides real time synchronization, use this one"); + CLogMessage(this).info(u"X-Plane provides real time synchronization, use this one"); } return false; } @@ -566,7 +566,7 @@ namespace BlackSimPlugin } } while (dir.cdUp()); - CLogMessage(this).warning("Failed to find CSL package for %1") << modelFile; + CLogMessage(this).warning(u"Failed to find CSL package for %1") << modelFile; return {}; } @@ -583,14 +583,14 @@ namespace BlackSimPlugin if (!this->isAircraftInRange(newRemoteAircraft.getCallsign())) { // next cycle will be called by callbacks or timer - CLogMessage(this).warning("Aircraft '%1' no longer in range, will not add") << newRemoteAircraft.getCallsign(); + CLogMessage(this).warning(u"Aircraft '%1' no longer in range, will not add") << newRemoteAircraft.getCallsign(); return false; } if (this->canAddAircraft()) { // no aircraft pending, add - CLogMessage(this).info("Adding '%1' to XPlane") << newRemoteAircraft.getCallsign(); + CLogMessage(this).info(u"Adding '%1' to XPlane") << newRemoteAircraft.getCallsign(); const qint64 now = QDateTime::currentMSecsSinceEpoch(); m_addingInProgressAircraft.insert(newRemoteAircraft.getCallsign(), now); const QString callsign = newRemoteAircraft.getCallsign().asString(); @@ -990,17 +990,17 @@ namespace BlackSimPlugin if (!addedRemoteAircraft.hasCallsign()) { - CLogMessage(this).warning("Aircraft '%1' no longer in range, will be removed") << callsign; + CLogMessage(this).warning(u"Aircraft '%1' no longer in range, will be removed") << callsign; this->triggerRemoveAircraft(cs, TimeoutAdding); return; } - CLogMessage(this).info("Added aircraft '%1'") << callsign; + CLogMessage(this).info(u"Added aircraft '%1'") << callsign; if (!wasPending) { // timeout? // slow adding? - CLogMessage(this).warning("Added callsign '%1' was not in progress anymore. Timeout?") << callsign; + CLogMessage(this).warning(u"Added callsign '%1' was not in progress anymore. Timeout?") << callsign; } const bool rendered = true; @@ -1021,12 +1021,12 @@ namespace BlackSimPlugin if (failedRemoteAircraft.hasCallsign()) { - CLogMessage(this).warning("Adding aircraft failed: '%1'") << callsign; + CLogMessage(this).warning(u"Adding aircraft failed: '%1'") << callsign; failedRemoteAircraft.setRendered(false); } else { - CLogMessage(this).warning("Adding '%1' failed, but aircraft no longer in range, will be removed") << callsign; + CLogMessage(this).warning(u"Adding '%1' failed, but aircraft no longer in range, will be removed") << callsign; } const bool wasPending = (m_addingInProgressAircraft.remove(cs) > 0); @@ -1053,7 +1053,7 @@ namespace BlackSimPlugin // next add cycle const CSimulatedAircraft newRemoteAircraft = m_pendingToBeAddedAircraft.front(); m_pendingToBeAddedAircraft.pop_front(); - CLogMessage(this).info("Adding next pending aircraft '%1', pending %2, in progress %3") << newRemoteAircraft.getCallsignAsString() << m_pendingToBeAddedAircraft.size() << m_addingInProgressAircraft.size(); + CLogMessage(this).info(u"Adding next pending aircraft '%1', pending %2, in progress %3") << newRemoteAircraft.getCallsignAsString() << m_pendingToBeAddedAircraft.size() << m_addingInProgressAircraft.size(); this->physicallyAddRemoteAircraft(newRemoteAircraft); } @@ -1082,7 +1082,7 @@ namespace BlackSimPlugin for (const CCallsign &cs : as_const(timeoutCallsigns)) { m_addingInProgressAircraft.remove(cs); - CLogMessage(this).warning("Adding for '%1' timed out") << cs.asString(); + CLogMessage(this).warning(u"Adding for '%1' timed out") << cs.asString(); } return timeoutCallsigns.size(); @@ -1214,20 +1214,20 @@ namespace BlackSimPlugin QString xswiftbusVersion = service.getVersionNumber(); if (! swiftVersion.contains(xswiftbusVersion)) { - CLogMessage(this).error("You are using an incorrect version of XSwiftBus. Make sure to install %1 into X-Plane plugins!") << xswiftbusVersion; + CLogMessage(this).error(u"You are using an incorrect version of XSwiftBus. Make sure to install %1 into X-Plane plugins!") << xswiftbusVersion; return; } if (!traffic.initialize()) { - CLogMessage(this).error("Connection to XSwiftBus successful, but could not initialize XSwiftBus. Check X-Plane Log.txt."); + CLogMessage(this).error(u"Connection to XSwiftBus successful, but could not initialize XSwiftBus. Check X-Plane Log.txt."); return; } MultiplayerAcquireInfo info = traffic.acquireMultiplayerPlanes(); if (! info.hasAcquired) { - CLogMessage(this).error("Connection to XSwiftBus successful, but could not acquire multiplayer planes. %1 has acquired them already. Disable %2 or remove it if not required and reload XSwiftBus.") << info.owner << info.owner; + CLogMessage(this).error(u"Connection to XSwiftBus successful, but could not acquire multiplayer planes. %1 has acquired them already. Disable %2 or remove it if not required and reload XSwiftBus.") << info.owner << info.owner; return; } diff --git a/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp b/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp index 23d6b0f6b..fdbf58223 100644 --- a/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp +++ b/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp @@ -47,7 +47,7 @@ namespace BlackSimPlugin reply.waitForFinished(); if (reply.isError()) { - BlackMisc::CLogMessage(this).debug("CXSwiftBusTrafficProxy::acquireMultiplayerPlanes returned: %1") << reply.error().message(); + BlackMisc::CLogMessage(this).debug(u"CXSwiftBusTrafficProxy::acquireMultiplayerPlanes returned: %1") << reply.error().message(); } MultiplayerAcquireInfo info; info.hasAcquired = reply.argumentAt<0>(); diff --git a/src/plugins/weatherdata/gfs/weatherdatagfs.cpp b/src/plugins/weatherdata/gfs/weatherdatagfs.cpp index b633b4fd4..569bef33d 100644 --- a/src/plugins/weatherdata/gfs/weatherdatagfs.cpp +++ b/src/plugins/weatherdata/gfs/weatherdatagfs.cpp @@ -69,7 +69,7 @@ namespace BlackWxPlugin { if (!sApp->isInternetAccessible()) { - CLogMessage(this).error("No weather download since network/internet not accessible"); + CLogMessage(this).error(u"No weather download since network/internet not accessible"); return; } @@ -256,22 +256,22 @@ namespace BlackWxPlugin g2int expand = 1; gribfield *gfld = nullptr; g2_getfld(readPtr, n + 1, unpack, expand, &gfld); - if (gfld->idsectlen < 12) { CLogMessage(this).warning("Identification section: wrong length!"); continue; } + if (gfld->idsectlen < 12) { CLogMessage(this).warning(u"Identification section: wrong length!"); continue; } - if (gfld->igdtnum != 0) { CLogMessage(this).warning("Can handle only grid definition template number = 0"); } + if (gfld->igdtnum != 0) { CLogMessage(this).warning(u"Can handle only grid definition template number = 0"); } int nscan = gfld->igdtmpl[18]; int npnts = gfld->ngrdpts; int nx = gfld->igdtmpl[7]; int ny = gfld->igdtmpl[8]; - if (nscan != 0) { CLogMessage(this).error("Can only handle scanning mode NS:WE."); } - if (npnts != nx * ny) { CLogMessage(this).error("Cannot handle non-regular grid."); } + if (nscan != 0) { CLogMessage(this).error(u"Can only handle scanning mode NS:WE."); } + if (npnts != nx * ny) { CLogMessage(this).error(u"Cannot handle non-regular grid."); } if (m_gfsWeatherGrid.empty()) { createWeatherGrid(gfld); } if (gfld->ipdtnum == 0) { handleProductDefinitionTemplate40(gfld); } else if (gfld->ipdtnum == 8) { handleProductDefinitionTemplate48(gfld); } - else { CLogMessage(this).warning("Cannot handle product definition template %1") << gfld->ipdtnum; continue; } + else { CLogMessage(this).warning(u"Cannot handle product definition template %1") << gfld->ipdtnum; continue; } g2_free(gfld); } @@ -398,17 +398,17 @@ namespace BlackWxPlugin if (latitude1 < -90.0 || latitude2 < -90.0 || latitude1 > 90.0 || latitude2 > 90.0) { - CLogMessage(this).warning("Invalid grid definition: lat1 = %1 - lat2 = %2") << latitude1 << latitude2; + CLogMessage(this).warning(u"Invalid grid definition: lat1 = %1 - lat2 = %2") << latitude1 << latitude2; return; } if (longitude1 < 0.0 || longitude2 < 0.0 || longitude1 > 360.0 || longitude2 > 360.0) { - CLogMessage(this).warning("Invalid grid definition: lon1 = %1 - lon2 = %2") << longitude1 << longitude2; + CLogMessage(this).warning(u"Invalid grid definition: lon1 = %1 - lon2 = %2") << longitude1 << longitude2; return; } if (npnts != nx * ny) { - CLogMessage(this).warning("Invalid grid definition: npnts != nx * ny!"); + CLogMessage(this).warning(u"Invalid grid definition: npnts != nx * ny!"); return; } @@ -418,7 +418,7 @@ namespace BlackWxPlugin if (south > north) { - CLogMessage(this).warning("Invalid grid definition: South = %1 - North = %2") << south << north; + CLogMessage(this).warning(u"Invalid grid definition: South = %1 - North = %2") << south << north; return; } @@ -430,7 +430,7 @@ namespace BlackWxPlugin { if (fabs(dy - dlatitude) > 0.001) { - CLogMessage(this).warning("Invalid grid definition: delta latitude is inconsistent"); + CLogMessage(this).warning(u"Invalid grid definition: delta latitude is inconsistent"); return; } } @@ -460,7 +460,7 @@ namespace BlackWxPlugin { if (fabs(dx - fabs(dlongitude)) > 0.001) { - CLogMessage(this).warning("Invalid grid definition: delta longitude is inconsistent"); + CLogMessage(this).warning(u"Invalid grid definition: delta longitude is inconsistent"); return; } } @@ -511,7 +511,7 @@ namespace BlackWxPlugin { if (gfld->ipdtlen != 15) { - CLogMessage(this).warning("Template 4.0 has wrong length"); + CLogMessage(this).warning(u"Template 4.0 has wrong length"); return; } @@ -525,7 +525,7 @@ namespace BlackWxPlugin // Make sure the key exists if (!m_grib2ParameterTable.contains(key)) { - CLogMessage(this).warning("Unknown GRIB2 parameter: %1 - %2") << parameterCategory << parameterNumber; + CLogMessage(this).warning(u"Unknown GRIB2 parameter: %1 - %2") << parameterCategory << parameterNumber; return; } @@ -539,7 +539,7 @@ namespace BlackWxPlugin level = std::round(millibarToLevel(valueFirstFixedSurface)); break; default: - CLogMessage(this).warning("Unexpected first fixed surface type: %1") << typeFirstFixedSurface; + CLogMessage(this).warning(u"Unexpected first fixed surface type: %1") << typeFirstFixedSurface; return; } @@ -573,7 +573,7 @@ namespace BlackWxPlugin { if (gfld->ipdtlen != 29) { - CLogMessage(this).warning("Template 4.8 has wrong length."); + CLogMessage(this).warning(u"Template 4.8 has wrong length."); return; } @@ -585,7 +585,7 @@ namespace BlackWxPlugin // Make sure the key exists if (!m_grib2ParameterTable.contains(key)) { - CLogMessage(this).warning("Unknown GRIB2 parameter: %1 - %2") << parameterCategory << parameterNumber; + CLogMessage(this).warning(u"Unknown GRIB2 parameter: %1 - %2") << parameterCategory << parameterNumber; return; } diff --git a/src/swiftcore/swiftcore.cpp b/src/swiftcore/swiftcore.cpp index 357b8d1fc..f4b22c1c3 100644 --- a/src/swiftcore/swiftcore.cpp +++ b/src/swiftcore/swiftcore.cpp @@ -66,7 +66,7 @@ CSwiftCore::CSwiftCore(QWidget *parent) : this->initAudio(); // log - CStatusMessage m = CStatusMessage(this).info("Cmd: " + CGuiApplication::arguments().join(" ")); + CStatusMessage m = CStatusMessage(this).info(u"Cmd: %1") << CGuiApplication::arguments().join(" "); this->appendLogMessage(m); // command line diff --git a/src/swiftdata/swiftdata.cpp b/src/swiftdata/swiftdata.cpp index 65157963a..077dcaf23 100644 --- a/src/swiftdata/swiftdata.cpp +++ b/src/swiftdata/swiftdata.cpp @@ -195,7 +195,7 @@ void CSwiftData::checkMinimumVersion() if (!sApp || sApp->isShuttingDown()) { return; } if (sApp->getGlobalSetup().isSwiftVersionMinimumMappingVersion()) { - CLogMessage(this).info("Checked mapping tool version, required '%1', this version '%2'") << sApp->getGlobalSetup().getMappingMinimumVersionString() << CBuildConfig::getVersionString(); + CLogMessage(this).info(u"Checked mapping tool version, required '%1', this version '%2'") << sApp->getGlobalSetup().getMappingMinimumVersionString() << CBuildConfig::getVersionString(); } else { diff --git a/src/swiftguistandard/swiftguistd.cpp b/src/swiftguistandard/swiftguistd.cpp index 1f1bfbee6..a50941bf2 100644 --- a/src/swiftguistandard/swiftguistd.cpp +++ b/src/swiftguistandard/swiftguistd.cpp @@ -411,7 +411,7 @@ void SwiftGuiStd::verifyPrerequisites() CStatusMessageList msgs; if (!sGui->supportsContexts() || !sGui->getIContextSimulator()) { - msgs.push_back(CStatusMessage(this).error("No simulator context")); + msgs.push_back(CStatusMessage(this).error(u"No simulator context")); } else { diff --git a/src/swiftguistandard/swiftguistdapplication.cpp b/src/swiftguistandard/swiftguistdapplication.cpp index 8dc04ca4f..fd5c3a028 100644 --- a/src/swiftguistandard/swiftguistdapplication.cpp +++ b/src/swiftguistandard/swiftguistdapplication.cpp @@ -41,7 +41,7 @@ CStatusMessageList CSwiftGuiStdApplication::startHookIn() if (coreMode == CoreModes::CoreInGuiProcess && !dBusAddress.isEmpty()) { const CStatusMessage m = CStatusMessage(this, CLogCategory::validation()). - error("Inconsistent pair DBus: '%1' and core: '%2'") + error(u"Inconsistent pair DBus: '%1' and core: '%2'") << dBusAddress << coreModeStr; return CStatusMessageList(m) ; } @@ -53,7 +53,7 @@ CStatusMessageList CSwiftGuiStdApplication::startHookIn() { coreMode = CoreModes::CoreExternalAudioGui; // default const CStatusMessage m = CStatusMessage(this, CLogCategory::validation()). - info("No DBus address, setting core mode: '%1'") + info(u"No DBus address, setting core mode: '%1'") << CoreModes::coreModeToString(coreMode); msgs.push_back(m); } @@ -61,7 +61,7 @@ CStatusMessageList CSwiftGuiStdApplication::startHookIn() { dBusAddress = CDBusServer::sessionBusAddress(); // a possible default const CStatusMessage m = CStatusMessage(this, CLogCategory::validation()). - info("Setting DBus address to '%1'") + info(u"Setting DBus address to '%1'") << dBusAddress; msgs.push_back(m); } diff --git a/src/swiftguistandard/swiftguistdinit.cpp b/src/swiftguistandard/swiftguistdinit.cpp index 6bbbc06c9..d08971429 100644 --- a/src/swiftguistandard/swiftguistdinit.cpp +++ b/src/swiftguistandard/swiftguistdinit.cpp @@ -279,12 +279,12 @@ void SwiftGuiStd::initialContextDataReads() this->setContextAvailability(); if (!m_coreAvailable) { - CLogMessage(this).error("No initial data read as network context is not available"); + CLogMessage(this).error(u"No initial data read as network context is not available"); return; } this->reloadOwnAircraft(); // init read, independent of traffic network - CLogMessage(this).info("Initial data read"); + CLogMessage(this).info(u"Initial data read"); } void SwiftGuiStd::stopAllTimers(bool disconnectSignalSlots) diff --git a/src/swiftguistandard/swiftguistdmenus.cpp b/src/swiftguistandard/swiftguistdmenus.cpp index e46d31101..5d526e26c 100644 --- a/src/swiftguistandard/swiftguistdmenus.cpp +++ b/src/swiftguistandard/swiftguistdmenus.cpp @@ -95,17 +95,17 @@ void SwiftGuiStd::attachSimulatorWindow() QWindow *w = CForeignWindows::getFirstFoundSimulatorWindow(); if (!w) { - CLogMessage(this).warning("No simulator window found"); + CLogMessage(this).warning(u"No simulator window found"); return; } const bool a = CForeignWindows::setSimulatorAsParent(w, this); if (a) { - CLogMessage(this).info("Attached to simulator"); + CLogMessage(this).info(u"Attached to simulator"); } else { - CLogMessage(this).warning("No simulator window found"); + CLogMessage(this).warning(u"No simulator window found"); } } @@ -113,11 +113,11 @@ void SwiftGuiStd::detachSimulatorWindow() { if (CForeignWindows::unsetSimulatorAsParent(this)) { - CLogMessage(this).info("Detached simulator window"); + CLogMessage(this).info(u"Detached simulator window"); } else { - CLogMessage(this).info("No simulator window to detach"); + CLogMessage(this).info(u"No simulator window to detach"); } } @@ -173,5 +173,5 @@ void SwiftGuiStd::copyXSwiftBusDialog(bool checkFileTimestamp) } const int c = CCopyXSwiftBusDialog::displayDialogAndCopyBuildFiles(xPlaneRootDir, checkFileTimestamp, this); - if (c > 0) { CLogMessage(this).info("Copied %1 files from build directory") << c; } + if (c > 0) { CLogMessage(this).info(u"Copied %1 files from build directory") << c; } } diff --git a/src/swiftlauncher/swiftlauncher.cpp b/src/swiftlauncher/swiftlauncher.cpp index 35cec0086..43d36f24d 100644 --- a/src/swiftlauncher/swiftlauncher.cpp +++ b/src/swiftlauncher/swiftlauncher.cpp @@ -136,7 +136,7 @@ void CSwiftLauncher::displayLatestNews(QNetworkReply *reply) { const QString html = nwReply->readAll().trimmed(); if (html.isEmpty()) { return; } - CLogMessage(this).info("Received news from '%1'") << nwReply->url().toString(); + CLogMessage(this).info(u"Received news from '%1'") << nwReply->url().toString(); ui->tbr_LatestNews->setHtml(html); // causes QFSFileEngine::open: No file name specified constexpr qint64 newNews = 72 * 3600 * 1000; const qint64 deltaT = CNetworkUtils::lastModifiedSinceNow(nwReply.data()); @@ -147,7 +147,7 @@ void CSwiftLauncher::displayLatestNews(QNetworkReply *reply) } else { - CLogMessage(this).warning("Error received news from '%1'") << nwReply->url().toString(); + CLogMessage(this).warning(u"Error received news from '%1'") << nwReply->url().toString(); } } @@ -202,7 +202,7 @@ void CSwiftLauncher::loadLatestNews() if (newsUrl.isEmpty()) { - CLogMessage(this).warning("No working news URL in %1") << newsUrls.toQString(); + CLogMessage(this).warning(u"No working news URL in %1") << newsUrls.toQString(); return; } sGui->getFromNetwork(newsUrl, { this, &CSwiftLauncher::displayLatestNews});