diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 84cd326f06cbc18a459b107506fab5e144d08a7f..1874743644b21fa607fcc0e0d042fa0505addc35 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1243,7 +1243,7 @@ bool LLAppViewer::init() // Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated. LLVoiceChannel::initClass(); - LLVoiceClient::getInstance()->init(gServicePump); + LLVoiceClient::initParamSingleton(gServicePump); LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLFloaterIMContainer::onCurrentChannelChanged, _1), true); joystick = LLViewerJoystick::getInstance(); @@ -4123,7 +4123,7 @@ bool LLAppViewer::initCache() mPurgeCache = false; BOOL read_only = mSecondInstance ? TRUE : FALSE; LLAppViewer::getTextureCache()->setReadOnly(read_only) ; - LLVOCache::getInstance()->setReadOnly(read_only); + LLVOCache::initParamSingleton(LL_PATH_CACHE, gSavedSettings.getU32("CacheNumberOfRegionsForObjects"), getObjectCacheVersion(), read_only); bool texture_cache_mismatch = false; if (gSavedSettings.getS32("LocalCacheVersion") != LLAppViewer::getTextureCacheVersion()) @@ -4195,8 +4195,6 @@ bool LLAppViewer::initCache() S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, texture_cache_mismatch); texture_cache_size -= extra; - LLVOCache::getInstance()->initCache(LL_PATH_CACHE, gSavedSettings.getU32("CacheNumberOfRegionsForObjects"), getObjectCacheVersion()) ; - LLSplashScreen::update(LLTrans::getString("StartupInitializingVFS")); // Init the VFS diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp index 7d2712eec708f611338e0bae252facb0a078f8a8..cb5f9c8a2c98cb0ce48e1212c4130db8dc7cc8f7 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.cpp +++ b/indra/newview/lldonotdisturbnotificationstorage.cpp @@ -48,7 +48,6 @@ const char * LLDoNotDisturbNotificationStorage::offerName = "UserGiveItem"; LLDoNotDisturbNotificationStorageTimer::LLDoNotDisturbNotificationStorageTimer() : LLEventTimer(DND_TIMER) { - } LLDoNotDisturbNotificationStorageTimer::~LLDoNotDisturbNotificationStorageTimer() @@ -74,6 +73,7 @@ LLDoNotDisturbNotificationStorage::LLDoNotDisturbNotificationStorage() { nameToPayloadParameterMap[toastName] = "SESSION_ID"; nameToPayloadParameterMap[offerName] = "object_id"; + initialize(); } LLDoNotDisturbNotificationStorage::~LLDoNotDisturbNotificationStorage() diff --git a/indra/newview/lldonotdisturbnotificationstorage.h b/indra/newview/lldonotdisturbnotificationstorage.h index e6cb7835e311b4277df3daf26c2363c3e8d29b62..c6f0bf1ab588ddd63fd52324bdf91f7dcd9d3516 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.h +++ b/indra/newview/lldonotdisturbnotificationstorage.h @@ -45,7 +45,7 @@ class LLDoNotDisturbNotificationStorageTimer : public LLEventTimer BOOL tick(); }; -class LLDoNotDisturbNotificationStorage : public LLSingleton<LLDoNotDisturbNotificationStorage>, public LLNotificationStorage +class LLDoNotDisturbNotificationStorage : public LLParamSingleton<LLDoNotDisturbNotificationStorage>, public LLNotificationStorage { LLSINGLETON(LLDoNotDisturbNotificationStorage); ~LLDoNotDisturbNotificationStorage(); @@ -55,7 +55,6 @@ class LLDoNotDisturbNotificationStorage : public LLSingleton<LLDoNotDisturbNotif static const char * toastName; static const char * offerName; - void initialize(); bool getDirty(); void resetDirty(); void saveNotifications(); @@ -66,6 +65,8 @@ class LLDoNotDisturbNotificationStorage : public LLSingleton<LLDoNotDisturbNotif protected: private: + void initialize(); + bool mDirty; LLDoNotDisturbNotificationStorageTimer mTimer; diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 8d07035b97d85dcc528472db0d2b2c42b04b0d8e..aa9cba0c188b650e1527e53e7f5d61cfd91d4815 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -522,7 +522,7 @@ void LLFeatureManager::cleanupFeatureTables() mMaskList.clear(); } -void LLFeatureManager::init() +void LLFeatureManager::initSingleton() { // load the tables loadFeatureTables(); diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h index f77861a1a754f4efa001027f946ac55897000d46..42a226cd18f843bdc40ed58e07f30543e58eedc4 100644 --- a/indra/newview/llfeaturemanager.h +++ b/indra/newview/llfeaturemanager.h @@ -100,9 +100,10 @@ class LLFeatureManager : public LLFeatureList, public LLSingleton<LLFeatureManag LLSINGLETON(LLFeatureManager); ~LLFeatureManager() {cleanupFeatureTables();} -public: // initialize this by loading feature table and gpu table - void init(); + void initSingleton(); + +public: void maskCurrentList(const std::string& name); // Mask the current feature list with the named list diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp index 264382ae8280be64506e877e961f2d57073d1ea3..f95ab9928d54737ca17b52b204568f2abdbbcc43 100644 --- a/indra/newview/llpersistentnotificationstorage.cpp +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -40,6 +40,7 @@ LLPersistentNotificationStorage::LLPersistentNotificationStorage(): LLNotificationStorage("") , mLoaded(false) { + initialize(); } LLPersistentNotificationStorage::~LLPersistentNotificationStorage() diff --git a/indra/newview/llpersistentnotificationstorage.h b/indra/newview/llpersistentnotificationstorage.h index 40c9923c7412036cc0b26cf1cb5ab860e0cb4acc..1fb44872867d9c0b4e1c4801766297c1b463782d 100644 --- a/indra/newview/llpersistentnotificationstorage.h +++ b/indra/newview/llpersistentnotificationstorage.h @@ -43,7 +43,7 @@ class LLSD; // be a) serializable(implement LLNotificationResponderInterface), // b) registered with LLResponderRegistry (found in llpersistentnotificationstorage.cpp). -class LLPersistentNotificationStorage : public LLSingleton<LLPersistentNotificationStorage>, public LLNotificationStorage +class LLPersistentNotificationStorage : public LLParamSingleton<LLPersistentNotificationStorage>, public LLNotificationStorage { LLSINGLETON(LLPersistentNotificationStorage); ~LLPersistentNotificationStorage(); @@ -53,11 +53,11 @@ class LLPersistentNotificationStorage : public LLSingleton<LLPersistentNotificat void saveNotifications(); void loadNotifications(); - void initialize(); - protected: private: + void initialize(); + bool onPersistentChannelChanged(const LLSD& payload); bool mLoaded; }; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index e4cabbaddd30df66b3b210380c6fe213999c02cc..d7b8080efdc0a18e2271b5b588d7b0496f9e5aa9 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -895,8 +895,8 @@ bool idle_startup() LLFile::mkdir(gDirUtilp->getLindenUserDir()); // As soon as directories are ready initialize notification storages - LLPersistentNotificationStorage::getInstance()->initialize(); - LLDoNotDisturbNotificationStorage::getInstance()->initialize(); + LLPersistentNotificationStorage::initParamSingleton(); + LLDoNotDisturbNotificationStorage::initParamSingleton(); // Set PerAccountSettingsFile to the default value. gSavedSettings.setString("PerAccountSettingsFile", diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b8960d7604b7443c3443d148b735a99cdda6435e..cde2128b99698cdb829341c898929be40d9b7ecd 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1796,8 +1796,6 @@ LLViewerWindow::LLViewerWindow(const Params& p) // LL_DEBUGS("Window") << "Loading feature tables." << LL_ENDL; - LLFeatureManager::getInstance()->init(); - // Initialize OpenGL Renderer if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || !gGLManager.mHasVertexBufferObject) diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index fb28d9bdb5ab31422705ab7c89c652aef1ae9273..0e6511f6b598296318f89dff732aa26de87099fb 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -1045,14 +1045,15 @@ const char* object_cache_dirname = "objectcache"; const char* header_filename = "object.cache"; -LLVOCache::LLVOCache(): +LLVOCache::LLVOCache(ELLPath location, U32 size, U32 cache_version, bool read_only) : mInitialized(false), - mReadOnly(true), + mReadOnly(read_only), mNumEntries(0), mCacheSize(1) { mEnabled = gSavedSettings.getBOOL("ObjectCacheEnabled"); mLocalAPRFilePoolp = new LLVolatileAPRPool() ; + initCache(location, size, cache_version); } LLVOCache::~LLVOCache() diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index 594d38249bd07cdb5548414dd6ade6862aa2ab35..41b52464807ef772ef87f77d84e287a2d647a5a9 100644 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -221,9 +221,9 @@ class LLVOCachePartition : public LLViewerOctreePartition, public LLTrace::MemTr // //Note: LLVOCache is not thread-safe // -class LLVOCache : public LLSingleton<LLVOCache> +class LLVOCache : public LLParamSingleton<LLVOCache> { - LLSINGLETON(LLVOCache); + LLSINGLETON(LLVOCache, ELLPath location, U32 size, U32 cache_version, bool read_only); ~LLVOCache() ; private: @@ -259,19 +259,18 @@ class LLVOCache : public LLSingleton<LLVOCache> typedef std::map<U64, HeaderEntryInfo*> handle_entry_map_t; public: - void initCache(ELLPath location, U32 size, U32 cache_version) ; void removeCache(ELLPath location, bool started = false) ; void readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) ; void writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache, bool removal_enabled); void removeEntry(U64 handle) ; - void setReadOnly(bool read_only) {mReadOnly = read_only;} - U32 getCacheEntries() { return mNumEntries; } U32 getCacheEntriesMax() { return mCacheSize; } private: + void initCache(ELLPath location, U32 size, U32 cache_version); + void setDirNames(ELLPath location); // determine the cache filename for the region from the region handle void getObjectCacheFilename(U64 handle, std::string& filename); diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 5c107cc10bd2a6833cb1888e1f8cc58973d12202..d8c8cb04614f5d6e414f108435871484f9542890 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -116,7 +116,7 @@ std::string LLVoiceClientStatusObserver::status2string(LLVoiceClientStatusObserv /////////////////////////////////////////////////////////////////////////////////////////////// -LLVoiceClient::LLVoiceClient() +LLVoiceClient::LLVoiceClient(LLPumpIO *pump) : mVoiceModule(NULL), m_servicePump(NULL), @@ -133,6 +133,7 @@ LLVoiceClient::LLVoiceClient() mDisableMic(false) { updateSettings(); + init(pump); } //--------------------------------------------------- diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 758e9cecd76acd69cdafc782cca61bfd85096430..f95b853c31daf475ee8b2936e639189576e14cda 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -310,9 +310,9 @@ class LLVoiceEffectInterface }; -class LLVoiceClient: public LLSingleton<LLVoiceClient> +class LLVoiceClient: public LLParamSingleton<LLVoiceClient> { - LLSINGLETON(LLVoiceClient); + LLSINGLETON(LLVoiceClient, LLPumpIO *pump); LOG_CLASS(LLVoiceClient); ~LLVoiceClient(); @@ -320,7 +320,6 @@ class LLVoiceClient: public LLSingleton<LLVoiceClient> typedef boost::signals2::signal<void(void)> micro_changed_signal_t; micro_changed_signal_t mMicroChangedSignal; - void init(LLPumpIO *pump); // Call this once at application startup (creates connector) void terminate(); // Call this to clean up during shutdown const LLVoiceVersionInfo getVersion(); @@ -472,6 +471,8 @@ class LLVoiceClient: public LLSingleton<LLVoiceClient> // Returns NULL if voice effects are not supported, or not enabled. LLVoiceEffectInterface* getVoiceEffectInterface() const; //@} +private: + void init(LLPumpIO *pump); protected: LLVoiceModuleInterface* mVoiceModule;