diff src/gui/pages/anime_list.cc @ 315:34347fd2a2de

session: allow printing status messages ...!
author Paper <paper@paper.us.eu.org>
date Tue, 11 Jun 2024 14:16:40 -0400
parents 8769c5d50b06
children 1b5c04268d6a
line wrap: on
line diff
--- a/src/gui/pages/anime_list.cc	Tue Jun 11 13:29:45 2024 -0400
+++ b/src/gui/pages/anime_list.cc	Tue Jun 11 14:16:40 2024 -0400
@@ -305,8 +305,9 @@
 		if (!index.isValid())
 			continue;
 		Anime::Anime* anime = source_model->GetAnimeFromIndex(index);
-		if (anime)
-			animes.insert(anime);
+		if (!anime)
+			continue;
+		animes.insert(&Anime::db.items[anime->GetId()]);
 	}
 
 	menu->addAction(tr("Information"), [this, animes] {
@@ -352,10 +353,10 @@
 		reinterpret_cast<AnimeListPageModel*>(sort_models[tab_bar->currentIndex()]->sourceModel());
 
 	const QModelIndex index = source_model->index(selection.indexes().first().row());
-	Anime::Anime* anime = source_model->GetAnimeFromIndex(index);
+	Anime::Anime& anime = Anime::db.items[source_model->GetAnimeFromIndex(index)->GetId()];
 
 	InformationDialog* dialog = new InformationDialog(
-		anime, [this](Anime::Anime* anime) { UpdateAnime(anime->GetId()); }, InformationDialog::PAGE_MAIN_INFO, this);
+		&anime, [this](Anime::Anime* anime) { UpdateAnime(anime->GetId()); }, InformationDialog::PAGE_MAIN_INFO, this);
 
 	dialog->show();
 	dialog->raise();