made the local and sd configs addressable by those names
authorLogxen <logxen@hotmail.com>
Wed, 20 Jun 2012 08:40:07 +0000 (01:40 -0700)
committerLogxen <logxen@hotmail.com>
Wed, 20 Jun 2012 08:40:07 +0000 (01:40 -0700)
src/libs/Config.cpp
src/libs/Config.h
src/libs/ConfigSources/FileConfigSource.cpp
src/libs/ConfigSources/FileConfigSource.h

index 70747f9..8615252 100644 (file)
@@ -24,8 +24,8 @@ Config::Config(){
     this->config_cache_loaded = false;
 
     // Config source for */config files
-    this->config_sources.push_back(new FileConfigSource("/local/config"));
-    this->config_sources.push_back(new FileConfigSource("/sd/config"));
+    this->config_sources.push_back( new FileConfigSource("/local/config", LOCAL_CONFIGSOURCE_CHECKSUM) );
+    this->config_sources.push_back( new FileConfigSource("/sd/config", SD_CONFIGSOURCE_CHECKSUM) );
 
     // Pre-load the config cache
     this->config_cache_load();
index 9193424..864888e 100644 (file)
@@ -22,6 +22,10 @@ using namespace std;
 #include <string>
 #include <stdio.h>
 
+#define LOCAL_CONFIGSOURCE_CHECKSUM     13581
+#define SD_CONFIGSOURCE_CHECKSUM        19415
+
+
 class Config : public Module {
     public:
         Config();
index 2335992..8807a2d 100644 (file)
@@ -14,8 +14,8 @@ using namespace std;
 #include <string>
 
 
-FileConfigSource::FileConfigSource(string config_file){
-    this->name_checksum = FILE_CONFIGSOURCE_CHECKSUM;
+FileConfigSource::FileConfigSource(string config_file, uint16_t name_checksum){
+    this->name_checksum = name_checksum;
     this->config_file = config_file;
     this->config_file_found = false;
 }
index b7e16a7..b8c109c 100644 (file)
@@ -19,7 +19,7 @@ using namespace std;
 
 class FileConfigSource : public ConfigSource {
     public:
-        FileConfigSource(string config_file = "/sd/config");
+        FileConfigSource(string config_file = "/sd/config", uint16_t name_checksum = FILE_CONFIGSOURCE_CHECKSUM);
         void transfer_values_to_cache( ConfigCache* cache );
         bool is_named( uint16_t check_sum );
         void write( string setting, string value );