Return a default-constructed QString instead of implicitly converting an empty string literal.

This commit is contained in:
Mat Sutcliffe
2018-12-20 21:47:58 +00:00
parent 6c05c5249d
commit d6b5dca6b2
49 changed files with 128 additions and 127 deletions

View File

@@ -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('(');

View File

@@ -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();
}

View File

@@ -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()

View File

@@ -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
{

View File

@@ -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 ");