]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Settings.cc
simplified win32 installer build script
[chaz/yoink] / src / Moof / Settings.cc
index 53cb850f5a6f1cc661057ca4c6f10d4e5a31b3b2..9f0538b3b827c56e4d6037a79edd2f659e62eaba 100644 (file)
 namespace Mf {
 
 
+Settings::~Settings()
+{
+       save();
+}
+
 Settings& Settings::getInstance()
 {
        static Settings settings;
@@ -46,7 +51,7 @@ void Settings::parseArgs(int argc, char* argv[])
 {
        for (int i = 1; i < argc; ++i)
        {
-               script_.doString(argv[i]);
+               mScript.doString(argv[i]);
        }
 }
 
@@ -72,19 +77,41 @@ void Settings::loadFromFiles(const std::vector<std::string>& filePaths)
                if (home)
                {
                        boost::replace_all(path, "$HOME", home);
+
+                       //Mf::logDebug("Copying global settings...");
+                       //mUserFile = path;
+                       //mGlobals.pushCopy();
+                       //mScript.set("globals", Script::REGISTRY);
                }
 
-               if (script_.doFile(path) != Script::SUCCESS)
+               if (mScript.doFile(path) != Script::SUCCESS)
                {
                        std::string str;
-                       script_[-1].get(str);
-                       logWarning("running config file: %s", str.c_str());
-                       script_.clear();
+                       mScript[-1].get(str);
+                       logWarning(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: *************************************************/
This page took 0.019017 seconds and 4 git commands to generate.