Skip to content

Commit

Permalink
Add Entry alias for std::variant<Game, AddApp>
Browse files Browse the repository at this point in the history
  • Loading branch information
oblivioncth committed Nov 12, 2023
1 parent 3dc1dc9 commit 9a46e14
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/include/fp/fp-db.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ class FP_FP_EXPORT Db : public QObject
DbError entryUsesDataPack(bool& resultBuffer, const QUuid& gameId);

// Helper
DbError getEntry(std::variant<Game, AddApp>& entry, const QUuid& entryId);
DbError getEntry(Entry& entry, const QUuid& entryId);
DbError getGameData(GameData& data, const QUuid& gameId);
DbError updateGameDataOnDiskState(QList<int> packIds, bool onDisk);

Expand Down
5 changes: 4 additions & 1 deletion lib/include/fp/fp-items.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Fp
//-Enums----------------------------------------------------------------------------------------------------------
enum class ImageType {Logo, Screenshot};

//-Namespace Global Classes-----------------------------------------------------------------------------------------
//-Namespace Classes---------------------------------------------------------------------------------------------
class FP_FP_EXPORT Game
{
//-Inner Classes----------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -402,6 +402,9 @@ class FP_FP_EXPORT Playlist::Builder
Playlist build();
};

//-Namespace Types---------------------------------------------------------------------------------------------
using Entry = std::variant<Game, AddApp>;

}

#endif // FLASHPOINT_ITEMS_H
2 changes: 1 addition & 1 deletion lib/src/fp-db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ DbError Db::entryUsesDataPack(bool& resultBuffer, const QUuid& gameId)
return DbError();
}

DbError Db::getEntry(std::variant<Game, AddApp>& entry, const QUuid& entryId)
DbError Db::getEntry(Entry& entry, const QUuid& entryId)
{
// Find title
Db::EntryFilter mainFilter{.type = Fp::Db::EntryType::PrimaryThenAddApp, .id = entryId};
Expand Down

0 comments on commit 9a46e14

Please sign in to comment.