From d7d01ab8a677b4c03476f48fc05633ce45c22263 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 1 Apr 2020 18:29:49 +0200 Subject: 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 --- desktop-widgets/subsurfacewebservices.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop-widgets/subsurfacewebservices.cpp b/desktop-widgets/subsurfacewebservices.cpp index 658b8196a..80a17af2a 100644 --- a/desktop-widgets/subsurfacewebservices.cpp +++ b/desktop-widgets/subsurfacewebservices.cpp @@ -430,8 +430,8 @@ void DivelogsDeWebServices::downloadError(QNetworkReply::NetworkError) void DivelogsDeWebServices::updateProgress(qreal current, qreal total) { - ui.progressBar->setRange(0, total); - ui.progressBar->setValue(current); + ui.progressBar->setRange(0, lrint(total)); + ui.progressBar->setValue(lrint(current)); ui.status->setText(tr("Transferring data...")); } -- cgit v1.2.3-70-g09d2