From 396003264cff659428ae89385bbf522455fc2d8b Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 4 May 2023 12:22:12 +0800 Subject: [PATCH] Constify elements for progress bar rect calculation in FolderStatusDelegate::paint Signed-off-by: Claudio Cambra --- src/gui/folderstatusdelegate.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/gui/folderstatusdelegate.cpp b/src/gui/folderstatusdelegate.cpp index 3ff5ccfff..b356a3dd3 100644 --- a/src/gui/folderstatusdelegate.cpp +++ b/src/gui/folderstatusdelegate.cpp @@ -297,17 +297,16 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem & // Sync File Progress Bar: Show it if syncFile is not empty. if (showProgess) { const auto fileNameTextHeight = subFm.boundingRect(tr("File")).height(); - const auto barHeight = 7; // same height as quota bar + constexpr auto barHeight = 7; // same height as quota bar const auto overallWidth = option.rect.right() - aliasMargin - optionsButtonVisualRect.width() - nextToIcon; painter->save(); // Overall Progress Bar. - QRect progressBarRect; - progressBarRect.setTop(remotePathRect.top()); - progressBarRect.setLeft(nextToIcon); - progressBarRect.setHeight(barHeight); - progressBarRect.setWidth(overallWidth - 2 * margin); + const auto progressBarRect = QRect(nextToIcon, + remotePathRect.top(), + overallWidth - 2 * margin, + barHeight); QStyleOptionProgressBar progressBarOpt; -- 2.30.2