Mercurial > minori
diff src/gui/pages/statistics.cpp @ 15:cde8f67a7c7d
*: update, megacommit :)
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Tue, 19 Sep 2023 22:36:08 -0400 |
parents | fc1bf97c528b |
children | 9ae9365dd4ea |
line wrap: on
line diff
--- a/src/gui/pages/statistics.cpp Tue Sep 19 16:33:07 2023 -0400 +++ b/src/gui/pages/statistics.cpp Tue Sep 19 22:36:08 2023 -0400 @@ -1,8 +1,8 @@ #include "gui/pages/statistics.h" +#include "core/anime_db.h" +#include "core/session.h" #include "gui/pages/anime_list.h" #include "gui/ui_utils.h" -#include "core/session.h" -#include "core/anime_db.h" #include <QString> #include <QTextDocument> #include <QTextStream> @@ -18,13 +18,13 @@ setFrameShadow(QFrame::Sunken); UiUtils::LabelledTextParagraph* anime_list_paragraph = new UiUtils::LabelledTextParagraph( - "Anime list", - "Anime count:\nEpisode count:\nTime spent watching:\nTime to complete:\nAverage score:\nScore deviation:", "", - this); + "Anime list", + "Anime count:\nEpisode count:\nTime spent watching:\nTime to complete:\nAverage score:\nScore deviation:", "\n\n\n\n\n", + this); anime_list_data = anime_list_paragraph->GetParagraph(); UiUtils::LabelledTextParagraph* application_paragraph = - new UiUtils::LabelledTextParagraph("Minori", "Uptime:", "", this); + new UiUtils::LabelledTextParagraph("Minori", "Uptime:", "", this); application_data = application_paragraph->GetParagraph(); layout()->addWidget(anime_list_paragraph); @@ -49,9 +49,11 @@ } /* me abusing macros :) */ -#define ADD_TIME_SEGMENT(r, x, s, p) { \ - if (x > 0) \ - r << x << ((x == 1) ? s : p); } +#define ADD_TIME_SEGMENT(r, x, s, p) \ + { \ + if (x > 0) \ + r << x << ((x == 1) ? s : p); \ + } std::string StatisticsWidget::MinutesToDateString(int minutes) { /* ew */ int years = (minutes * (1 / 525949.2F)); @@ -76,7 +78,8 @@ int days = sec * (1 / 86400.0F) - (years * 365.2425F) - (months * 30.436875F); int hours = sec * (1 / 3600.0F) - (years * 8765.82F) - (months * 730.485F) - (days * 24); int minutes = (sec) * (1 / 60.0F) - (years * 525949.2F) - (months * 43829.1F) - (days * 1440.0F) - (hours * 60.0F); - int seconds = sec - (years * 31556952.0F) - (months * 2629746.0F) - (days * 86400.0F) - (hours * 3600.0F) - (minutes * 60.0F); + int seconds = + sec - (years * 31556952.0F) - (months * 2629746.0F) - (days * 86400.0F) - (hours * 3600.0F) - (minutes * 60.0F); std::ostringstream return_stream; ADD_TIME_SEGMENT(return_stream, years, " year ", " years "); ADD_TIME_SEGMENT(return_stream, months, " month ", " months ");