diff options
Diffstat (limited to 'indra/newview/llsidepanelinventory.cpp')
-rwxr-xr-x | indra/newview/llsidepanelinventory.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 2e91ceee2e..2556714792 100755 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -119,7 +119,6 @@ private: LLSidepanelInventory::LLSidepanelInventory() : LLPanel() , mItemPanel(NULL) - , mInventoryPanelInbox(NULL) , mPanelMainInventory(NULL) , mInboxEnabled(false) , mCategoriesObserver(NULL) @@ -161,7 +160,7 @@ BOOL LLSidepanelInventory::postBuild() { // UI elements from inventory panel { - mInventoryPanel = getChild<LLPanel>("sidepanel__inventory_panel"); + mInventoryPanel = getChild<LLPanel>("sidepanel_inventory_panel"); mInfoBtn = mInventoryPanel->getChild<LLButton>("info_btn"); mInfoBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onInfoButtonClicked, this)); @@ -299,7 +298,7 @@ void LLSidepanelInventory::observeInboxModifications(const LLUUID& inboxID) // (this can happen multiple times on the initial session that creates the inbox) // - if (mInventoryPanelInbox != NULL) + if (mInventoryPanelInbox.get() != NULL) { return; } @@ -310,7 +309,7 @@ void LLSidepanelInventory::observeInboxModifications(const LLUUID& inboxID) if (inboxID.isNull()) { - llwarns << "Attempting to track modifications to non-existent inbox" << llendl; + LL_WARNS() << "Attempting to track modifications to non-existent inbox" << LL_ENDL; return; } @@ -333,7 +332,8 @@ void LLSidepanelInventory::observeInboxModifications(const LLUUID& inboxID) // LLPanelMarketplaceInbox * inbox = getChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL); - mInventoryPanelInbox = inbox->setupInventoryPanel(); + LLInventoryPanel* inventory_panel = inbox->setupInventoryPanel(); + mInventoryPanelInbox = inventory_panel->getInventoryPanelHandle(); } void LLSidepanelInventory::enableInbox(bool enabled) @@ -461,9 +461,9 @@ void LLSidepanelInventory::performActionOnSelection(const std::string &action) LLFolderViewItem* current_item = mPanelMainInventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { - if (mInventoryPanelInbox) + if (mInventoryPanelInbox.get() && mInventoryPanelInbox.get()->getRootFolder()) { - current_item = mInventoryPanelInbox->getRootFolder()->getCurSelectedItem(); + current_item = mInventoryPanelInbox.get()->getRootFolder()->getCurSelectedItem(); } if (!current_item) @@ -614,10 +614,10 @@ void LLSidepanelInventory::updateVerbs() bool LLSidepanelInventory::canShare() { - LLInventoryPanel* inbox = mInventoryPanelInbox; + LLInventoryPanel* inbox = mInventoryPanelInbox.get(); // Avoid flicker in the Recent tab while inventory is being loaded. - if ( (!inbox || inbox->getRootFolder()->getSelectionList().empty()) + if ( (!inbox || !inbox->getRootFolder() || inbox->getRootFolder()->getSelectionList().empty()) && (mPanelMainInventory && !mPanelMainInventory->getActivePanel()->getRootFolder()->hasVisibleChildren()) ) { return false; @@ -652,9 +652,9 @@ LLInventoryItem *LLSidepanelInventory::getSelectedItem() if (!current_item) { - if (mInventoryPanelInbox) + if (mInventoryPanelInbox.get() && mInventoryPanelInbox.get()->getRootFolder()) { - current_item = mInventoryPanelInbox->getRootFolder()->getCurSelectedItem(); + current_item = mInventoryPanelInbox.get()->getRootFolder()->getCurSelectedItem(); } if (!current_item) @@ -671,12 +671,12 @@ U32 LLSidepanelInventory::getSelectedCount() { int count = 0; - std::set<LLFolderViewItem*> selection_list = mPanelMainInventory->getActivePanel()->getRootFolder()->getSelectionList(); + std::set<LLFolderViewItem*> selection_list = mPanelMainInventory->getActivePanel()->getRootFolder()->getSelectionList(); count += selection_list.size(); - if ((count == 0) && mInboxEnabled && (mInventoryPanelInbox != NULL)) + if ((count == 0) && mInboxEnabled && mInventoryPanelInbox.get() && mInventoryPanelInbox.get()->getRootFolder()) { - selection_list = mInventoryPanelInbox->getRootFolder()->getSelectionList(); + selection_list = mInventoryPanelInbox.get()->getRootFolder()->getSelectionList(); count += selection_list.size(); } @@ -710,13 +710,13 @@ void LLSidepanelInventory::clearSelections(bool clearMain, bool clearInbox) if (inv_panel) { - inv_panel->clearSelection(); + inv_panel->getRootFolder()->clearSelection(); } } - if (clearInbox && mInboxEnabled && (mInventoryPanelInbox != NULL)) + if (clearInbox && mInboxEnabled && mInventoryPanelInbox.get()) { - mInventoryPanelInbox->clearSelection(); + mInventoryPanelInbox.get()->getRootFolder()->clearSelection(); } updateVerbs(); @@ -726,9 +726,9 @@ std::set<LLFolderViewItem*> LLSidepanelInventory::getInboxSelectionList() { std::set<LLFolderViewItem*> inventory_selected_uuids; - if (mInboxEnabled && (mInventoryPanelInbox != NULL)) + if (mInboxEnabled && mInventoryPanelInbox.get() && mInventoryPanelInbox.get()->getRootFolder()) { - inventory_selected_uuids = mInventoryPanelInbox->getRootFolder()->getSelectionList(); + inventory_selected_uuids = mInventoryPanelInbox.get()->getRootFolder()->getSelectionList(); } return inventory_selected_uuids; |