From 0e89ec37370e2652ad7df0e22d80456786af0c85 Mon Sep 17 00:00:00 2001 From: ngosang Date: Mon, 9 Feb 2015 17:32:00 +0100 Subject: [PATCH] Small change in progress bar percentage --- src/gui/previewlistdelegate.h | 2 +- src/gui/properties/proplistdelegate.h | 2 +- src/gui/transferlistdelegate.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/previewlistdelegate.h b/src/gui/previewlistdelegate.h index 7df55806e..7b7be6871 100644 --- a/src/gui/previewlistdelegate.h +++ b/src/gui/previewlistdelegate.h @@ -69,7 +69,7 @@ class PreviewListDelegate: public QItemDelegate { QStyleOptionProgressBarV2 newopt; qreal progress = index.data().toDouble()*100.; newopt.rect = opt.rect; - newopt.text = misc::accurateDoubleToString(progress, 1) + "%"; + newopt.text = ((progress == 100.0) ? QString("100%") : misc::accurateDoubleToString(progress, 1) + "%"); newopt.progress = (int)progress; newopt.maximum = 100; newopt.minimum = 0; diff --git a/src/gui/properties/proplistdelegate.h b/src/gui/properties/proplistdelegate.h index 8ccc03918..791cbe481 100644 --- a/src/gui/properties/proplistdelegate.h +++ b/src/gui/properties/proplistdelegate.h @@ -82,7 +82,7 @@ public: QStyleOptionProgressBarV2 newopt; qreal progress = index.data().toDouble()*100.; newopt.rect = opt.rect; - newopt.text = misc::accurateDoubleToString(progress, 1) + "%"; + newopt.text = ((progress == 100.0) ? QString("100%") : misc::accurateDoubleToString(progress, 1) + "%"); newopt.progress = (int)progress; newopt.maximum = 100; newopt.minimum = 0; diff --git a/src/gui/transferlistdelegate.cpp b/src/gui/transferlistdelegate.cpp index 2098fd054..402e22a08 100644 --- a/src/gui/transferlistdelegate.cpp +++ b/src/gui/transferlistdelegate.cpp @@ -186,7 +186,7 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem QStyleOptionProgressBarV2 newopt; qreal progress = index.data().toDouble()*100.; newopt.rect = opt.rect; - newopt.text = misc::accurateDoubleToString(progress, 1) + "%"; + newopt.text = ((progress == 100.0) ? QString("100%") : misc::accurateDoubleToString(progress, 1) + "%"); newopt.progress = (int)progress; newopt.maximum = 100; newopt.minimum = 0;