From 8f998b009b014b0e73c3b33e515b4d8cba3fac8c Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Sat, 23 Mar 2013 16:19:27 +0000 Subject: [PATCH] - fixed 1247 --- lib/CConfigHandler.cpp | 3 +-- lib/Filesystem/CFilesystemLoader.cpp | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CConfigHandler.cpp b/lib/CConfigHandler.cpp index efceff194..263631e10 100644 --- a/lib/CConfigHandler.cpp +++ b/lib/CConfigHandler.cpp @@ -57,6 +57,7 @@ SettingsStorage::SettingsStorage(): void SettingsStorage::init() { + CResourceHandler::get()->createResource("config/settings.json"); JsonNode(ResourceID("config/settings.json")).swap(config); JsonNode schema(ResourceID("config/defaultSettings.json")); JsonUtils::validate(config, schema); @@ -73,8 +74,6 @@ void SettingsStorage::invalidateNode(const std::vector &changedPath savedConf.Struct().erase("session"); JsonUtils::minimize(savedConf, schema); - CResourceHandler::get()->createResource("CONFIG/settings.json"); - std::ofstream file(CResourceHandler::get()->getResourceName(ResourceID("config/settings.json")), std::ofstream::trunc); file << savedConf; } diff --git a/lib/Filesystem/CFilesystemLoader.cpp b/lib/Filesystem/CFilesystemLoader.cpp index 87cada10b..df1f4605e 100644 --- a/lib/Filesystem/CFilesystemLoader.cpp +++ b/lib/Filesystem/CFilesystemLoader.cpp @@ -46,6 +46,7 @@ bool CFilesystemLoader::createEntry(std::string filename) return false; fileList[res] = filename; + std::ofstream newfile (baseDirectory + "/" + filename); return true; }