diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2022-02-21 17:38:48 +0100 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2022-02-21 17:46:56 +0100 |
commit | ab36dc80a3fccb864709608b8f89b75299c18931 (patch) | |
tree | b77691a33f5a93cc844d868e35f2b6cc0e06b313 /app-office/ktimetracker/files/ktimetracker-5.0.1-fix-formatTime-in-non-decimal-mode.patch | |
parent | sys-auth/polkit-qt: EAPI-8 bump, two upstream backports (diff) | |
download | gentoo-ab36dc80a3fccb864709608b8f89b75299c18931.tar.gz gentoo-ab36dc80a3fccb864709608b8f89b75299c18931.tar.bz2 gentoo-ab36dc80a3fccb864709608b8f89b75299c18931.zip |
app-office/ktimetracker: EAPI-8 bump, several upstream fixes
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=417988
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=424993
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'app-office/ktimetracker/files/ktimetracker-5.0.1-fix-formatTime-in-non-decimal-mode.patch')
-rw-r--r-- | app-office/ktimetracker/files/ktimetracker-5.0.1-fix-formatTime-in-non-decimal-mode.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/app-office/ktimetracker/files/ktimetracker-5.0.1-fix-formatTime-in-non-decimal-mode.patch b/app-office/ktimetracker/files/ktimetracker-5.0.1-fix-formatTime-in-non-decimal-mode.patch new file mode 100644 index 000000000000..ad5be92794a3 --- /dev/null +++ b/app-office/ktimetracker/files/ktimetracker-5.0.1-fix-formatTime-in-non-decimal-mode.patch @@ -0,0 +1,33 @@ +From 310c0fee25f142c6f6a0e7a0b4445af2e8785c79 Mon Sep 17 00:00:00 2001 +From: Pino Toscano <pino@kde.org> +Date: Wed, 21 Oct 2020 10:49:20 +0200 +Subject: [PATCH] Fix formatTime() in non-decimal mode on 32bit archs + +int64_t is not long int on 32bit architectures but long long int, thus +the "%ld" printf modifer gets truncated/wrong values. + +As solution, do not use int64_t but long long int, so the "%lld" can be +always used. +--- + src/ktimetrackerutility.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/ktimetrackerutility.cpp b/src/ktimetrackerutility.cpp +index aca00e8..fe449ba 100644 +--- a/src/ktimetrackerutility.cpp ++++ b/src/ktimetrackerutility.cpp +@@ -33,9 +33,9 @@ QString formatTime(double minutes, bool decimal) + time.sprintf("%.2f", minutes / 60.0); + time.replace('.', QLocale().decimalPoint()); + } else { +- const auto absMinutes = static_cast<int64_t>(std::round(std::fabs(minutes))); ++ const auto absMinutes = static_cast<long long int>(std::round(std::fabs(minutes))); + time.sprintf( +- "%s%ld:%02ld", ++ "%s%lld:%02lld", + minutes < 0 ? QString(QLocale().negativeSign()).toUtf8().data() : "", + absMinutes / 60, absMinutes % 60); + } +-- +GitLab + |