more code for searchpath system

git-svn-id: https://clonekeenplus.svn.sourceforge.net/svnroot/clonekeenplus/cgenius/trunk@146 4df4b0f3-56ce-47cb-b001-ed939b7d65a6
This commit is contained in:
albertzeyer
2009-07-24 14:36:34 +00:00
parent 4ca87c10e1
commit bb08df4b19
4 changed files with 51 additions and 21 deletions

View File

@@ -10,6 +10,40 @@
#include "CSettings.h"
#include "CVideoDriver.h"
#include "sound/CSound.h"
#include "../FindFile.h"
#include "../ConfigHandler.h"
void InitSearchPaths() {
// have to set to find the config at some of the default places
InitBaseSearchPaths();
std::string value;
int i = 1;
while(true) {
if(!ReadString(CONFIGFILENAME, "FileHandling", "SearchPath" + itoa(i,10), value, ""))
break;
AddToFileList(&tSearchPaths, value);
i++;
}
// add the basesearchpaths to the searchpathlist as they should be saved in the end
for(searchpathlist::const_iterator p1 = basesearchpaths.begin(); p1 != basesearchpaths.end(); i++,p1++) {
AddToFileList(&tSearchPaths, *p1);
}
// print the searchpaths, this may be very usefull for the user
notes << "I have now the following searchpaths (in this order):\n";
for(searchpathlist::const_iterator p2 = tSearchPaths.begin(); p2 != tSearchPaths.end(); p2++) {
std::string path = *p2;
ReplaceFileVariables(path);
notes << " " << path << "\n";
}
notes << " And that's all." << endl;
}
CSettings::CSettings() {
// TODO Auto-generated constructor stub