X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FMoof%2FSettings.cc;h=c5c3734189fc159f63bfd10fb2a702e5fb5a86d5;hb=7f3984f3f9524f5b6813e01ceb2fe576dadff94e;hp=5a4f99127f099ef847f1822f8b875614f0d3674b;hpb=a31d65a998121df0651c57bfb68782e2a07d2e2f;p=chaz%2Fyoink diff --git a/src/Moof/Settings.cc b/src/Moof/Settings.cc index 5a4f991..c5c3734 100644 --- a/src/Moof/Settings.cc +++ b/src/Moof/Settings.cc @@ -35,6 +35,11 @@ namespace Mf { +Settings::~Settings() +{ + save(); +} + Settings& Settings::getInstance() { static Settings settings; @@ -72,19 +77,41 @@ void Settings::loadFromFiles(const std::vector& filePaths) if (home) { boost::replace_all(path, "$HOME", home); + + //Mf::logDebug("Copying global settings..."); + //mUserFile = path; + //mGlobals.pushCopy(); + //mScript.set("globals", Script::REGISTRY); } if (mScript.doFile(path) != Script::SUCCESS) { std::string str; mScript[-1].get(str); - logScript("%s", str.c_str()); + logInfo(str); mScript.clear(); } } } +void Settings::clear() +{ + mScript.reset(); +} + + +void Settings::saveAs(const std::string& filePath) +{ + mUserFile = filePath; + save(); +} + +void Settings::save() const +{ +} + + } // namepsace Mf /** vim: set ts=4 sw=4 tw=80: *************************************************/