summaryrefslogtreecommitdiffstats
path: root/src/modules/StorageBackendFile
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-09-28 19:09:22 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-09-28 19:09:22 +0200
commit86e5f80837ad55932f2469d79d9e6b6bb07cf5ed (patch)
tree818ab757a8ae964751190daad5a7fd2cd8f21a04 /src/modules/StorageBackendFile
parenta7a285eb61dd83afc892bc1d64ffe14b9f1426a3 (diff)
downloadmad-86e5f80837ad55932f2469d79d9e6b6bb07cf5ed.tar
mad-86e5f80837ad55932f2469d79d9e6b6bb07cf5ed.zip
Implemented new ConfigManager
Diffstat (limited to 'src/modules/StorageBackendFile')
-rw-r--r--src/modules/StorageBackendFile/StorageBackendFile.cpp21
-rw-r--r--src/modules/StorageBackendFile/StorageBackendFile.h3
2 files changed, 3 insertions, 21 deletions
diff --git a/src/modules/StorageBackendFile/StorageBackendFile.cpp b/src/modules/StorageBackendFile/StorageBackendFile.cpp
index e5da4e0..e801a64 100644
--- a/src/modules/StorageBackendFile/StorageBackendFile.cpp
+++ b/src/modules/StorageBackendFile/StorageBackendFile.cpp
@@ -28,27 +28,10 @@ namespace Mad {
namespace Modules {
namespace StorageBackendFile {
-bool StorageBackendFile::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handled*/) {
- if(!entry[0].getKey().matches("Storage"))
- return false;
-
+void StorageBackendFile::configure() {
boost::lock_guard<boost::shared_mutex> lock(mutex);
- if(entry[1].getKey().matches("Root")) {
- if(!entry[2].isEmpty())
- return false;
-
- storageRoot = entry[1][0].toLocale();
- }
- else if(!entry[1].isEmpty()) {
- return false;
- }
-
- return true;
-}
-
-void StorageBackendFile::configFinished() {
- boost::lock_guard<boost::shared_mutex> lock(mutex);
+ storageRoot = application->getConfigManager()->get("Storage.Root").toLocale();
if(!boost::filesystem::exists(storageRoot)) {
boost::filesystem::create_directories(storageRoot);
diff --git a/src/modules/StorageBackendFile/StorageBackendFile.h b/src/modules/StorageBackendFile/StorageBackendFile.h
index f38e674..b1c685d 100644
--- a/src/modules/StorageBackendFile/StorageBackendFile.h
+++ b/src/modules/StorageBackendFile/StorageBackendFile.h
@@ -45,8 +45,7 @@ class StorageBackendFile : public Common::StorageBackend, private Core::Configur
boost::filesystem::path getFileName(const Core::String &type, const Core::String &name);
protected:
- virtual bool handleConfigEntry(const Core::ConfigEntry &entry, bool handled);
- virtual void configFinished();
+ virtual void configure();
virtual std::set<Core::String> listTypes() throw (Core::Exception);
virtual std::set<Core::String> list(const Core::String &type) throw (Core::Exception);