cleanup: explicitly cast to int to silence a compiler warning

In DivelogsDeWebServices::updateProgress() QProgressBar::setRange()
and QProgressBar::setValue() were passed floats even though they
expect ints. To silence a compiler warning, cast by hand. Use the
lrint() function, since we generally do it this way. However,
it is not clear whether this is necessary here.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-04-01 18:29:49 +02:00 committed by Dirk Hohndel
parent 2a802721f4
commit d7d01ab8a6

View file

@ -430,8 +430,8 @@ void DivelogsDeWebServices::downloadError(QNetworkReply::NetworkError)
void DivelogsDeWebServices::updateProgress(qreal current, qreal total) void DivelogsDeWebServices::updateProgress(qreal current, qreal total)
{ {
ui.progressBar->setRange(0, total); ui.progressBar->setRange(0, lrint(total));
ui.progressBar->setValue(current); ui.progressBar->setValue(lrint(current));
ui.status->setText(tr("Transferring data...")); ui.status->setText(tr("Transferring data..."));
} }