Skip to content

Commit

Permalink
Added support for LaunchBox game sort titles
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatyas committed Mar 28, 2021
1 parent c027320 commit 3392060
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/backend/providers/launchbox/LaunchBoxGamelistXml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ enum class GameField : unsigned char {
ID,
PATH,
TITLE,
SORT_TITLE,
RELEASE,
DEVELOPER,
PUBLISHER,
Expand Down Expand Up @@ -75,6 +76,8 @@ void apply_game_fields(
switch (pair.first) {
case GameField::TITLE:
game.setTitle(pair.second);
break;
case GameField::SORT_TITLE:
game.setSortBy(pair.second);
break;
case GameField::NOTES:
Expand Down Expand Up @@ -178,6 +181,7 @@ GamelistXml::GamelistXml(QString log_tag, QDir lb_root)
{ QStringLiteral("ID"), GameField::ID },
{ QStringLiteral("ApplicationPath"), GameField::PATH },
{ QStringLiteral("Title"), GameField::TITLE },
{ QStringLiteral("SortTitle"), GameField::SORT_TITLE },
{ QStringLiteral("Developer"), GameField::DEVELOPER },
{ QStringLiteral("Publisher"), GameField::PUBLISHER },
{ QStringLiteral("ReleaseDate"), GameField::RELEASE },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<ScummVMFullscreen>false</ScummVMFullscreen>
<ScummVMGameDataFolderPath />
<ScummVMGameType />
<SortTitle />
<SortTitle>Super Mario 1</SortTitle>
<Source />
<StarRatingFloat>0</StarRatingFloat>
<StarRating>0</StarRating>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void test_LaunchBoxProvider::basic()


QCOMPARE(game.title(), QStringLiteral("Super Mario Bros."));
QCOMPARE(game.sortBy(), QStringLiteral("Super Mario Bros."));
QCOMPARE(game.sortBy(), QStringLiteral("Super Mario 1"));
QCOMPARE(game.summary(), QStringLiteral("Some description here!"));
QCOMPARE(game.description(), QStringLiteral("Some description here!"));
QCOMPARE(game.releaseDate(), QDate(1985, 9, 13));
Expand Down

0 comments on commit 3392060

Please sign in to comment.