diff options
author | Petr Mrázek <peterix@gmail.com> | 2018-12-24 14:49:53 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2018-12-24 14:49:53 +0100 |
commit | 3e60e770b573f79b6792daa9cc7de50c41cf5216 (patch) | |
tree | bc9bf61498ff054e5dea114dc89b04342c86d0aa /application/MainWindow.cpp | |
parent | 70052b180ca37b24252df87f0aa34360275e1066 (diff) | |
download | MultiMC-3e60e770b573f79b6792daa9cc7de50c41cf5216.tar MultiMC-3e60e770b573f79b6792daa9cc7de50c41cf5216.tar.gz MultiMC-3e60e770b573f79b6792daa9cc7de50c41cf5216.tar.lz MultiMC-3e60e770b573f79b6792daa9cc7de50c41cf5216.tar.xz MultiMC-3e60e770b573f79b6792daa9cc7de50c41cf5216.zip |
NOISSUE just don't use std::abs, it doesn't work
Diffstat (limited to 'application/MainWindow.cpp')
-rw-r--r-- | application/MainWindow.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp index a1066718..56119942 100644 --- a/application/MainWindow.cpp +++ b/application/MainWindow.cpp @@ -1241,6 +1241,16 @@ void MainWindow::onCatToggled(bool state) MMC->settings()->set("TheCat", state); } +namespace { +template <typename T> +T non_stupid_abs(T in) +{ + if (in < 0) + return -in; + return in; +} +} + void MainWindow::setCatBackground(bool enabled) { if (enabled) @@ -1248,7 +1258,7 @@ void MainWindow::setCatBackground(bool enabled) QDateTime now = QDateTime::currentDateTime(); QDateTime xmas(QDate(now.date().year(), 12, 25), QTime(0, 0)); ; - QString cat = (std::abs(now.daysTo(xmas)) <= 4) ? "catmas" : "kitteh"; + QString cat = (non_stupid_abs(now.daysTo(xmas)) <= 4) ? "catmas" : "kitteh"; view->setStyleSheet(QString(R"( GroupView { |