diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index eab2824..dc81344 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -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"; diff --git a/src/SendWidget.cpp b/src/SendWidget.cpp index 5dd1881..d0f4e12 100644 --- a/src/SendWidget.cpp +++ b/src/SendWidget.cpp @@ -146,7 +146,7 @@ void SendWidget::sendClicked() { QVector outputs = ui->lineAddress->getOutputs(); QVector 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; diff --git a/src/main.cpp b/src/main.cpp index 1623663..35afc2d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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)