From 0498f2af889bb4acbcd873c4ae4713b53fbdedfb Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Fri, 5 Jul 2024 14:55:24 +0200 Subject: [PATCH] Only start displaying status starting at 1. e.g. "0 f 6 files" => "1 of 6 files" Signed-off-by: Camila Ayres --- src/gui/folderstatusmodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index 0bfb4e8631d1f..425918e74e506 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -896,7 +896,7 @@ void FolderStatusModel::slotUpdateFolderState(Folder *folder) if (!folder) { return; } - + for (auto i = 0; i < _folders.count(); ++i) { if (_folders.at(i)._folder == folder) { emit dataChanged(index(i), index(i)); @@ -1105,7 +1105,7 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) const auto totalSize = qMax(completedSize, progress.totalSize()); QString overallSyncString; - if (totalSize > 0) { + if (totalSize > 0 && completedSize > 0) { const auto completedSizeString = Utility::octetsToString(completedSize); const auto totalSizeString = Utility::octetsToString(totalSize); @@ -1134,7 +1134,7 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) .arg(currentFile) .arg(totalFileCount); } - } else if (totalFileCount > 0) { + } else if (totalFileCount > 0 && currentFile > 0) { // Don't attempt to estimate the time left if there is no kb to transfer. overallSyncString = tr("file %1 of %2").arg(currentFile).arg(totalFileCount); }