mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
Return a default-constructed QString instead of implicitly converting an empty string literal.
This commit is contained in:
@@ -226,7 +226,7 @@ namespace BlackGui
|
||||
|
||||
QString CDbLiverySelectorComponent::stripExtraInfo(const QString &liveryCode) const
|
||||
{
|
||||
if (liveryCode.isEmpty()) { return ""; }
|
||||
if (liveryCode.isEmpty()) { return {}; }
|
||||
const QString l(liveryCode.trimmed().toUpper());
|
||||
int is = l.indexOf(' ');
|
||||
int ib = l.indexOf('(');
|
||||
|
||||
@@ -166,13 +166,13 @@ namespace BlackGui
|
||||
|
||||
QString CDbOwnModelsComponent::getInfoString() const
|
||||
{
|
||||
if (!m_modelLoader) { return ""; }
|
||||
if (!m_modelLoader) { return {}; }
|
||||
return m_modelLoader->getInfoString();
|
||||
}
|
||||
|
||||
QString CDbOwnModelsComponent::getInfoStringFsFamily() const
|
||||
{
|
||||
if (!m_modelLoader) { return ""; }
|
||||
if (!m_modelLoader) { return {}; }
|
||||
return m_modelLoader->getInfoStringFsFamily();
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace BlackGui
|
||||
|
||||
QString CDBusServerAddressSelector::getP2PAddress() const
|
||||
{
|
||||
if (!this->isP2P()) { return ""; }
|
||||
if (!this->isP2P()) { return {}; }
|
||||
return CDBusServer::p2pAddress(
|
||||
ui->cb_DBusServerAddress->currentText() + ":" +
|
||||
ui->le_DBusServerPort->text()
|
||||
|
||||
@@ -370,7 +370,7 @@ namespace BlackGui
|
||||
if (v.isEmpty() || v.endsWith(defaultIcao(), Qt::CaseInsensitive))
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validationError("Missing '%1'") << ui->lbl_DestinationAirport->text());
|
||||
flightPlan.setDestinationAirportIcao(QString(""));
|
||||
flightPlan.setDestinationAirportIcao(QString());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -411,7 +411,7 @@ namespace BlackGui
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validationInfo("Missing %1") << ui->lbl_AlternateAirport->text());
|
||||
}
|
||||
flightPlan.setAlternateAirportIcao(QString(""));
|
||||
flightPlan.setAlternateAirportIcao(QString());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -532,7 +532,7 @@ namespace BlackGui
|
||||
QString CTextMessageComponent::textMessageToCommand(const QString &enteredLine)
|
||||
{
|
||||
// only if visible
|
||||
if (enteredLine.isEmpty()) { return ""; }
|
||||
if (enteredLine.isEmpty()) { return {}; }
|
||||
|
||||
const int index = ui->tw_TextMessages->currentIndex();
|
||||
QString cmd(".msg ");
|
||||
|
||||
Reference in New Issue
Block a user