aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/MainWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/ui/MainWindow.cpp')
-rw-r--r--launcher/ui/MainWindow.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp
index 331ca0e1..a921e378 100644
--- a/launcher/ui/MainWindow.cpp
+++ b/launcher/ui/MainWindow.cpp
@@ -1652,16 +1652,6 @@ void MainWindow::onCatToggled(bool state)
APPLICATION->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)
@@ -1671,11 +1661,11 @@ void MainWindow::setCatBackground(bool enabled)
QDateTime xmas(QDate(now.date().year(), 12, 25), QTime(0, 0));
QDateTime halloween(QDate(now.date().year(), 10, 31), QTime(0, 0));
QString cat = APPLICATION->settings()->get("BackgroundCat").toString();
- if (non_stupid_abs(now.daysTo(xmas)) <= 4) {
+ if (std::abs(now.daysTo(xmas)) <= 4) {
cat += "-xmas";
- } else if (non_stupid_abs(now.daysTo(halloween)) <= 4) {
+ } else if (std::abs(now.daysTo(halloween)) <= 4) {
cat += "-spooky";
- } else if (non_stupid_abs(now.daysTo(birthday)) <= 12) {
+ } else if (std::abs(now.daysTo(birthday)) <= 12) {
cat += "-bday";
}
view->setStyleSheet(QString(R"(