Fix a few clang-tidy inspections

This commit is contained in:
tobtoht 2022-02-11 12:50:09 +01:00
parent f1165ba738
commit 4f4bb95b32
3 changed files with 11 additions and 10 deletions

View file

@ -594,9 +594,9 @@ void MainWindow::onCreateTransactionSuccess(PendingTransaction *tx, const QVecto
qCritical() << tx_err;
if (m_ctx->wallet->connectionStatus() == Wallet::ConnectionStatus_WrongVersion)
err = QString("%1 Wrong node version: %2").arg(err).arg(tx_err);
err = QString("%1 Wrong node version: %2").arg(err, tx_err);
else
err = QString("%1 %2").arg(err).arg(tx_err);
err = QString("%1 %2").arg(err, tx_err);
if (tx_err.contains("Node response did not include the requested real output")) {
QString currentNode = m_ctx->nodes->connection().toAddress();
@ -612,7 +612,7 @@ void MainWindow::onCreateTransactionSuccess(PendingTransaction *tx, const QVecto
return;
}
else if (tx->txCount() == 0) {
err = QString("%1 %2").arg(err).arg("No unmixable outputs to sweep.");
err = QString("%1 %2").arg(err, "No unmixable outputs to sweep.");
qDebug() << Q_FUNC_INFO << err;
this->displayWalletErrorMsg(err);
m_ctx->wallet->disposeTransaction(tx);
@ -1489,7 +1489,7 @@ QString MainWindow::getPlatformTag() {
return "win";
#endif
#ifdef Q_OS_LINUX
if (!qgetenv("APPIMAGE").isEmpty()) {
if (!qEnvironmentVariableIsEmpty("APPIMAGE")) {
return "linux-appimage";
}
return "linux";

View file

@ -146,7 +146,7 @@ void SendWidget::sendClicked() {
QVector<PartialTxOutput> outputs = ui->lineAddress->getOutputs();
QVector<PayToLineError> errors = ui->lineAddress->getErrors();
if (errors.size() > 0 && ui->lineAddress->isMultiline()) {
if (!errors.empty() && ui->lineAddress->isMultiline()) {
QString errorText;
for (auto &error: errors) {
errorText += QString("Line #%1:\n%2\n").arg(QString::number(error.idx + 1), error.error);
@ -156,7 +156,7 @@ void SendWidget::sendClicked() {
return;
}
if (outputs.size() > 0) { // multi destination transaction
if (!outputs.empty()) { // multi destination transaction
if (outputs.size() > 16) {
QMessageBox::warning(this, "Warning", "Maximum number of outputs (16) exceeded.");
return;

View file

@ -126,8 +126,8 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) {
// Setup config directories
QString configDir = Config::defaultConfigDir().path();
QString config_dir_tor = QString("%1/%2").arg(configDir).arg("tor");
QString config_dir_tordata = QString("%1/%2").arg(configDir).arg("tor/data");
QString config_dir_tor = QString("%1/%2").arg(configDir, "tor");
QString config_dir_tordata = QString("%1/%2").arg(configDir, "tor/data");
QStringList createDirs({configDir, config_dir_tor, config_dir_tordata});
for (const auto &d: createDirs) {
if (!Utils::dirExists(d)) {
@ -194,8 +194,9 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) {
else info["Mode"] = "Mainnet";
info["SSL"] = QSslSocket::sslLibraryVersionString();
info["SSL build"] = QSslSocket::sslLibraryBuildVersionString();
for (const auto &k: info.keys())
qWarning().nospace().noquote() << QString("%1: %2").arg(k).arg(info[k]);
for (const QString &k: info.keys()) {
qWarning().nospace().noquote() << QString("%1: %2").arg(k, info[k]);
}
}
#if defined(Q_OS_MAC)