Commit fec4b2f8 authored by Drake Arconis's avatar Drake Arconis
Browse files

Reduce vtable around the giant people panel class

parent 1813cadb
......@@ -248,27 +248,45 @@ protected:
};
/**
* Update buttons on changes in our friend relations (STORM-557).
* Update buttons on changes in our friend relations or voice status (STORM-557).
*/
class LLButtonsUpdater : public LLPanelPeople::Updater, public LLFriendObserver
class LLButtonsUpdater : public LLPanelPeople::Updater, public LLFriendObserver, public LLVoiceClientStatusObserver
{
public:
LLButtonsUpdater(callback_t cb)
: LLPanelPeople::Updater(cb)
{
LLAvatarTracker::instance().addObserver(this);
LLVoiceClient::getInstance()->addObserver(static_cast<LLVoiceClientStatusObserver*>(this));
}
~LLButtonsUpdater()
{
LLAvatarTracker::instance().removeObserver(this);
if (LLVoiceClient::instanceExists())
{
LLVoiceClient::getInstance()->removeObserver(static_cast<LLVoiceClientStatusObserver*>(this));
}
}
/*virtual*/ void changed(U32 mask) override
void changed(U32 mask) override
{
(void) mask;
update();
}
// Implements LLVoiceClientStatusObserver::onChange() to enable call buttons
// when voice is available
void onChange(EStatusType status, const std::string &channelURI, bool proximal)
{
if (status == STATUS_JOINING || status == STATUS_LEFT_CHANNEL)
{
return;
}
update();
}
};
class LLAvatarListUpdater : public LLPanelPeople::Updater, public LLEventTimer
......@@ -553,11 +571,6 @@ LLPanelPeople::~LLPanelPeople()
delete mNearbyListUpdater;
delete mFriendListUpdater;
delete mRecentListUpdater;
if(LLVoiceClient::instanceExists())
{
LLVoiceClient::getInstance()->removeObserver(this);
}
}
void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list)
......@@ -708,8 +721,6 @@ BOOL LLPanelPeople::postBuild()
// Must go after setting commit callback and initializing all pointers to children.
mTabContainer->selectTabByName(NEARBY_TAB_NAME);
LLVoiceClient::getInstance()->addObserver(this);
updateRecentList();
// call this method in case some list is empty and buttons can be in inconsistent state
......@@ -723,17 +734,6 @@ BOOL LLPanelPeople::postBuild()
return TRUE;
}
// virtual
void LLPanelPeople::onChange(EStatusType status, const std::string &channelURI, bool proximal)
{
if(status == STATUS_JOINING || status == STATUS_LEFT_CHANNEL)
{
return;
}
updateButtons();
}
void LLPanelPeople::updateFriendListHelpText()
{
// show special help text for just created account to help finding friends. EXT-4836
......
......@@ -45,7 +45,6 @@ class LLAccordionCtrlTab;
class LLPanelPeople
: public LLPanel
, public LLVoiceClientStatusObserver
{
LOG_CLASS(LLPanelPeople);
public:
......@@ -55,9 +54,6 @@ public:
/*virtual*/ BOOL postBuild() override;
/*virtual*/ void onOpen(const LLSD& key) override;
/*virtual*/ bool notifyChildren(const LLSD& info) override;
// Implements LLVoiceClientStatusObserver::onChange() to enable call buttons
// when voice is available
/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal) override;
bool mTryToConnectToFacebook;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment