Skip to content

Commit

Permalink
libdoomsday|GameProfiles: Save the "userCreated" property of profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Mar 27, 2016
1 parent c43697b commit ad3e9f5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions doomsday/apps/libdoomsday/src/gameprofiles.cpp
Expand Up @@ -26,8 +26,9 @@

using namespace de;

static String const VAR_GAME ("game");
static String const VAR_PACKAGES("packages");
static String const VAR_GAME ("game");
static String const VAR_PACKAGES ("packages");
static String const VAR_USER_CREATED("userCreated");

DENG2_PIMPL(GameProfiles)
, DENG2_OBSERVES(Games, Addition)
Expand Down Expand Up @@ -86,6 +87,8 @@ Profiles::AbstractProfile *GameProfiles::profileFromInfoBlock(Info::BlockElement
prof->setPackages(ids);
}

prof->setUserCreated(!block.keyValue(VAR_USER_CREATED).text.compareWithoutCase("True"));

return prof.release();
}

Expand Down Expand Up @@ -148,7 +151,8 @@ String GameProfiles::Profile::toInfoSource() const
os.setCodec("UTF-8");

os << VAR_GAME << ": " << d->gameId << "\n"
<< VAR_PACKAGES << " <" << String::join(d->packages, ", ") << ">";
<< VAR_PACKAGES << " <" << String::join(d->packages, ", ") << ">\n"
<< VAR_USER_CREATED << ": " << (d->userCreated? "True" : "False");

return info;
}

0 comments on commit ad3e9f5

Please sign in to comment.