diff src/gui/pages/anime_list.cpp @ 65:26721c28bf22

*: avoid usage of (to|from)StdString in Qt5 (and probably Qt6 as well) these functions are only available (or even usable) if Qt and Minori were built with the *same standard headers*, which may not be the case in some circumstances. hence, we'll use our own conversion functions, which we probably should use anyway.
author Paper <mrpapersonic@gmail.com>
date Sun, 01 Oct 2023 23:26:35 -0400
parents fe719c109dbc
children 2417121d894e
line wrap: on
line diff
--- a/src/gui/pages/anime_list.cpp	Sun Oct 01 23:15:43 2023 -0400
+++ b/src/gui/pages/anime_list.cpp	Sun Oct 01 23:26:35 2023 -0400
@@ -14,6 +14,7 @@
 #include "core/array.h"
 #include "core/session.h"
 #include "core/time.h"
+#include "core/strings.h"
 #include "gui/dialog/information.h"
 #include "gui/translate/anime.h"
 #include "services/services.h"
@@ -143,9 +144,9 @@
 					       QString::number(list[index.row()].GetEpisodes());
 				case AL_EPISODES: return list[index.row()].GetEpisodes();
 				case AL_SCORE: return list[index.row()].GetUserScore();
-				case AL_TYPE: return QString::fromStdString(Translate::ToString(list[index.row()].GetFormat()));
+				case AL_TYPE: return Strings::ToQString(Translate::ToString(list[index.row()].GetFormat()));
 				case AL_SEASON:
-					return QString::fromStdString(Translate::ToString(list[index.row()].GetSeason())) + " " +
+					return Strings::ToQString(Translate::ToString(list[index.row()].GetSeason())) + " " +
 					       QString::number(list[index.row()].GetAirDate().GetYear());
 				case AL_AVG_SCORE: return QString::number(list[index.row()].GetAudienceScore()) + "%";
 				case AL_STARTED: return list[index.row()].GetUserDateStarted().GetAsQDate();
@@ -441,7 +442,7 @@
 	tree_view->setFrameShape(QFrame::NoFrame);
 
 	for (unsigned int i = 0; i < ARRAYSIZE(sort_models); i++) {
-		tab_bar->addTab(QString::fromStdString(Translate::ToString(Anime::ListStatuses[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);
 		sort_models[i]->setSourceModel(new AnimeListPageModel(this, Anime::ListStatuses[i]));
@@ -486,7 +487,7 @@
 
 void AnimeListPage::RefreshTabs() {
 	for (unsigned int i = 0; i < ARRAYSIZE(sort_models); i++)
-		tab_bar->setTabText(i, QString::fromStdString(Translate::ToString(Anime::ListStatuses[i])) + " (" +
+		tab_bar->setTabText(i, Strings::ToQString(Translate::ToString(Anime::ListStatuses[i])) + " (" +
 		                           QString::number(Anime::db.GetListsAnimeAmount(Anime::ListStatuses[i])) + ")");
 }