summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llappviewer.cpp6
-rw-r--r--indra/newview/lldonotdisturbnotificationstorage.cpp2
-rw-r--r--indra/newview/lldonotdisturbnotificationstorage.h5
-rw-r--r--indra/newview/llfeaturemanager.cpp2
-rw-r--r--indra/newview/llfeaturemanager.h5
-rw-r--r--indra/newview/llpersistentnotificationstorage.cpp1
-rw-r--r--indra/newview/llpersistentnotificationstorage.h6
-rw-r--r--indra/newview/llstartup.cpp4
-rw-r--r--indra/newview/llviewerwindow.cpp2
-rw-r--r--indra/newview/llvocache.cpp5
-rw-r--r--indra/newview/llvocache.h9
-rw-r--r--indra/newview/llvoiceclient.cpp3
-rw-r--r--indra/newview/llvoiceclient.h7
13 files changed, 29 insertions, 28 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 84cd326f06..1874743644 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 7d2712eec7..cb5f9c8a2c 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 e6cb7835e3..c6f0bf1ab5 100644
--- a/indra/newview/lldonotdisturbnotificationstorage.h
+++ b/indra/newview/lldonotdisturbnotificationstorage.h
@@ -45,7 +45,7 @@ public:
BOOL tick();
};
-class LLDoNotDisturbNotificationStorage : public LLSingleton<LLDoNotDisturbNotificationStorage>, public LLNotificationStorage
+class LLDoNotDisturbNotificationStorage : public LLParamSingleton<LLDoNotDisturbNotificationStorage>, public LLNotificationStorage
{
LLSINGLETON(LLDoNotDisturbNotificationStorage);
~LLDoNotDisturbNotificationStorage();
@@ -55,7 +55,6 @@ public:
static const char * toastName;
static const char * offerName;
- void initialize();
bool getDirty();
void resetDirty();
void saveNotifications();
@@ -66,6 +65,8 @@ public:
protected:
private:
+ void initialize();
+
bool mDirty;
LLDoNotDisturbNotificationStorageTimer mTimer;
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index 8d07035b97..aa9cba0c18 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 f77861a1a7..42a226cd18 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 264382ae82..f95ab9928d 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 40c9923c74..1fb4487286 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 @@ public:
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 e4cabbaddd..d7b8080efd 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 b8960d7604..cde2128b99 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 fb28d9bdb5..0e6511f6b5 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 594d38249b..41b5246480 100644
--- a/indra/newview/llvocache.h
+++ b/indra/newview/llvocache.h
@@ -221,9 +221,9 @@ private:
//
//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 @@ private:
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 5c107cc10b..d8c8cb0461 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 758e9cecd7..f95b853c31 100644
--- a/indra/newview/llvoiceclient.h
+++ b/indra/newview/llvoiceclient.h
@@ -310,9 +310,9 @@ public:
};
-class LLVoiceClient: public LLSingleton<LLVoiceClient>
+class LLVoiceClient: public LLParamSingleton<LLVoiceClient>
{
- LLSINGLETON(LLVoiceClient);
+ LLSINGLETON(LLVoiceClient, LLPumpIO *pump);
LOG_CLASS(LLVoiceClient);
~LLVoiceClient();
@@ -320,7 +320,6 @@ public:
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 @@ public:
// Returns NULL if voice effects are not supported, or not enabled.
LLVoiceEffectInterface* getVoiceEffectInterface() const;
//@}
+private:
+ void init(LLPumpIO *pump);
protected:
LLVoiceModuleInterface* mVoiceModule;