diff options
-rw-r--r-- | indra/newview/llpanellandmarkinfo.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llparticipantlist.cpp | 29 | ||||
-rw-r--r-- | indra/newview/llparticipantlist.h | 16 |
3 files changed, 30 insertions, 23 deletions
diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 1152ca6873..6f3b0db498 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -344,7 +344,7 @@ void LLPanelLandmarkInfo::createLandmark(const LLUUID& folder_id) LLStringUtil::replaceChar(desc, '\n', ' '); // If no folder chosen use the "Landmarks" folder. LLLandmarkActions::createLandmarkHere(name, desc, - folder_id.notNull() ? folder_id : gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK)); + folder_id.notNull() ? folder_id : gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK)); } // static @@ -379,7 +379,7 @@ void LLPanelLandmarkInfo::populateFoldersList() mFolderCombo->removeall(); // Put the "Landmarks" folder first in list. - LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); + LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK); const LLViewerInventoryCategory* cat = gInventory.getCategory(landmarks_id); if (!cat) { @@ -411,7 +411,7 @@ static bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right) static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats) { - LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); + LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK); // Add descendent folders of the "Landmarks" category. LLInventoryModel::item_array_t items; // unused @@ -424,7 +424,7 @@ static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats) is_category); // Add the "My Favorites" category. - LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_FAVORITE); + LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); LLViewerInventoryCategory* favorites_cat = gInventory.getCategory(favorites_id); if (!favorites_cat) { diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 9450bee315..c00c07e53a 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -1,5 +1,5 @@ -/** - * @file llparticipantlist.cpp +llparticipantlist /** + * @file.cpp * @brief LLParticipantList intended to update view(LLAvatarList) according to incoming messages * * $LicenseInfo:firstyear=2009&license=viewergpl$ @@ -45,14 +45,18 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list): mSpeakerMgr(data_source), mAvatarList(avatar_list), - mSpeakerAddListener(*this), - mSpeakerRemoveListener(*this), - mSpeakerClearListener(*this), + mSpeakerAddListener(NULL), + mSpeakerRemoveListener(NULL), + mSpeakerClearListener(NULL), mSortOrder(E_SORT_BY_NAME) { - mSpeakerMgr->addListener(&mSpeakerAddListener, "add"); - mSpeakerMgr->addListener(&mSpeakerRemoveListener, "remove"); - mSpeakerMgr->addListener(&mSpeakerClearListener, "clear"); + mSpeakerAddListener = new SpeakerAddListener(this); + mSpeakerRemoveListener = new SpeakerRemoveListener(this); + mSpeakerClearListener = new SpeakerClearListener(this); + + mSpeakerMgr->addListener(mSpeakerAddListener, "add"); + mSpeakerMgr->addListener(mSpeakerRemoveListener, "remove"); + mSpeakerMgr->addListener(mSpeakerClearListener, "clear"); mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData")); mAvatarList->setDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList)); @@ -71,6 +75,9 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av LLParticipantList::~LLParticipantList() { + delete mSpeakerAddListener; + delete mSpeakerRemoveListener; + delete mSpeakerClearListener; } void LLParticipantList::onAvatarListDoubleClicked(LLAvatarList* list) @@ -153,7 +160,7 @@ void LLParticipantList::sort() // bool LLParticipantList::SpeakerAddListener::handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) { - return mParent.onAddItemEvent(event, userdata); + return mParent->onAddItemEvent(event, userdata); } // @@ -161,7 +168,7 @@ bool LLParticipantList::SpeakerAddListener::handleEvent(LLPointer<LLOldEvents::L // bool LLParticipantList::SpeakerRemoveListener::handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) { - return mParent.onRemoveItemEvent(event, userdata); + return mParent->onRemoveItemEvent(event, userdata); } // @@ -169,5 +176,5 @@ bool LLParticipantList::SpeakerRemoveListener::handleEvent(LLPointer<LLOldEvents // bool LLParticipantList::SpeakerClearListener::handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) { - return mParent.onClearListEvent(event, userdata); + return mParent->onClearListEvent(event, userdata); } diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 04d9e29256..e8d7224906 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -71,29 +71,29 @@ class LLParticipantList class BaseSpeakerListner : public LLOldEvents::LLSimpleListener { public: - BaseSpeakerListner(LLParticipantList& parent) : mParent(parent) {} + BaseSpeakerListner(LLParticipantList* parent) : mParent(parent) {} protected: - LLParticipantList& mParent; + LLParticipantList* mParent; }; class SpeakerAddListener : public BaseSpeakerListner { public: - SpeakerAddListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} + SpeakerAddListener(LLParticipantList* parent) : BaseSpeakerListner(parent) {} /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); }; class SpeakerRemoveListener : public BaseSpeakerListner { public: - SpeakerRemoveListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} + SpeakerRemoveListener(LLParticipantList* parent) : BaseSpeakerListner(parent) {} /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); }; class SpeakerClearListener : public BaseSpeakerListner { public: - SpeakerClearListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} + SpeakerClearListener(LLParticipantList* parent) : BaseSpeakerListner(parent) {} /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); }; @@ -103,9 +103,9 @@ class LLParticipantList LLSpeakerMgr* mSpeakerMgr; LLAvatarList* mAvatarList; - SpeakerAddListener mSpeakerAddListener; - SpeakerRemoveListener mSpeakerRemoveListener; - SpeakerClearListener mSpeakerClearListener; + SpeakerAddListener* mSpeakerAddListener; + SpeakerRemoveListener* mSpeakerRemoveListener; + SpeakerClearListener* mSpeakerClearListener; EParticipantSortOrder mSortOrder; }; |