[Orxonox-commit 730] r3260 - branches/core4/src/core

rgrieder at orxonox.net rgrieder at orxonox.net
Tue Jun 30 16:53:06 CEST 2009


Author: rgrieder
Date: 2009-06-30 16:53:06 +0200 (Tue, 30 Jun 2009)
New Revision: 3260

Modified:
   branches/core4/src/core/ConfigValueIncludes.h
   branches/core4/src/core/Shell.cc
   branches/core4/src/core/Shell.h
Log:
#299: Fixed a bug in ConfigValueIncludes.h and exported command history to a separate file.

Modified: branches/core4/src/core/ConfigValueIncludes.h
===================================================================
--- branches/core4/src/core/ConfigValueIncludes.h	2009-06-30 14:34:48 UTC (rev 3259)
+++ branches/core4/src/core/ConfigValueIncludes.h	2009-06-30 14:53:06 UTC (rev 3260)
@@ -51,7 +51,7 @@
     orxonox::ConfigValueContainer* container##varname = identifier##varname->getConfigValueContainer(#varname); \
     if (!container##varname) \
     { \
-        container##varname = new orxonox::ConfigValueContainer(ConfigFileType::Settings, identifier##varname, identifier##varname->getName(), #varname, defvalue, varname); \
+        container##varname = new orxonox::ConfigValueContainer(type, identifier##varname, identifier##varname->getName(), #varname, defvalue, varname); \
         identifier##varname->addConfigValueContainer(#varname, container##varname); \
     } \
     container##varname->getValue(&varname, this)
@@ -69,7 +69,7 @@
     orxonox::ConfigValueContainer* container##varname = identifier##varname->getConfigValueContainer(#varname); \
     if (!container##varname) \
     { \
-        container##varname = new orxonox::ConfigValueContainer(ConfigFileType::Settings, identifier##varname, identifier##varname->getName(), #varname, defvalue); \
+        container##varname = new orxonox::ConfigValueContainer(type, identifier##varname, identifier##varname->getName(), #varname, defvalue); \
         identifier##varname->addConfigValueContainer(#varname, container##varname); \
     } \
     container##varname->getValue(&varname, this)

Modified: branches/core4/src/core/Shell.cc
===================================================================
--- branches/core4/src/core/Shell.cc	2009-06-30 14:34:48 UTC (rev 3259)
+++ branches/core4/src/core/Shell.cc	2009-06-30 14:53:06 UTC (rev 3260)
@@ -77,6 +77,10 @@
         this->outputBuffer_.registerListener(this);
         OutputHandler::getOutStream().setOutputBuffer(&this->outputBuffer_);
 
+        // Get a config file for the command history
+        this->commandHistoryConfigFileType_ = ConfigFileManager::getInstance().getNewConfigFileType();
+        ConfigFileManager::getInstance().setFilename(this->commandHistoryConfigFileType_, "commandHistory.ini");
+
         this->setConfigValues();
 
         Core::setSoftDebugLevel(OutputHandler::LD_Shell, level);
@@ -92,9 +96,11 @@
 
     void Shell::setConfigValues()
     {
-        SetConfigValue(maxHistoryLength_, 100).callback(this, &Shell::commandHistoryLengthChanged);
-        SetConfigValue(historyOffset_, 0).callback(this, &Shell::commandHistoryOffsetChanged);
-        SetConfigValueVector(commandHistory_, std::vector<std::string>());
+        SetConfigValueGeneric(commandHistoryConfigFileType_, maxHistoryLength_, 100)
+            .callback(this, &Shell::commandHistoryLengthChanged);
+        SetConfigValueGeneric(commandHistoryConfigFileType_, historyOffset_, 0)
+            .callback(this, &Shell::commandHistoryOffsetChanged);
+        SetConfigValueVectorGeneric(commandHistoryConfigFileType_, commandHistory_, std::vector<std::string>());
     }
 
     void Shell::commandHistoryOffsetChanged()

Modified: branches/core4/src/core/Shell.h
===================================================================
--- branches/core4/src/core/Shell.h	2009-06-30 14:34:48 UTC (rev 3259)
+++ branches/core4/src/core/Shell.h	2009-06-30 14:53:06 UTC (rev 3260)
@@ -36,9 +36,10 @@
 #include <string>
 #include <vector>
 
+#include "util/OutputBuffer.h"
+#include "input/InputBuffer.h"
 #include "OrxonoxClass.h"
-#include "input/InputBuffer.h"
-#include "util/OutputBuffer.h"
+#include "ConfigFileManager.h"
 
 namespace orxonox
 {
@@ -144,6 +145,8 @@
             unsigned int historyOffset_;
             bool bAddOutputLevel_;
 
+            ConfigFileType commandHistoryConfigFileType_;
+
             static Shell* singletonRef_s;
     };
 }




More information about the Orxonox-commit mailing list