From 86e5f80837ad55932f2469d79d9e6b6bb07cf5ed Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 28 Sep 2009 19:09:22 +0200 Subject: Implemented new ConfigManager --- .../StorageBackendFile/StorageBackendFile.cpp | 21 ++------------------- src/modules/StorageBackendFile/StorageBackendFile.h | 3 +-- 2 files changed, 3 insertions(+), 21 deletions(-) (limited to 'src/modules/StorageBackendFile') 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 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 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 listTypes() throw (Core::Exception); virtual std::set list(const Core::String &type) throw (Core::Exception); -- cgit v1.2.3