summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepanelinventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llsidepanelinventory.cpp')
-rw-r--r--indra/newview/llsidepanelinventory.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 23e96c22fa..1e585ece23 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -311,18 +311,17 @@ bool LLSidepanelInventory::canShare()
LLPanelMainInventory* panel_main_inventory =
mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
- LLFolderView* root_folder =
- panel_main_inventory->getActivePanel()->getRootFolder();
-
- LLFolderViewItem* current_item = root_folder->hasVisibleChildren()
- ? root_folder->getCurSelectedItem()
- : NULL;
+ if (!panel_main_inventory)
+ {
+ llwarns << "Failed to get the main inventory panel" << llendl;
+ return false;
+ }
- LLInvFVBridge* bridge = current_item
- ? dynamic_cast <LLInvFVBridge*> (current_item->getListener())
- : NULL;
+ LLInventoryPanel* active_panel = panel_main_inventory->getActivePanel();
+ // Avoid flicker in the Recent tab while inventory is being loaded.
+ if (!active_panel->getRootFolder()->hasVisibleChildren()) return false;
- return bridge ? bridge->canShare() : false;
+ return LLAvatarActions::canShareSelectedItems(active_panel);
}
LLInventoryItem *LLSidepanelInventory::getSelectedItem()