From bd255ef8d5757332b2a9aa4fc25801dfa3178445 Mon Sep 17 00:00:00 2001 From: William JCM Date: Mon, 27 Sep 2021 16:17:32 +0200 Subject: [PATCH] Profile: ensure (in)validity. --- src/Profile/Profile.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Profile/Profile.cpp b/src/Profile/Profile.cpp index 7c850de..024be15 100644 --- a/src/Profile/Profile.cpp +++ b/src/Profile/Profile.cpp @@ -48,6 +48,8 @@ Profile::Profile(const std::string& path): _steamId = Utility::String::ltrim(Utility::String::rtrim(_filename, ".sav"), (_type == ProfileType::Demo ? "Demo" : "") + std::string{"Profile"}); + refreshValues(); + _valid = _profile.valid(); } @@ -74,6 +76,7 @@ auto Profile::steamId() const -> std::string const& { void Profile::refreshValues() { if(!_profile.reloadData()) { _lastError = _profile.lastError(); + _valid = false; return; }