DRTVWR-493 Reworked a number of inits

master
andreykproductengine 2019-08-13 20:19:46 +03:00
parent 1233842012
commit 24a0601a50
13 changed files with 29 additions and 28 deletions

View File

@ -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

View File

@ -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()

View File

@ -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;

View File

@ -522,7 +522,7 @@ void LLFeatureManager::cleanupFeatureTables()
mMaskList.clear();
}
void LLFeatureManager::init()
void LLFeatureManager::initSingleton()
{
// load the tables
loadFeatureTables();

View File

@ -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

View File

@ -40,6 +40,7 @@ LLPersistentNotificationStorage::LLPersistentNotificationStorage():
LLNotificationStorage("")
, mLoaded(false)
{
initialize();
}
LLPersistentNotificationStorage::~LLPersistentNotificationStorage()

View File

@ -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;
};

View File

@ -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",

View File

@ -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)

View File

@ -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()

View File

@ -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);

View File

@ -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);
}
//---------------------------------------------------

View File

@ -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;