annotate src/gui/translate/anime.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 75c804f713b2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
1 #include "core/anime.h"
65
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
2 #include "core/strings.h"
15
cde8f67a7c7d *: update, megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
3 #include "gui/translate/anime.h"
51
75c804f713b2 window: add about window,
Paper <mrpapersonic@gmail.com>
parents: 46
diff changeset
4 #include <QCoreApplication>
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
5
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
6 namespace Translate {
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
7
15
cde8f67a7c7d *: update, megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
8 std::string ToString(const Anime::ListStatus status) {
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
9 switch (status) {
65
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
10 case Anime::ListStatus::NOT_IN_LIST: return Strings::ToUtf8String(QCoreApplication::tr("Not in list"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
11 case Anime::ListStatus::CURRENT: return Strings::ToUtf8String(QCoreApplication::tr("Currently watching"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
12 case Anime::ListStatus::PLANNING: return Strings::ToUtf8String(QCoreApplication::tr("Plan to watch"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
13 case Anime::ListStatus::COMPLETED: return Strings::ToUtf8String(QCoreApplication::tr("Completed"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
14 case Anime::ListStatus::DROPPED: return Strings::ToUtf8String(QCoreApplication::tr("Dropped"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
15 case Anime::ListStatus::PAUSED: return Strings::ToUtf8String(QCoreApplication::tr("On hold"));
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
16 default: return "";
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
17 }
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
18 }
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
19
15
cde8f67a7c7d *: update, megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
20 std::string ToString(const Anime::SeriesFormat format) {
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
21 switch (format) {
65
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
22 case Anime::SeriesFormat::UNKNOWN: return Strings::ToUtf8String(QCoreApplication::tr("Unknown"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
23 case Anime::SeriesFormat::TV: return Strings::ToUtf8String(QCoreApplication::tr("TV"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
24 case Anime::SeriesFormat::TV_SHORT: return Strings::ToUtf8String(QCoreApplication::tr("TV short"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
25 case Anime::SeriesFormat::OVA: return Strings::ToUtf8String(QCoreApplication::tr("OVA"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
26 case Anime::SeriesFormat::MOVIE: return Strings::ToUtf8String(QCoreApplication::tr("Movie"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
27 case Anime::SeriesFormat::SPECIAL: return Strings::ToUtf8String(QCoreApplication::tr("Special"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
28 case Anime::SeriesFormat::ONA: return Strings::ToUtf8String(QCoreApplication::tr("ONA"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
29 case Anime::SeriesFormat::MUSIC: return Strings::ToUtf8String(QCoreApplication::tr("Music"));
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
30 default: return "";
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
31 }
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
32 }
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
33
15
cde8f67a7c7d *: update, megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
34 std::string ToString(const Anime::SeriesSeason season) {
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
35 switch (season) {
65
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
36 case Anime::SeriesSeason::UNKNOWN: return Strings::ToUtf8String(QCoreApplication::tr("Unknown"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
37 case Anime::SeriesSeason::WINTER: return Strings::ToUtf8String(QCoreApplication::tr("Winter"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
38 case Anime::SeriesSeason::SUMMER: return Strings::ToUtf8String(QCoreApplication::tr("Summer"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
39 case Anime::SeriesSeason::FALL: return Strings::ToUtf8String(QCoreApplication::tr("Fall"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
40 case Anime::SeriesSeason::SPRING: return Strings::ToUtf8String(QCoreApplication::tr("Spring"));
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
41 default: return "";
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
42 }
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
43 }
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
44
15
cde8f67a7c7d *: update, megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
45 std::string ToString(const Anime::SeriesStatus status) {
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
46 switch (status) {
65
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
47 case Anime::SeriesStatus::UNKNOWN: return Strings::ToUtf8String(QCoreApplication::tr("Unknown"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
48 case Anime::SeriesStatus::RELEASING: return Strings::ToUtf8String(QCoreApplication::tr("Currently airing"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
49 case Anime::SeriesStatus::FINISHED: return Strings::ToUtf8String(QCoreApplication::tr("Finished airing"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
50 case Anime::SeriesStatus::NOT_YET_RELEASED: return Strings::ToUtf8String(QCoreApplication::tr("Not yet aired"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
51 case Anime::SeriesStatus::CANCELLED: return Strings::ToUtf8String(QCoreApplication::tr("Cancelled"));
26721c28bf22 *: avoid usage of (to|from)StdString
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
52 case Anime::SeriesStatus::HIATUS: return Strings::ToUtf8String(QCoreApplication::tr("On hiatus"));
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
53 default: return "";
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
54 }
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
55 }
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
56
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents: 15
diff changeset
57 } // namespace Translate