Fix formatting

This commit is contained in:
Jonas Kvinge 2020-01-05 00:17:18 +01:00
parent f81a3aa8d8
commit 7f6e7f8b30
2 changed files with 15 additions and 11 deletions

View File

@ -99,9 +99,10 @@ QString PrettyTime(int seconds, bool always_show_hours) {
QString ret;
if (hours || always_show_hours)
ret = QString::asprintf("%d:%02d:%02d", hours, minutes,
seconds); // NOLINT(runtime/printf)
seconds); // NOLINT(runtime/printf)
else
ret = QString::asprintf("%d:%02d", minutes, seconds); // NOLINT(runtime/printf)
ret = QString::asprintf("%d:%02d", minutes,
seconds); // NOLINT(runtime/printf)
return ret;
}
@ -165,15 +166,18 @@ QString PrettySize(quint64 bytes) {
if (bytes <= 1000)
ret = QString::number(bytes) + " bytes";
else if (bytes <= 1000 * 1000)
ret = QString::asprintf("%.1f KB",
static_cast<float>(bytes) / 1000); // NOLINT(runtime/printf)
ret = QString::asprintf(
"%.1f KB",
static_cast<float>(bytes) / 1000); // NOLINT(runtime/printf)
else if (bytes <= 1000 * 1000 * 1000)
ret = QString::asprintf("%.1f MB", static_cast<float>(bytes) /
(1000 * 1000)); // NOLINT(runtime/printf)
ret = QString::asprintf(
"%.1f MB",
static_cast<float>(bytes) / (1000 * 1000)); // NOLINT(runtime/printf)
else
ret = QString::asprintf("%.1f GB",
static_cast<float>(bytes) /
(1000 * 1000 * 1000)); // NOLINT(runtime/printf)
ret = QString::asprintf(
"%.1f GB",
static_cast<float>(bytes) /
(1000 * 1000 * 1000)); // NOLINT(runtime/printf)
}
return ret;
}

View File

@ -138,8 +138,8 @@ void StyleHelper::verticalGradient(QPainter* painter, const QRect& spanRect,
QString key;
QColor keyColor = baseColor(lightColored);
key = QString::asprintf("mh_vertical %d %d %d %d %d", spanRect.width(),
spanRect.height(), clipRect.width(), clipRect.height(),
keyColor.rgb());
spanRect.height(), clipRect.width(),
clipRect.height(), keyColor.rgb());
;
QPixmap pixmap;