diff options
-rw-r--r-- | indra/llcommon/llpointer.h | 111 | ||||
-rw-r--r-- | indra/llrender/llrendertarget.cpp | 4 | ||||
-rw-r--r-- | indra/llrender/llrendertarget.h | 2 | ||||
-rw-r--r-- | indra/newview/llappviewer.cpp | 45 | ||||
-rw-r--r-- | indra/newview/llfloatergltfasseteditor.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llfloaterimnearbychathandler.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llselectmgr.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llstartup.cpp | 6 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_im_container.xml | 2 |
9 files changed, 134 insertions, 63 deletions
diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h index f5916f9d58..6edff9fa5e 100644 --- a/indra/llcommon/llpointer.h +++ b/indra/llcommon/llpointer.h @@ -46,8 +46,11 @@ template <class Type> class LLPointer { public: + template<typename Subclass> + friend class LLPointer; + LLPointer() : - mPointer(NULL) + mPointer(nullptr) { } @@ -63,6 +66,12 @@ public: ref(); } + LLPointer(LLPointer<Type>&& ptr) noexcept + { + mPointer = ptr.mPointer; + ptr.mPointer = nullptr; + } + // Support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. template<typename Subclass> LLPointer(const LLPointer<Subclass>& ptr) : @@ -71,6 +80,13 @@ public: ref(); } + template<typename Subclass> + LLPointer(LLPointer<Subclass>&& ptr) noexcept : + mPointer(ptr.get()) + { + ptr.mPointer = nullptr; + } + ~LLPointer() { unref(); @@ -82,11 +98,11 @@ public: const Type& operator*() const { return *mPointer; } Type& operator*() { return *mPointer; } - operator BOOL() const { return (mPointer != NULL); } - operator bool() const { return (mPointer != NULL); } - bool operator!() const { return (mPointer == NULL); } - bool isNull() const { return (mPointer == NULL); } - bool notNull() const { return (mPointer != NULL); } + operator BOOL() const { return (mPointer != nullptr); } + operator bool() const { return (mPointer != nullptr); } + bool operator!() const { return (mPointer == nullptr); } + bool isNull() const { return (mPointer == nullptr); } + bool notNull() const { return (mPointer != nullptr); } operator Type*() const { return mPointer; } bool operator !=(Type* ptr) const { return (mPointer != ptr); } @@ -107,6 +123,17 @@ public: return *this; } + LLPointer<Type>& operator =(LLPointer<Type>&& ptr) + { + if (mPointer != ptr.mPointer) + { + unref(); + mPointer = ptr.mPointer; + ptr.mPointer = nullptr; + } + return *this; + } + // support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. template<typename Subclass> LLPointer<Type>& operator =(const LLPointer<Subclass>& ptr) @@ -115,6 +142,18 @@ public: return *this; } + template<typename Subclass> + LLPointer<Type>& operator =(LLPointer<Subclass>&& ptr) + { + if (mPointer != ptr.mPointer) + { + unref(); + mPointer = ptr.mPointer; + ptr.mPointer = nullptr; + } + return *this; + } + // Just exchange the pointers, which will not change the reference counts. static void swap(LLPointer<Type>& a, LLPointer<Type>& b) { @@ -141,9 +180,9 @@ protected: if (mPointer) { Type *temp = mPointer; - mPointer = NULL; + mPointer = nullptr; temp->unref(); - if (mPointer != NULL) + if (mPointer != nullptr) { LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL; unref(); @@ -168,9 +207,11 @@ protected: template <class Type> class LLConstPointer { + template<typename Subclass> + friend class LLConstPointer; public: LLConstPointer() : - mPointer(NULL) + mPointer(nullptr) { } @@ -186,6 +227,12 @@ public: ref(); } + LLConstPointer(LLConstPointer<Type>&& ptr) noexcept + { + mPointer = ptr.mPointer; + ptr.mPointer = nullptr; + } + // support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. template<typename Subclass> LLConstPointer(const LLConstPointer<Subclass>& ptr) : @@ -194,6 +241,13 @@ public: ref(); } + template<typename Subclass> + LLConstPointer(LLConstPointer<Subclass>&& ptr) noexcept : + mPointer(ptr.get()) + { + ptr.mPointer = nullptr; + } + ~LLConstPointer() { unref(); @@ -203,11 +257,11 @@ public: const Type* operator->() const { return mPointer; } const Type& operator*() const { return *mPointer; } - operator BOOL() const { return (mPointer != NULL); } - operator bool() const { return (mPointer != NULL); } - bool operator!() const { return (mPointer == NULL); } - bool isNull() const { return (mPointer == NULL); } - bool notNull() const { return (mPointer != NULL); } + operator BOOL() const { return (mPointer != nullptr); } + operator bool() const { return (mPointer != nullptr); } + bool operator!() const { return (mPointer == nullptr); } + bool isNull() const { return (mPointer == nullptr); } + bool notNull() const { return (mPointer != nullptr); } operator const Type*() const { return mPointer; } bool operator !=(const Type* ptr) const { return (mPointer != ptr); } @@ -239,6 +293,17 @@ public: return *this; } + LLConstPointer<Type>& operator =(LLConstPointer<Type>&& ptr) + { + if (mPointer != ptr.mPointer) + { + unref(); + mPointer = ptr.mPointer; + ptr.mPointer = nullptr; + } + return *this; + } + // support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. template<typename Subclass> LLConstPointer<Type>& operator =(const LLConstPointer<Subclass>& ptr) @@ -252,6 +317,18 @@ public: return *this; } + template<typename Subclass> + LLConstPointer<Type>& operator =(LLConstPointer<Subclass>&& ptr) + { + if (mPointer != ptr.mPointer) + { + unref(); + mPointer = ptr.mPointer; + ptr.mPointer = nullptr; + } + return *this; + } + // Just exchange the pointers, which will not change the reference counts. static void swap(LLConstPointer<Type>& a, LLConstPointer<Type>& b) { @@ -278,9 +355,9 @@ protected: if (mPointer) { const Type *temp = mPointer; - mPointer = NULL; + mPointer = nullptr; temp->unref(); - if (mPointer != NULL) + if (mPointer != nullptr) { LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL; unref(); @@ -313,7 +390,7 @@ public: : LLPointer<Type>(ptr), mStayUnique(false) { - if (ptr.mForceUnique) + if (ptr.mStayUnique) { makeUnique(); } diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index 015819c1bd..f700201ace 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -50,7 +50,6 @@ void check_framebuffer_status() } } -bool LLRenderTarget::sInitFailed = false; bool LLRenderTarget::sUseFBO = false; U32 LLRenderTarget::sCurFBO = 0; @@ -353,9 +352,6 @@ void LLRenderTarget::release() LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; llassert(!isBoundInStack()); - if (sInitFailed) - return; - if (mDepth) { LLImageGL::deleteTextures(1, &mDepth); diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h index fc78f059e0..cd3290cf66 100644 --- a/indra/llrender/llrendertarget.h +++ b/indra/llrender/llrendertarget.h @@ -61,8 +61,6 @@ class LLRenderTarget { public: - // Whether app initialization failed - static bool sInitFailed; // Whether or not to use FBO implementation static bool sUseFBO; static U32 sBytesAllocated; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4bb8197b19..5b5e42767f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -723,19 +723,6 @@ public: bool LLAppViewer::init() { - struct ResultHandler - { - bool success = false; // Should be set in case of successful result - ~ResultHandler() - { - if (!success) - { - // Mark critical flags in case of unsuccessful initialization - LLRenderTarget::sInitFailed = true; - } - } - } result_handler; - setupErrorHandling(mSecondInstance); // @@ -766,8 +753,7 @@ bool LLAppViewer::init() // inits from settings.xml and from strings.xml if (!initConfiguration()) { - LL_WARNS("InitInfo") << "initConfiguration() failed." << LL_ENDL; - return false; + LL_ERRS("InitInfo") << "initConfiguration() failed." << LL_ENDL; } LL_INFOS("InitInfo") << "Configuration initialized." << LL_ENDL ; @@ -921,9 +907,8 @@ bool LLAppViewer::init() if (!initHardwareTest()) { - LL_WARNS("InitInfo") << "initHardwareTest() failed." << LL_ENDL; // Early out from user choice. - return false; + LL_ERRS("InitInfo") << "initHardwareTest() failed." << LL_ENDL; } LL_INFOS("InitInfo") << "Hardware test initialization done." << LL_ENDL ; @@ -937,11 +922,9 @@ bool LLAppViewer::init() if (!initCache()) { - LL_WARNS("InitInfo") << "Failed to init cache" << LL_ENDL; - std::ostringstream msg; - msg << LLTrans::getString("MBUnableToAccessFile"); - OSMessageBox(msg.str(),LLStringUtil::null,OSMB_OK); - return false; + std::string msg = LLTrans::getString("MBUnableToAccessFile"); + OSMessageBox(msg.c_str(), LLStringUtil::null, OSMB_OK); + LL_ERRS("InitInfo") << "Failed to init cache" << LL_ENDL; } LL_INFOS("InitInfo") << "Cache initialization is done." << LL_ENDL ; @@ -970,11 +953,11 @@ bool LLAppViewer::init() gGLManager.printGLInfoString(); // If we don't have the right GL requirements, exit. + // ? AG: It seems we never set mHasRequirements to false if (!gGLManager.mHasRequirements) { - LL_WARNS("InitInfo") << "gGLManager.mHasRequirements is false." << LL_ENDL; - // already handled with a MBVideoDrvErr - return false; + // Already handled with a MBVideoDrvErr + LL_ERRS("InitInfo") << "gGLManager.mHasRequirements is false." << LL_ENDL; } // Without SSE2 support we will crash almost immediately, warn here. @@ -982,11 +965,9 @@ bool LLAppViewer::init() { // can't use an alert here since we're exiting and // all hell breaks lose. - OSMessageBox( - LLNotifications::instance().getGlobalString("UnsupportedCPUSSE2"), - LLStringUtil::null, - OSMB_OK); - return false; + std::string msg = LLNotifications::instance().getGlobalString("UnsupportedCPUSSE2"); + OSMessageBox(msg.c_str(), LLStringUtil::null, OSMB_OK); + LL_ERRS("InitInfo") << "SSE2 is not supported" << LL_ENDL; } // alert the user if they are using unsupported hardware @@ -1012,12 +993,14 @@ bool LLAppViewer::init() minSpecs += "\n"; unsupported = true; } + if (gSysCPU.getMHz() < minCPU) { minSpecs += LLNotifications::instance().getGlobalString("UnsupportedCPU"); minSpecs += "\n"; unsupported = true; } + if (gSysMemory.getPhysicalMemoryKB() < minRAM) { minSpecs += LLNotifications::instance().getGlobalString("UnsupportedRAM"); @@ -1299,8 +1282,6 @@ bool LLAppViewer::init() } #endif - result_handler.success = true; - return true; } diff --git a/indra/newview/llfloatergltfasseteditor.cpp b/indra/newview/llfloatergltfasseteditor.cpp index 13e0d36c35..d2cf24f1dd 100644 --- a/indra/newview/llfloatergltfasseteditor.cpp +++ b/indra/newview/llfloatergltfasseteditor.cpp @@ -54,7 +54,7 @@ LLFloaterGLTFAssetEditor::~LLFloaterGLTFAssetEditor() { if (mScroller) { - removeChild(mScroller); + mItemListPanel->removeChild(mScroller); delete mScroller; mScroller = NULL; } @@ -345,13 +345,15 @@ void LLFloaterGLTFAssetEditor::dirty() { if (!mObject || !mAsset || !mFolderRoot) { - closeFloater(); return; } if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 1) { - closeFloater(); + if (getVisible()) + { + closeFloater(); + } return; } @@ -366,7 +368,10 @@ void LLFloaterGLTFAssetEditor::dirty() LLViewerObject* objectp = node->getObject(); if (mObject != objectp || !objectp->mGLTFAsset) { - closeFloater(); + if (getVisible()) + { + closeFloater(); + } return; } diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index ed4056070f..5cf02d1ec0 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -643,8 +643,18 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, } } + std::string user_preferences; + if (chat_msg.mSourceType == CHAT_SOURCE_OBJECT) + { + user_preferences = gSavedSettings.getString("NotificationObjectIMOptions"); + } + else + { + user_preferences = gSavedSettings.getString("NotificationNearbyChatOptions"); + } + //Will show toast when chat preference is set - if((gSavedSettings.getString("NotificationNearbyChatOptions") == "toast") || !nearby_chat->isMessagePaneExpanded()) + if((user_preferences == "toast") || !nearby_chat->isMessagePaneExpanded()) { // Add a nearby chat toast. LLUUID id; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 17f968b921..70356e8e96 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -7194,7 +7194,7 @@ void dialog_refresh_all() panel_task_info->dirty(); } - LLFloaterGLTFAssetEditor * gltf_editor = LLFloaterReg::getTypedInstance<LLFloaterGLTFAssetEditor>("gltf_asset_editor"); + LLFloaterGLTFAssetEditor * gltf_editor = LLFloaterReg::findTypedInstance<LLFloaterGLTFAssetEditor>("gltf_asset_editor"); if (gltf_editor) { gltf_editor->dirty(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 33509d2f0b..b993ba16d5 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1508,7 +1508,11 @@ bool idle_startup() // create a container's instance for start a controlling conversation windows // by the voice's events - LLFloaterIMContainer::getInstance(); + LLFloaterIMContainer *im_inst = LLFloaterIMContainer::getInstance(); + if(gAgent.isFirstLogin()) + { + im_inst->openFloater(im_inst->getKey()); + } if (gSavedSettings.getS32("ParcelMediaAutoPlayEnable") == 2) { LLViewerParcelAskPlay::getInstance()->loadSettings(); diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml index 4df29c47de..176a2ca1a4 100644 --- a/indra/newview/skins/default/xui/en/floater_im_container.xml +++ b/indra/newview/skins/default/xui/en/floater_im_container.xml @@ -14,7 +14,7 @@ reuse_instance="true" title="CONVERSATIONS" bottom="-50" - right="-5" + left="5" width="450" min_width="38"> <string |