Mercurial > minori
comparison src/gui/pages/anime_list.cc @ 198:bc1ae1810855
dep/animia: switch from using classes to global functions
the old idea was ok, but sort of hackish; this method doesn't use classes
at all, and this way (especially important!) we can do wayland stuff AND x11
at the same time, which wasn't really possible without stupid workarounds in
the other method
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 24 Dec 2023 02:59:42 -0500 |
parents | c4ca035c565d |
children | 7cf53145de11 |
comparison
equal
deleted
inserted
replaced
197:c4ca035c565d | 198:bc1ae1810855 |
---|---|
114 QString::number(list[index.row()].GetEpisodes()); | 114 QString::number(list[index.row()].GetEpisodes()); |
115 case AL_EPISODES: return list[index.row()].GetEpisodes(); | 115 case AL_EPISODES: return list[index.row()].GetEpisodes(); |
116 case AL_SCORE: return Strings::ToQString(list[index.row()].GetUserPresentableScore()); | 116 case AL_SCORE: return Strings::ToQString(list[index.row()].GetUserPresentableScore()); |
117 case AL_TYPE: return Strings::ToQString(Translate::ToString(list[index.row()].GetFormat())); | 117 case AL_TYPE: return Strings::ToQString(Translate::ToString(list[index.row()].GetFormat())); |
118 case AL_SEASON: { | 118 case AL_SEASON: { |
119 const std::optional<unsigned int> year = list[index.row()].GetAirDate().GetYear(); | 119 std::optional<unsigned int> year = list[index.row()].GetAirDate().GetYear(); |
120 if (year.has_value()) | 120 if (!year) |
121 return Strings::ToQString(Translate::ToString(list[index.row()].GetSeason()) + " " + std::to_string(year.value())); | 121 return "Unknown Unknown"; |
122 return Strings::ToQString(Translate::ToLocalString(list[index.row()].GetSeason()) + " " + std::to_string(year.value())); | |
122 } | 123 } |
123 case AL_AVG_SCORE: return QString::number(list[index.row()].GetAudienceScore()) + "%"; | 124 case AL_AVG_SCORE: return QString::number(list[index.row()].GetAudienceScore()) + "%"; |
124 case AL_STARTED: return list[index.row()].GetUserDateStarted().GetAsQDate(); | 125 case AL_STARTED: return list[index.row()].GetUserDateStarted().GetAsQDate(); |
125 case AL_COMPLETED: return list[index.row()].GetUserDateCompleted().GetAsQDate(); | 126 case AL_COMPLETED: return list[index.row()].GetUserDateCompleted().GetAsQDate(); |
126 case AL_UPDATED: { | 127 case AL_UPDATED: { |