From 6de3dc1d81ac6e0a8c900e254ff7747d7e6779e5 Mon Sep 17 00:00:00 2001 From: Cinder <cinder@sdf.org> Date: Tue, 5 Jan 2016 21:43:40 -0700 Subject: [PATCH] ALCH-235 - Potential fix, it is a bit crap tho, but I'm mad. --- indra/newview/llfloaterland.cpp | 17 ++++++++++++++++- indra/newview/llfloaterland.h | 4 +++- indra/newview/llviewerparcelmgr.cpp | 4 ++-- indra/newview/llviewerparcelmgr.h | 6 ++++++ 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 8589cfb734..a1a402f283 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -279,7 +279,12 @@ LLFloaterLand::LLFloaterLand(const LLSD& seed) } BOOL LLFloaterLand::postBuild() -{ +{ + if (!mParcelMsgSignalSlot.connected()) + { + mParcelMsgSignalSlot = LLViewerParcelMgr::getInstance()->addParcelMsgCallback( + boost::bind(&LLFloaterLand::selectiveRefresh, this)); + } setVisibleCallback(boost::bind(&LLFloaterLand::onVisibilityChanged, this, _2)); LLTabContainer* tab = getChild<LLTabContainer>("landtab"); @@ -298,6 +303,9 @@ BOOL LLFloaterLand::postBuild() // virtual LLFloaterLand::~LLFloaterLand() { + if (mParcelMsgSignalSlot.connected()) + mParcelMsgSignalSlot.disconnect(); + LLViewerParcelMgr::getInstance()->removeObserver( sObserver ); delete sObserver; sObserver = NULL; @@ -315,6 +323,13 @@ void LLFloaterLand::refresh() mPanelExperiences->refresh(); } +// public +void LLFloaterLand::selectiveRefresh() +{ + mPanelAccess->refresh(); + mPanelGeneral->refresh(); +} + // static void* LLFloaterLand::createPanelLandGeneral(void* data) { diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 369cb2e7ab..1b9c2777cc 100755 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -30,7 +30,6 @@ #include "llfloater.h" #include "llpointer.h" // LLPointer<> -//#include "llviewertexturelist.h" #include "llsafehandle.h" typedef std::set<LLUUID, lluuid_less> uuid_list_t; @@ -87,10 +86,13 @@ private: virtual ~LLFloaterLand(); void onVisibilityChanged(const LLSD& visible); + + boost::signals2::connection mParcelMsgSignalSlot; protected: /*virtual*/ void refresh(); + void selectiveRefresh(); static void* createPanelLandGeneral(void* data); static void* createPanelLandCovenant(void* data); diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index ab99df8674..7a25a492dc 100755 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1866,7 +1866,7 @@ void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void parcel->unpackAccessEntries(msg, &(parcel->mRenterList) ); }*/ - LLViewerParcelMgr::getInstance()->notifyObservers(); + LLViewerParcelMgr::getInstance()->mParcelMsgSignal(); } @@ -1888,7 +1888,7 @@ void LLViewerParcelMgr::processParcelDwellReply(LLMessageSystem* msg, void**) if (local_id == LLViewerParcelMgr::getInstance()->mCurrentParcel->getLocalID()) { LLViewerParcelMgr::getInstance()->mSelectedDwell = dwell; - LLViewerParcelMgr::getInstance()->notifyObservers(); + LLViewerParcelMgr::getInstance()->mParcelMsgSignal(); } } diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index c2d976e746..dbb5d687a1 100755 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -128,6 +128,10 @@ public: void addObserver(LLParcelObserver* observer); void removeObserver(LLParcelObserver* observer); void notifyObservers(); + + typedef boost::signals2::signal<void()> parcel_msg_signal_t; + boost::signals2::connection addParcelMsgCallback(const parcel_msg_signal_t::slot_type& cb) + { return mParcelMsgSignal.connect(cb); } void setSelectionVisible(BOOL visible) { mRenderSelection = visible; } @@ -332,6 +336,8 @@ private: LLVector3d mHoverEastNorth; std::vector<LLParcelObserver*> mObservers; + + parcel_msg_signal_t mParcelMsgSignal; BOOL mTeleportInProgress; LLVector3d mTeleportInProgressPosition; -- GitLab