From 16e02f051d88c04c4a3eb7fbe319bb6b338d79ae Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 22 Aug 2008 11:49:34 +0000 Subject: Turned SymbianFilesystemFactory from a singleton into a normal class; adapted symbian backend accordingly svn-id: r34101 --- backends/fs/symbian/symbian-fs-factory.cpp | 4 +--- backends/fs/symbian/symbian-fs-factory.h | 13 ++----------- backends/platform/sdl/sdl.cpp | 1 + backends/platform/symbian/src/SymbianOS.cpp | 6 ++---- backends/platform/symbian/src/SymbianOS.h | 1 - 5 files changed, 6 insertions(+), 19 deletions(-) diff --git a/backends/fs/symbian/symbian-fs-factory.cpp b/backends/fs/symbian/symbian-fs-factory.cpp index 0a1bd62134..c31dfb594a 100644 --- a/backends/fs/symbian/symbian-fs-factory.cpp +++ b/backends/fs/symbian/symbian-fs-factory.cpp @@ -26,8 +26,6 @@ #include "backends/fs/symbian/symbian-fs-factory.h" #include "backends/fs/symbian/symbian-fs.cpp" -DECLARE_SINGLETON(SymbianFilesystemFactory); - AbstractFilesystemNode *SymbianFilesystemFactory::makeRootFileNode() const { return new SymbianFilesystemNode(true); } @@ -38,7 +36,7 @@ AbstractFilesystemNode *SymbianFilesystemFactory::makeCurrentDirectoryFileNode() return new SymbianFilesystemNode(path); } -AbstractFilesystemNode *SymbianFilesystemFactory::makeFileNodePath(const String &path) const { +AbstractFilesystemNode *SymbianFilesystemFactory::makeFileNodePath(const Common::String &path) const { return new SymbianFilesystemNode(path); } #endif diff --git a/backends/fs/symbian/symbian-fs-factory.h b/backends/fs/symbian/symbian-fs-factory.h index 502fba2930..ef5a231e72 100644 --- a/backends/fs/symbian/symbian-fs-factory.h +++ b/backends/fs/symbian/symbian-fs-factory.h @@ -25,7 +25,6 @@ #ifndef SYMBIAN_FILESYSTEM_FACTORY_H #define SYMBIAN_FILESYSTEM_FACTORY_H -#include "common/singleton.h" #include "backends/fs/fs-factory.h" /** @@ -33,19 +32,11 @@ * * Parts of this class are documented in the base interface class, FilesystemFactory. */ -class SymbianFilesystemFactory : public FilesystemFactory, public Common::Singleton { +class SymbianFilesystemFactory : public FilesystemFactory { public: - typedef Common::String String; - virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; - virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; - -protected: - SymbianFilesystemFactory() {}; - -private: - friend class Common::Singleton; + virtual AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const; }; #endif /*SYMBIAN_FILESYSTEM_FACTORY_H*/ diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 44ed5e45ff..fa0ea35cb5 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -268,6 +268,7 @@ Common::SaveFileManager *OSystem_SDL::getSavefileManager() { } FilesystemFactory *OSystem_SDL::getFilesystemFactory() { + assert(_fsFactory); return _fsFactory; } diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp index 33d18d9037..90bd99fa7d 100644 --- a/backends/platform/symbian/src/SymbianOS.cpp +++ b/backends/platform/symbian/src/SymbianOS.cpp @@ -123,10 +123,6 @@ void OSystem_SDL_Symbian::setFeatureState(Feature f, bool enable) { } } -FilesystemFactory *OSystem_SDL_Symbian::getFilesystemFactory() { - return &SymbianFilesystemFactory::instance(); -} - static Common::String getDefaultConfigFileName() { char configFile[MAXPATHLEN]; strcpy(configFile, Symbian::GetExecutablePath()); @@ -164,6 +160,8 @@ void OSystem_SDL_Symbian::initBackend() { actions->initInstanceMain(this); actions->loadMapping(); initZones(); + + _fsFactory = new SymbianFilesystemFactory(); } OSystem_SDL_Symbian::~OSystem_SDL_Symbian() { diff --git a/backends/platform/symbian/src/SymbianOS.h b/backends/platform/symbian/src/SymbianOS.h index cabfa51486..80329d984e 100644 --- a/backends/platform/symbian/src/SymbianOS.h +++ b/backends/platform/symbian/src/SymbianOS.h @@ -71,7 +71,6 @@ protected: // static void symbianMixCallback(void *s, byte *samples, int len); - virtual FilesystemFactory *getFilesystemFactory(); public: // vibration support #ifdef USE_VIBRA_SE_PXXX -- cgit v1.2.3