Address a handful of warnings from #6095 (#4199)

This commit is contained in:
Zach H 2020-12-01 11:30:22 -05:00 committed by GitHub
parent 8845a23d5d
commit 34e951298f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 49 additions and 46 deletions

View file

@ -45,7 +45,7 @@ DlgUpdate::DlgUpdate(QWidget *parent) : QDialog(parent)
connect(stopDownload, SIGNAL(clicked()), this, SLOT(cancelDownload()));
connect(ok, SIGNAL(clicked()), this, SLOT(closeDialog()));
QVBoxLayout *parentLayout = new QVBoxLayout(this);
auto *parentLayout = new QVBoxLayout(this);
parentLayout->addWidget(descriptionLabel);
parentLayout->addWidget(statusLabel);
parentLayout->addWidget(progress);
@ -54,8 +54,8 @@ DlgUpdate::DlgUpdate(QWidget *parent) : QDialog(parent)
setLayout(parentLayout);
setWindowTitle(tr("Check for Client Updates"));
setFixedHeight(sizeHint().height());
setFixedWidth(sizeHint().width());
setFixedHeight(this->sizeHint().height());
setFixedWidth(this->sizeHint().width());
// Check for SSL (this probably isn't necessary)
if (!QSslSocket::supportsSsl()) {
@ -144,7 +144,7 @@ void DlgUpdate::finishedUpdateCheck(bool needToUpdate, bool isCompatible, Releas
return;
}
publishDate = release->getPublishDate().toString(Qt::DefaultLocaleLongDate);
publishDate = release->getPublishDate().toString(QLocale().dateFormat(QLocale::LongFormat));
if (isCompatible) {
int reply;
reply = QMessageBox::question(
@ -194,19 +194,19 @@ void DlgUpdate::enableOkButton(bool enable)
ok->setEnabled(enable);
}
void DlgUpdate::setLabel(QString newText)
void DlgUpdate::setLabel(const QString &newText)
{
statusLabel->setText(newText);
}
void DlgUpdate::updateCheckError(QString errorString)
void DlgUpdate::updateCheckError(const QString &errorString)
{
setLabel(tr("Error"));
QMessageBox::critical(this, tr("Update Error"),
tr("An error occurred while checking for updates:") + QString(" ") + errorString);
}
void DlgUpdate::downloadError(QString errorString)
void DlgUpdate::downloadError(const QString &errorString)
{
setLabel(tr("Error"));
enableUpdateButton(true);
@ -214,7 +214,7 @@ void DlgUpdate::downloadError(QString errorString)
tr("An error occurred while downloading an update:") + QString(" ") + errorString);
}
void DlgUpdate::downloadSuccessful(QUrl filepath)
void DlgUpdate::downloadSuccessful(const QUrl &filepath)
{
setLabel(tr("Installing..."));
// Try to open the installer. If it opens, quit Cockatrice