diff src/gui/dialog/information.cpp @ 63:3d2decf093bb

*: fix many clang warnings
author Paper <mrpapersonic@gmail.com>
date Sun, 01 Oct 2023 06:39:47 -0400
parents 4c6dd5999b39
children fe719c109dbc
line wrap: on
line diff
--- a/src/gui/dialog/information.cpp	Sun Oct 01 06:16:06 2023 -0400
+++ b/src/gui/dialog/information.cpp	Sun Oct 01 06:39:47 2023 -0400
@@ -5,8 +5,8 @@
 #include "core/strings.h"
 #include "gui/pages/anime_list.h"
 #include "gui/translate/anime.h"
+#include "gui/widgets/optional_date.h"
 #include "gui/widgets/text.h"
-#include "gui/widgets/optional_date.h"
 #include "gui/window.h"
 #include <QCheckBox>
 #include <QComboBox>
@@ -109,8 +109,9 @@
 	               << Translate::ToString(anime.GetSeason()).c_str() << " " << anime.GetAirDate().GetYear() << "\n"
 	               << Strings::Implode(anime.GetGenres(), ", ").c_str() << "\n"
 	               << anime.GetAudienceScore() << "%";
-	main_information_widget->layout()->addWidget(new TextWidgets::LabelledTextParagraph(
-	    tr("Details"), tr("Type:\nEpisodes:\nStatus:\nSeason:\nGenres:\nScore:"), details_data, main_information_widget));
+	main_information_widget->layout()->addWidget(
+	    new TextWidgets::LabelledTextParagraph(tr("Details"), tr("Type:\nEpisodes:\nStatus:\nSeason:\nGenres:\nScore:"),
+	                                           details_data, main_information_widget));
 
 	/* synopsis */
 	TextWidgets::SelectableTextParagraph* synopsis = new TextWidgets::SelectableTextParagraph(
@@ -186,9 +187,7 @@
 			subsection->layout()->addWidget(new QLabel(tr("Episodes watched:"), subsection));
 
 			QSpinBox* spin_box = new QSpinBox(subsection);
-			connect(spin_box, QOverload<int>::of(&QSpinBox::valueChanged), this, [this](int i) {
-				progress = i;
-			});
+			connect(spin_box, QOverload<int>::of(&QSpinBox::valueChanged), this, [this](int i) { progress = i; });
 			spin_box->setRange(0, anime.GetEpisodes());
 			spin_box->setSingleStep(1);
 			spin_box->setValue(progress = anime.GetUserProgress());
@@ -198,9 +197,8 @@
 			subsection->layout()->addWidget(new QLabel(tr(" "), subsection));
 
 			QCheckBox* checkbox = new QCheckBox(tr("Rewatching"));
-			connect(checkbox, QOverload<int>::of(&QCheckBox::stateChanged), this, [this](int state) {
-				rewatching = (state == Qt::Checked);
-			});
+			connect(checkbox, QOverload<int>::of(&QCheckBox::stateChanged), this,
+			        [this](int state) { rewatching = (state == Qt::Checked); });
 			checkbox->setCheckState(anime.GetUserIsRewatching() ? Qt::Checked : Qt::Unchecked);
 			subsection->layout()->addWidget(checkbox);
 		});
@@ -216,19 +214,16 @@
 
 			QComboBox* combo_box = new QComboBox(subsection);
 			combo_box->addItems(string_list);
-			connect(combo_box, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this](int i) {
-				status = Anime::ListStatuses[i];
-			});
-			combo_box->setCurrentIndex(static_cast<int>(status = anime.GetUserStatus())-1);
+			connect(combo_box, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
+			        [this](int i) { status = Anime::ListStatuses[i]; });
+			combo_box->setCurrentIndex(static_cast<int>(status = anime.GetUserStatus()) - 1);
 			subsection->layout()->addWidget(combo_box);
 		});
 		CREATE_SUBSECTION({
 			subsection->layout()->addWidget(new QLabel(tr("Score:"), subsection));
 
 			QSpinBox* spin_box = new QSpinBox(subsection);
-			connect(spin_box, QOverload<int>::of(&QSpinBox::valueChanged), this, [this](int i) {
-				score = i;
-			});
+			connect(spin_box, QOverload<int>::of(&QSpinBox::valueChanged), this, [this](int i) { score = i; });
 			spin_box->setRange(0, 100);
 			spin_box->setSingleStep(5);
 			spin_box->setValue(score = anime.GetUserScore());
@@ -256,9 +251,8 @@
 			subsection->layout()->addWidget(new QLabel(tr("Date started:"), subsection));
 
 			OptionalDate* date = new OptionalDate(true, subsection);
-			connect(date, &OptionalDate::DataChanged, this, [this](bool enabled, Date date) {
-				started = (enabled) ? date : Date();
-			});
+			connect(date, &OptionalDate::DataChanged, this,
+			        [this](bool enabled, Date date) { started = (enabled) ? date : Date(); });
 			started = anime.GetUserDateStarted();
 			if (!started.IsValid()) {
 				date->SetEnabled(false);
@@ -271,9 +265,8 @@
 			subsection->layout()->addWidget(new QLabel(tr("Date completed:"), subsection));
 
 			OptionalDate* date = new OptionalDate(true, subsection);
-			connect(date, &OptionalDate::DataChanged, this, [this](bool enabled, Date date) {
-				completed = (enabled) ? date : Date();
-			});
+			connect(date, &OptionalDate::DataChanged, this,
+			        [this](bool enabled, Date date) { completed = (enabled) ? date : Date(); });
 			completed = anime.GetUserDateCompleted();
 			if (!completed.IsValid()) {
 				date->SetEnabled(false);