Skip to content

Commit 3392060

Browse files
committed
Added support for LaunchBox game sort titles
1 parent c027320 commit 3392060

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/backend/providers/launchbox/LaunchBoxGamelistXml.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ enum class GameField : unsigned char {
3939
ID,
4040
PATH,
4141
TITLE,
42+
SORT_TITLE,
4243
RELEASE,
4344
DEVELOPER,
4445
PUBLISHER,
@@ -75,6 +76,8 @@ void apply_game_fields(
7576
switch (pair.first) {
7677
case GameField::TITLE:
7778
game.setTitle(pair.second);
79+
break;
80+
case GameField::SORT_TITLE:
7881
game.setSortBy(pair.second);
7982
break;
8083
case GameField::NOTES:
@@ -178,6 +181,7 @@ GamelistXml::GamelistXml(QString log_tag, QDir lb_root)
178181
{ QStringLiteral("ID"), GameField::ID },
179182
{ QStringLiteral("ApplicationPath"), GameField::PATH },
180183
{ QStringLiteral("Title"), GameField::TITLE },
184+
{ QStringLiteral("SortTitle"), GameField::SORT_TITLE },
181185
{ QStringLiteral("Developer"), GameField::DEVELOPER },
182186
{ QStringLiteral("Publisher"), GameField::PUBLISHER },
183187
{ QStringLiteral("ReleaseDate"), GameField::RELEASE },

tests/backend/providers/launchbox/data/basic/LaunchBox/Data/Platforms/Nintendo Entertainment System.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<ScummVMFullscreen>false</ScummVMFullscreen>
2727
<ScummVMGameDataFolderPath />
2828
<ScummVMGameType />
29-
<SortTitle />
29+
<SortTitle>Super Mario 1</SortTitle>
3030
<Source />
3131
<StarRatingFloat>0</StarRatingFloat>
3232
<StarRating>0</StarRating>

tests/backend/providers/launchbox/test_LaunchBoxProvider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void test_LaunchBoxProvider::basic()
108108

109109

110110
QCOMPARE(game.title(), QStringLiteral("Super Mario Bros."));
111-
QCOMPARE(game.sortBy(), QStringLiteral("Super Mario Bros."));
111+
QCOMPARE(game.sortBy(), QStringLiteral("Super Mario 1"));
112112
QCOMPARE(game.summary(), QStringLiteral("Some description here!"));
113113
QCOMPARE(game.description(), QStringLiteral("Some description here!"));
114114
QCOMPARE(game.releaseDate(), QDate(1985, 9, 13));

0 commit comments

Comments
 (0)