]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Constify elements for progress bar rect calculation in FolderStatusDelegate::paint
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 4 May 2023 04:22:12 +0000 (12:22 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Mon, 8 May 2023 12:04:56 +0000 (20:04 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/folderstatusdelegate.cpp

index 3ff5ccfff035d4e7db5b7030da92b3b2587e6a61..b356a3dd32b83353be9d7a324b55682692d3be17 100644 (file)
@@ -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;