mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Minor tweak remove redundant "/' and string message improvements
This commit is contained in:
committed by
Mat Sutcliffe
parent
360edca4b3
commit
c899bfbea7
@@ -126,8 +126,9 @@ namespace BlackCore
|
||||
|
||||
const QDateTime startTime = QDateTime::currentDateTimeUtc();
|
||||
if (log) { log->clear(); }
|
||||
|
||||
CMatchingUtils::addLogDetailsToList(log, remoteAircraft, m1.arg(startTime.toString(format)));
|
||||
CMatchingUtils::addLogDetailsToList(log, remoteAircraft, m2.arg(remoteAircraft.getCallsignAsString(), remoteAircraft.getModel().toQString()));
|
||||
CMatchingUtils::addLogDetailsToList(log, remoteAircraft, m2.arg(remoteAircraft.getCallsignAsString(), removeSurroundingApostrophes(remoteAircraft.getModel().toQString())));
|
||||
CMatchingUtils::addLogDetailsToList(log, remoteAircraft, m3.arg(modelSet.size()).arg(modelSet.coverageSummaryForModel(remoteAircraft.getModel())));
|
||||
CMatchingUtils::addLogDetailsToList(log, remoteAircraft, m4.arg(setup.toQString(true)));
|
||||
|
||||
|
||||
@@ -137,8 +137,8 @@ namespace BlackMisc
|
||||
{
|
||||
static const QString ms("by model string");
|
||||
static const QString icao("by ICAO");
|
||||
static const QString icaoAircraft("by ICAO, aircraft first");
|
||||
static const QString icaoAirline("by ICAO, airline first");
|
||||
static const QString icaoAircraft("by ICAO aircraft first");
|
||||
static const QString icaoAirline("by ICAO airline first");
|
||||
static const QString family("by family");
|
||||
static const QString forceMil("force military");
|
||||
static const QString forceCiv("force civilian");
|
||||
|
||||
@@ -412,6 +412,27 @@ namespace BlackMisc
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
QString removeSurroundingApostrophes(const QString &in)
|
||||
{
|
||||
if (in.size() < 2) { return in; }
|
||||
if (in.startsWith("'") && in.endsWith("'"))
|
||||
{
|
||||
return in.mid(1, in.length() - 2);
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
QString removeSurroundingQuotes(const QString &in)
|
||||
{
|
||||
if (in.size() < 2) { return in; }
|
||||
if (in.startsWith("\"") && in.endsWith("\""))
|
||||
{
|
||||
return in.mid(1, in.length() - 2);
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
} // ns
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -204,6 +204,12 @@ namespace BlackMisc
|
||||
//! Return string in quotes
|
||||
BLACKMISC_EXPORT QString inQuotes(const QString &in, bool ignoreEmpty = false);
|
||||
|
||||
//! Remove surrounding apostrophes 'foo' -> foo
|
||||
BLACKMISC_EXPORT QString removeSurroundingApostrophes(const QString &in);
|
||||
|
||||
//! Remove surrounding quotes "foo" -> foo
|
||||
BLACKMISC_EXPORT QString removeSurroundingQuotes(const QString &in);
|
||||
|
||||
//! Bool to on/off
|
||||
BLACKMISC_EXPORT const QString &boolToOnOff(bool v);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user