summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-04-16 02:09:03 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-04-16 02:13:49 +0300
commit3fb9993a4a74c19b872bb96ed4878cd7b7143208 (patch)
tree2cd2e1d0f026ce003a199c437a5a575fb5ec486b /indra/newview
parentc9b83e8117026aa7fc70da3972049152a669b0fc (diff)
SL-15312 Legacy profiles remake #9
Cleanup obsolete properties processesing
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelavatar.cpp36
-rw-r--r--indra/newview/llpanelavatar.h22
-rw-r--r--indra/newview/llpanelprofile.cpp68
-rw-r--r--indra/newview/llpanelprofile.h8
-rw-r--r--indra/newview/llpanelprofileclassifieds.cpp4
-rw-r--r--indra/newview/llpanelprofileclassifieds.h4
-rw-r--r--indra/newview/llpanelprofilepicks.cpp4
-rw-r--r--indra/newview/llpanelprofilepicks.h4
8 files changed, 52 insertions, 98 deletions
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index fada9cc98b..90f3e87ae9 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -76,23 +76,13 @@ LLPanelProfileTab::LLPanelProfileTab()
LLPanelProfileTab::~LLPanelProfileTab()
{
- if(getAvatarId().notNull())
- {
- LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this);
- }
}
void LLPanelProfileTab::setAvatarId(const LLUUID& avatar_id)
{
if (avatar_id.notNull())
{
- if (getAvatarId().notNull())
- {
- LLAvatarPropertiesProcessor::getInstance()->removeObserver(mAvatarId, this);
- }
mAvatarId = avatar_id;
- LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this);
-
mSelfProfile = (getAvatarId() == gAgentID);
}
}
@@ -130,3 +120,29 @@ void LLPanelProfileTab::setApplyProgress(bool started)
}
}
}
+
+LLPanelProfilePropertiesPeocessorTab::LLPanelProfilePropertiesPeocessorTab()
+ : LLPanelProfileTab()
+{
+}
+
+LLPanelProfilePropertiesPeocessorTab::~LLPanelProfilePropertiesPeocessorTab()
+{
+ if (getAvatarId().notNull())
+ {
+ LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this);
+ }
+}
+
+void LLPanelProfilePropertiesPeocessorTab::setAvatarId(const LLUUID & avatar_id)
+{
+ if (avatar_id.notNull())
+ {
+ if (getAvatarId().notNull())
+ {
+ LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this);
+ }
+ LLPanelProfileTab::setAvatarId(avatar_id);
+ LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this);
+ }
+}
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index fb9ff26ca6..1b47411fdb 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -81,7 +81,6 @@ protected:
*/
class LLPanelProfileTab
: public LLPanel
- , public LLAvatarPropertiesObserver
{
public:
@@ -106,11 +105,6 @@ public:
virtual void onOpen(const LLSD& key);
/**
- * Processes data received from server.
- */
- virtual void processProperties(void* data, EAvatarProcessorType type) = 0;
-
- /**
* Clears all data received from server.
*/
virtual void resetData(){};
@@ -152,4 +146,20 @@ private:
bool mSelfProfile;
};
+class LLPanelProfilePropertiesPeocessorTab
+ : public LLPanelProfileTab
+ , public LLAvatarPropertiesObserver
+{
+public:
+ LLPanelProfilePropertiesPeocessorTab();
+ ~LLPanelProfilePropertiesPeocessorTab();
+
+ /*virtual*/ void setAvatarId(const LLUUID& avatar_id);
+
+ /**
+ * Processes data received from server via LLAvatarPropertiesObserver.
+ */
+ virtual void processProperties(void* data, EAvatarProcessorType type) = 0;
+};
+
#endif // LL_LLPANELAVATAR_H
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 175fb4dbdc..7d3a98ba96 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -840,7 +840,6 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key)
resetData();
LLUUID avatar_id = getAvatarId();
- LLAvatarPropertiesProcessor::getInstance()->addObserver(avatar_id, this);
BOOL own_profile = getSelfProfile();
@@ -907,19 +906,6 @@ void LLPanelProfileSecondLife::updateData()
}
}
-void LLPanelProfileSecondLife::processProperties(void* data, EAvatarProcessorType type)
-{
-
- if (APT_PROPERTIES == type)
- {
- const LLAvatarData* avatar_data = static_cast<const LLAvatarData*>(data);
- if(avatar_data && getAvatarId() == avatar_data->avatar_id)
- {
- processProfileProperties(avatar_data);
- }
- }
-}
-
void LLPanelProfileSecondLife::resetData()
{
resetLoading();
@@ -944,9 +930,6 @@ void LLPanelProfileSecondLife::processProfileProperties(const LLAvatarData* avat
LLUUID avatar_id = getAvatarId();
if (!LLAvatarActions::isFriend(avatar_id) && !getSelfProfile())
{
- // this is non-friend avatar. Status will be updated from LLAvatarPropertiesProcessor.
- // in LLPanelProfileSecondLife::processOnlineStatus()
-
// subscribe observer to get online status. Request will be sent by LLPanelProfileSecondLife itself.
// do not subscribe for friend avatar because online status can be wrong overridden
// via LLAvatarData::flags if Preferences: "Only Friends & Groups can see when I am online" is set.
@@ -1622,18 +1605,6 @@ BOOL LLPanelProfileWeb::postBuild()
return TRUE;
}
-void LLPanelProfileWeb::processProperties(void* data, EAvatarProcessorType type)
-{
- if (APT_PROPERTIES == type)
- {
- const LLAvatarData* avatar_data = static_cast<const LLAvatarData*>(data);
- if (avatar_data && getAvatarId() == avatar_data->avatar_id)
- {
- setLoaded();
- }
- }
-}
-
void LLPanelProfileWeb::resetData()
{
mWebBrowser->navigateHome();
@@ -1859,18 +1830,6 @@ void LLPanelProfileFirstLife::onDiscardDescriptionChanges()
setDescriptionText(mCurrentDescription);
}
-void LLPanelProfileFirstLife::processProperties(void* data, EAvatarProcessorType type)
-{
- if (APT_PROPERTIES == type)
- {
- const LLAvatarData* avatar_data = static_cast<const LLAvatarData*>(data);
- if (avatar_data && getAvatarId() == avatar_data->avatar_id)
- {
- processProperties(avatar_data);
- }
- }
-}
-
void LLPanelProfileFirstLife::processProperties(const LLAvatarData* avatar_data)
{
setDescriptionText(avatar_data->fl_about_text);
@@ -2012,19 +1971,6 @@ void LLPanelProfileNotes::onDiscardNotesChanges()
setNotesText(mCurrentNotes);
}
-void LLPanelProfileNotes::processProperties(void* data, EAvatarProcessorType type)
-{
- if (APT_NOTES == type)
- {
- LLAvatarNotes* avatar_notes = static_cast<LLAvatarNotes*>(data);
- if (avatar_notes && getAvatarId() == avatar_notes->target_id)
- {
- processProperties(avatar_notes);
- LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this);
- }
- }
-}
-
void LLPanelProfileNotes::processProperties(LLAvatarNotes* avatar_notes)
{
mNotesEditor->setValue(avatar_notes->notes);
@@ -2064,15 +2010,6 @@ BOOL LLPanelProfile::postBuild()
return TRUE;
}
-void LLPanelProfile::processProperties(void* data, EAvatarProcessorType type)
-{
- //*TODO: figure out what this does
- mTabContainer->setCommitCallback(boost::bind(&LLPanelProfile::onTabChange, this));
-
- // Load data on currently opened tab as well
- onTabChange();
-}
-
void LLPanelProfile::onTabChange()
{
LLPanelProfileTab* active_panel = dynamic_cast<LLPanelProfileTab*>(mTabContainer->getCurrentPanel());
@@ -2120,9 +2057,8 @@ void LLPanelProfile::onOpen(const LLSD& key)
updateBtnsVisibility();
- // KC - Not handling pick and classified opening thru onOpen
- // because this would make unique profile floaters per slurl
- // and result in multiple profile floaters for the same avatar
+ // Some tabs only request data when opened
+ mTabContainer->setCommitCallback(boost::bind(&LLPanelProfile::onTabChange, this));
}
void LLPanelProfile::updateData()
diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h
index 630bfcfdbc..05be48f1c2 100644
--- a/indra/newview/llpanelprofile.h
+++ b/indra/newview/llpanelprofile.h
@@ -89,8 +89,6 @@ public:
/*virtual*/ BOOL postBuild();
- /*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
-
void resetData();
/**
@@ -214,8 +212,6 @@ public:
/*virtual*/ BOOL postBuild();
- /*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
-
void resetData();
/**
@@ -257,7 +253,6 @@ public:
/*virtual*/ BOOL postBuild();
- /*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
void processProperties(const LLAvatarData* avatar_data);
void resetData();
@@ -303,7 +298,6 @@ public:
/*virtual*/ BOOL postBuild();
- /*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
void processProperties(LLAvatarNotes* avatar_notes);
void resetData();
@@ -339,8 +333,6 @@ public:
/*virtual*/ void updateData();
- /*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
-
/*virtual*/ void onOpen(const LLSD& key);
void showPick(const LLUUID& pick_id = LLUUID::null);
diff --git a/indra/newview/llpanelprofileclassifieds.cpp b/indra/newview/llpanelprofileclassifieds.cpp
index 268c99e91b..2769329dca 100644
--- a/indra/newview/llpanelprofileclassifieds.cpp
+++ b/indra/newview/llpanelprofileclassifieds.cpp
@@ -191,7 +191,7 @@ LLClassifiedHandler gClassifiedHandler;
//-----------------------------------------------------------------------------
LLPanelProfileClassifieds::LLPanelProfileClassifieds()
- : LLPanelProfileTab()
+ : LLPanelProfilePropertiesPeocessorTab()
, mClassifiedToSelectOnLoad(LLUUID::null)
, mClassifiedEditOnLoad(false)
{
@@ -473,7 +473,7 @@ static const S32 CB_ITEM_MATURE = 0;
static const S32 CB_ITEM_PG = 1;
LLPanelProfileClassified::LLPanelProfileClassified()
- : LLPanelProfileTab()
+ : LLPanelProfilePropertiesPeocessorTab()
, mInfoLoaded(false)
, mTeleportClicksOld(0)
, mMapClicksOld(0)
diff --git a/indra/newview/llpanelprofileclassifieds.h b/indra/newview/llpanelprofileclassifieds.h
index a85781f4b5..89ce8dae1a 100644
--- a/indra/newview/llpanelprofileclassifieds.h
+++ b/indra/newview/llpanelprofileclassifieds.h
@@ -68,7 +68,7 @@ public:
* Panel for displaying Avatar's picks.
*/
class LLPanelProfileClassifieds
- : public LLPanelProfileTab
+ : public LLPanelProfilePropertiesPeocessorTab
{
public:
LLPanelProfileClassifieds();
@@ -109,7 +109,7 @@ private:
class LLPanelProfileClassified
- : public LLPanelProfileTab
+ : public LLPanelProfilePropertiesPeocessorTab
{
public:
diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp
index 406ff2b8de..264d3b78f1 100644
--- a/indra/newview/llpanelprofilepicks.cpp
+++ b/indra/newview/llpanelprofilepicks.cpp
@@ -120,7 +120,7 @@ LLPickHandler gPickHandler;
//-----------------------------------------------------------------------------
LLPanelProfilePicks::LLPanelProfilePicks()
- : LLPanelProfileTab()
+ : LLPanelProfilePropertiesPeocessorTab()
, mPickToSelectOnLoad(LLUUID::null)
{
}
@@ -370,7 +370,7 @@ bool LLPanelProfilePicks::canDeletePick()
//-----------------------------------------------------------------------------
LLPanelProfilePick::LLPanelProfilePick()
- : LLPanelProfileTab()
+ : LLPanelProfilePropertiesPeocessorTab()
, LLRemoteParcelInfoObserver()
, mSnapshotCtrl(NULL)
, mPickId(LLUUID::null)
diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h
index aa58e46a9f..8be3e0285b 100644
--- a/indra/newview/llpanelprofilepicks.h
+++ b/indra/newview/llpanelprofilepicks.h
@@ -44,7 +44,7 @@ class LLTextEditor;
* Panel for displaying Avatar's picks.
*/
class LLPanelProfilePicks
- : public LLPanelProfileTab
+ : public LLPanelProfilePropertiesPeocessorTab
{
public:
LLPanelProfilePicks();
@@ -93,7 +93,7 @@ private:
class LLPanelProfilePick
- : public LLPanelProfileTab
+ : public LLPanelProfilePropertiesPeocessorTab
, public LLRemoteParcelInfoObserver
{
public: