mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 01:05:35 +08:00
Ref T485 Adjust CLogMessage and CStatusMessage call sites to use the new API.
This commit is contained in:
@@ -175,7 +175,7 @@ namespace BlackMisc
|
||||
{
|
||||
if (models.containsModelString(model.getModelString()))
|
||||
{
|
||||
CLogMessage(static_cast<CAircraftModelLoaderXPlane *>(nullptr)).warning("XPlane model '%1' exists already! Potential model string conflict! Ignoring it.") << model.getModelString();
|
||||
CLogMessage(static_cast<CAircraftModelLoaderXPlane *>(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 <min> <max> <path>
|
||||
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 <path>
|
||||
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 <group> <animate YES|NO> <filename> {<texture filename> {<lit texture filename>}}
|
||||
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 <code>
|
||||
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 <code> <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 <code> <airline> <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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user