本文整理汇总了C++中LLInvFVBridge::canShare方法的典型用法代码示例。如果您正苦于以下问题:C++ LLInvFVBridge::canShare方法的具体用法?C++ LLInvFVBridge::canShare怎么用?C++ LLInvFVBridge::canShare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLInvFVBridge
的用法示例。
在下文中一共展示了LLInvFVBridge::canShare方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: canShareSelectedItems
// static
bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NULL*/)
{
using namespace action_give_inventory;
if (!inv_panel)
{
LLInventoryPanel* active_panel = get_active_inventory_panel();
if (!active_panel) return false;
inv_panel = active_panel;
}
// check selection in the panel
LLFolderView* root_folder = inv_panel->getRootFolder();
if (!root_folder)
{
return false;
}
const std::set<LLFolderViewItem*> inventory_selected = root_folder->getSelectionList();
if (inventory_selected.empty()) return false; // nothing selected
bool can_share = true;
std::set<LLFolderViewItem*>::const_iterator it = inventory_selected.begin();
const std::set<LLFolderViewItem*>::const_iterator it_end = inventory_selected.end();
for (; it != it_end; ++it)
{
LLViewerInventoryCategory* inv_cat = gInventory.getCategory(static_cast<LLFolderViewModelItemInventory*>((*it)->getViewModelItem())->getUUID());
// any category can be offered.
if (inv_cat)
{
continue;
}
// check if inventory item can be given
LLFolderViewItem* item = *it;
if (!item) return false;
LLInvFVBridge* bridge = dynamic_cast<LLInvFVBridge*>(item->getViewModelItem());
if (bridge && bridge->canShare())
{
continue;
}
// there are neither item nor category in inventory
can_share = false;
break;
}
return can_share;
}
示例2: canShare
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;
LLInvFVBridge* bridge = current_item
? dynamic_cast <LLInvFVBridge*> (current_item->getListener())
: NULL;
return bridge ? bridge->canShare() : false;
}