Changeset 891
- Timestamp:
- 03/04/10 01:05:27 (5 months ago)
- Location:
- trunk/engine/Util
- Files:
-
- 2 modified
-
Config.cpp (modified) (2 diffs)
-
Config.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/engine/Util/Config.cpp
r828 r891 190 190 191 191 /** 192 * Check if saving the config to disk is disabled. 193 * @return @c true if saving is disabled. 194 * @see #SetUnlinked(bool) 195 */ 196 bool Config::IsUnlinked() const 197 { 198 return unlinked; 199 } 200 201 /** 202 * Enable or disable saving the configuration to disk. 203 * This is useful for testing, since it allows temporary changes 204 * without overwriting the config previously saved to disk. 205 * @param unlinked @c true to prevent saving config to disk. 206 */ 207 void Config::SetUnlinked(bool unlinked) 208 { 209 this->unlinked = unlinked; 210 } 211 212 /** 192 213 * Check if this build is a prerelease (development) version. 193 214 * @return @c true if prerelease. … … 571 592 void Config::Save() 572 593 { 594 if (unlinked) return; 595 573 596 const std::string &cfgfile = GetConfigFilename(); 574 597 -
trunk/engine/Util/Config.h
r880 r891 67 67 private: 68 68 static Config *instance; 69 bool unlinked; ///< if @c true, will prevent saving config. 69 70 std::string path; 70 71 int verMajor; … … 87 88 bool prerelease, const std::string &path=""); 88 89 static void Shutdown(); 90 91 bool IsUnlinked() const; 92 void SetUnlinked(bool unlinked); 89 93 90 94 bool IsPrerelease() const;
