diff src/gui/pages/anime_list.cc @ 83:d02fdf1d6708

*: huuuge update 1. make the now playing page function correctly 2. de-constructorfy many of our custom widgets, allowing them to be changed on-the-fly from the Now Playing page 3. ... :)
author Paper <mrpapersonic@gmail.com>
date Tue, 24 Oct 2023 22:01:02 -0400
parents 9b2b41f83a5e
children c912128af0eb
line wrap: on
line diff
--- a/src/gui/pages/anime_list.cc	Mon Oct 23 13:37:42 2023 -0400
+++ b/src/gui/pages/anime_list.cc	Tue Oct 24 22:01:02 2023 -0400
@@ -11,7 +11,6 @@
 #include "gui/pages/anime_list.h"
 #include "core/anime.h"
 #include "core/anime_db.h"
-#include "core/array.h"
 #include "core/session.h"
 #include "core/strings.h"
 #include "core/time.h"
@@ -436,7 +435,7 @@
 	tree_view->setContextMenuPolicy(Qt::CustomContextMenu);
 	tree_view->setFrameShape(QFrame::NoFrame);
 
-	for (unsigned int i = 0; i < ARRAYSIZE(sort_models); i++) {
+	for (unsigned int i = 0; i < sort_models.size(); i++) {
 		tab_bar->addTab(Strings::ToQString(Translate::ToString(Anime::ListStatuses[i])) + " (" +
 		                QString::number(Anime::db.GetListsAnimeAmount(Anime::ListStatuses[i])) + ")");
 		sort_models[i] = new AnimeListPageSortFilter(tree_view);
@@ -476,12 +475,12 @@
 }
 
 void AnimeListPage::RefreshList() {
-	for (unsigned int i = 0; i < ARRAYSIZE(sort_models); i++)
+	for (unsigned int i = 0; i < sort_models.size(); i++)
 		reinterpret_cast<AnimeListPageModel*>(sort_models[i]->sourceModel())->RefreshList();
 }
 
 void AnimeListPage::RefreshTabs() {
-	for (unsigned int i = 0; i < ARRAYSIZE(sort_models); i++)
+	for (unsigned int i = 0; i < sort_models.size(); i++)
 		tab_bar->setTabText(i, Strings::ToQString(Translate::ToString(Anime::ListStatuses[i])) + " (" +
 		                           QString::number(Anime::db.GetListsAnimeAmount(Anime::ListStatuses[i])) + ")");
 }
@@ -497,7 +496,7 @@
 void AnimeListPage::Reset() {
 	while (tab_bar->count())
 		tab_bar->removeTab(0);
-	for (unsigned int i = 0; i < ARRAYSIZE(sort_models); i++)
+	for (unsigned int i = 0; i < sort_models.size(); i++)
 		delete sort_models[i];
 }