Skip to content

Commit

Permalink
libdoomsday|GameProfiles: Profiles can be marked as user-created
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Mar 12, 2016
1 parent 6dcb699 commit 844d70e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doomsday/apps/libdoomsday/include/doomsday/gameprofiles.h
Expand Up @@ -41,9 +41,11 @@ class LIBDOOMSDAY_PUBLIC GameProfiles : public de::Profiles

void setGame(de::String const &id);
void setPackages(de::StringList const &packagesInOrder);
void setUserCreated(bool userCreated);

de::String game() const;
de::StringList packages() const;
bool isUserCreated() const;

virtual bool resetToDefaults();
virtual de::String toInfoSource() const;
Expand Down
11 changes: 11 additions & 0 deletions doomsday/apps/libdoomsday/src/gameprofiles.cpp
Expand Up @@ -95,6 +95,7 @@ DENG2_PIMPL_NOREF(GameProfiles::Profile)
{
String gameId;
StringList packages;
bool userCreated = false;
};

GameProfiles::Profile::Profile(String const &name) : d(new Instance)
Expand All @@ -112,6 +113,11 @@ void GameProfiles::Profile::setPackages(StringList const &packagesInOrder)
d->packages = packagesInOrder;
}

void GameProfiles::Profile::setUserCreated(bool userCreated)
{
d->userCreated = userCreated;
}

String GameProfiles::Profile::game() const
{
return d->gameId;
Expand All @@ -122,6 +128,11 @@ StringList GameProfiles::Profile::packages() const
return d->packages;
}

bool GameProfiles::Profile::isUserCreated() const
{
return d->userCreated;
}

bool GameProfiles::Profile::resetToDefaults()
{
if(isReadOnly()) return false;
Expand Down

0 comments on commit 844d70e

Please sign in to comment.