summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorypanel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r--indra/newview/llinventorypanel.cpp200
1 files changed, 98 insertions, 102 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index bc5f52dc4f..f374ed11e2 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -179,15 +179,15 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
}
// context menu callbacks
- mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLInventoryPanel::doToSelected, this, _2));
- mCommitCallbackRegistrar.add("Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH));
- mCommitCallbackRegistrar.add("Inventory.EmptyLostAndFound", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyLostAndFound", LLFolderType::FT_LOST_AND_FOUND));
- mCommitCallbackRegistrar.add("Inventory.DoCreate", boost::bind(&LLInventoryPanel::doCreate, this, _2));
- mCommitCallbackRegistrar.add("Inventory.AttachObject", boost::bind(&LLInventoryPanel::attachObject, this, _2));
- mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this));
- mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this));
- mCommitCallbackRegistrar.add("Inventory.FileUploadLocation", boost::bind(&LLInventoryPanel::fileUploadLocation, this, _2));
- mCommitCallbackRegistrar.add("Inventory.OpenNewFolderWindow", boost::bind(&LLInventoryPanel::openSingleViewInventory, this, LLUUID()));
+ mCommitCallbackRegistrar.add("Inventory.DoToSelected", { boost::bind(&LLInventoryPanel::doToSelected, this, _2), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.EmptyTrash", { boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.EmptyLostAndFound", { boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyLostAndFound", LLFolderType::FT_LOST_AND_FOUND), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.DoCreate", { boost::bind(&LLInventoryPanel::doCreate, this, _2), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.AttachObject", { boost::bind(&LLInventoryPanel::attachObject, this, _2), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.BeginIMSession", { boost::bind(&LLInventoryPanel::beginIMSession, this), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.Share", { boost::bind(&LLAvatarActions::shareWithAvatars, this), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.FileUploadLocation", { boost::bind(&LLInventoryPanel::fileUploadLocation, this, _2), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.OpenNewFolderWindow", { boost::bind(&LLInventoryPanel::openSingleViewInventory, this, LLUUID()), LLUICtrl::cb_info::UNTRUSTED_THROTTLE });
}
LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id )
@@ -379,7 +379,7 @@ void LLInventoryPanel::initializeViewBuilding()
}
/*virtual*/
-void LLInventoryPanel::onVisibilityChange(BOOL new_visibility)
+void LLInventoryPanel::onVisibilityChange(bool new_visibility)
{
if (new_visibility && mViewsInitialized == VIEWS_UNINITIALIZED)
{
@@ -416,8 +416,10 @@ void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType
{
getFilter().setFilterObjectTypes(types);
}
- if (filter_type == LLInventoryFilter::FILTERTYPE_CATEGORY)
+ else if (filter_type == LLInventoryFilter::FILTERTYPE_CATEGORY)
+ {
getFilter().setFilterCategoryTypes(types);
+ }
}
void LLInventoryPanel::setFilterWorn()
@@ -427,7 +429,7 @@ void LLInventoryPanel::setFilterWorn()
U32 LLInventoryPanel::getFilterObjectTypes() const
{
- return getFilter().getFilterObjectTypes();
+ return (U32)getFilter().getFilterObjectTypes();
}
U32 LLInventoryPanel::getFilterPermMask() const
@@ -478,7 +480,7 @@ U32 LLInventoryPanel::getSortOrder() const
return getFolderViewModel()->getSorter().getSortOrder();
}
-void LLInventoryPanel::setSinceLogoff(BOOL sl)
+void LLInventoryPanel::setSinceLogoff(bool sl)
{
getFilter().setDateRangeLastLogoff(sl);
}
@@ -580,8 +582,8 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
if (model_item && view_item && viewmodel_item)
{
const LLUUID& idp = viewmodel_item->getUUID();
- view_item->destroyView();
removeItemID(idp);
+ view_item->destroyView();
}
LLInventoryObject const* objectp = mInventory->getObject(item_id);
@@ -658,9 +660,9 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
}
// Select any newly created object that has the auto rename at top of folder root set.
- if(mFolderRoot.get()->getRoot()->needsAutoRename())
+ if(mFolderRoot.get() && mFolderRoot.get()->getRoot()->needsAutoRename())
{
- setSelection(item_id, FALSE);
+ setSelection(item_id, false);
}
updateFolderLabel(model_item->getParentUUID());
@@ -700,7 +702,7 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
const LLUUID trash_id = mInventory->findCategoryUUIDForType(LLFolderType::FT_TRASH);
if (trash_id != model_item->getParentUUID() && (mask & LLInventoryObserver::INTERNAL) && new_parent->isOpen())
{
- setSelection(item_id, FALSE);
+ setSelection(item_id, false);
}
}
updateFolderLabel(model_item->getParentUUID());
@@ -753,10 +755,10 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
{
updateFolderLabel(viewmodel_folder->getUUID());
}
- }
- if (view_item->isFavorite())
- {
- parent->updateHasFavorites(false); // favorite was removed
+ if (view_item->isFavorite())
+ {
+ parent->updateHasFavorites(false); // favorite was removed
+ }
}
}
}
@@ -942,16 +944,16 @@ void LLInventoryPanel::idle(void* user_data)
EAcceptance last_accept = LLToolDragAndDrop::getInstance()->getLastAccept();
if (last_accept == ACCEPT_YES_SINGLE || last_accept == ACCEPT_YES_COPY_SINGLE)
{
- panel->mFolderRoot.get()->setShowSingleSelection(TRUE);
+ panel->mFolderRoot.get()->setShowSingleSelection(true);
}
else
{
- panel->mFolderRoot.get()->setShowSingleSelection(FALSE);
+ panel->mFolderRoot.get()->setShowSingleSelection(false);
}
}
else
{
- panel->mFolderRoot.get()->setShowSingleSelection(FALSE);
+ panel->mFolderRoot.get()->setShowSingleSelection(false);
}
}
else
@@ -973,7 +975,18 @@ void LLInventoryPanel::initializeViews(F64 max_time)
mBuildViewsEndTime = curent_time + max_time;
// init everything
- initRootContent();
+ LLUUID root_id = getRootFolderID();
+ if (root_id.notNull())
+ {
+ buildNewViews(getRootFolderID());
+ }
+ else
+ {
+ // Default case: always add "My Inventory" root first, "Library" root second
+ // If we run out of time, this still should create root folders
+ buildNewViews(gInventory.getRootFolderID()); // My Inventory
+ buildNewViews(gInventory.getLibraryRootFolderID()); // Library
+ }
if (mBuildViewsQueue.empty() && mBuildRootQueue.empty())
{
@@ -994,34 +1007,18 @@ void LLInventoryPanel::initializeViews(F64 max_time)
LLFolderViewFolder* lib_folder = getFolderByID(gInventory.getLibraryRootFolderID());
if (lib_folder)
{
- lib_folder->setOpen(TRUE);
+ lib_folder->setOpen(true);
}
// Auto close the user's my inventory folder
LLFolderViewFolder* my_inv_folder = getFolderByID(gInventory.getRootFolderID());
if (my_inv_folder)
{
- my_inv_folder->setOpenArrangeRecursively(FALSE, LLFolderViewFolder::RECURSE_DOWN);
+ my_inv_folder->setOpenArrangeRecursively(false, LLFolderViewFolder::RECURSE_DOWN);
}
}
}
-void LLInventoryPanel::initRootContent()
-{
- LLUUID root_id = getRootFolderID();
- if (root_id.notNull())
- {
- buildNewViews(getRootFolderID());
- }
- else
- {
- // Default case: always add "My Inventory" root first, "Library" root second
- // If we run out of time, this still should create root folders
- buildNewViews(gInventory.getRootFolderID()); // My Inventory
- buildNewViews(gInventory.getLibraryRootFolderID()); // Library
- }
-}
-
LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop)
{
@@ -1206,7 +1203,7 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
// In the case of the root folder been shown, open that folder by default once the widget is created
if (create_root)
{
- folder_view_item->setOpen(TRUE);
+ folder_view_item->setOpen(true);
}
}
}
@@ -1284,7 +1281,7 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
// Make sure panel won't lock in a loop over existing items if
// folder is enormous and at least some work gets done
const S32 MIN_ITEMS_PER_CALL = 500;
- const S32 starting_item_count = mItemMap.size();
+ const S32 starting_item_count = static_cast<S32>(mItemMap.size());
LLFolderViewFolder *parentp = dynamic_cast<LLFolderViewFolder*>(folder_view_item);
bool done = true;
@@ -1315,7 +1312,7 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
if (!mBuildChildrenViews
&& mode == BUILD_TIMELIMIT
- && MIN_ITEMS_PER_CALL + starting_item_count < mItemMap.size())
+ && MIN_ITEMS_PER_CALL + starting_item_count < static_cast<S32>(mItemMap.size()))
{
// Single folder view, check if we still have time
//
@@ -1390,7 +1387,7 @@ void LLInventoryPanel::openStartFolderOrMyInventory()
&& fchild->getViewModelItem()
&& fchild->getViewModelItem()->getName() == "My Inventory")
{
- fchild->setOpen(TRUE);
+ fchild->setOpen(true);
break;
}
}
@@ -1412,13 +1409,13 @@ void LLInventoryPanel::openSelected()
void LLInventoryPanel::unSelectAll()
{
- mFolderRoot.get()->setSelection(NULL, FALSE, FALSE);
+ mFolderRoot.get()->setSelection(NULL, false, false);
}
-BOOL LLInventoryPanel::handleHover(S32 x, S32 y, MASK mask)
+bool LLInventoryPanel::handleHover(S32 x, S32 y, MASK mask)
{
- BOOL handled = LLView::handleHover(x, y, mask);
+ bool handled = LLView::handleHover(x, y, mask);
if(handled)
{
// getCursor gets current cursor, setCursor sets next cursor
@@ -1434,10 +1431,10 @@ BOOL LLInventoryPanel::handleHover(S32 x, S32 y, MASK mask)
{
getWindow()->setCursor(UI_CURSOR_ARROW);
}
- return TRUE;
+ return true;
}
-BOOL LLInventoryPanel::handleToolTip(S32 x, S32 y, MASK mask)
+bool LLInventoryPanel::handleToolTip(S32 x, S32 y, MASK mask)
{
if (const LLFolderViewItem* hover_item_p = (!mFolderRoot.isDead()) ? mFolderRoot.get()->getHoveredItem() : nullptr)
{
@@ -1462,19 +1459,19 @@ BOOL LLInventoryPanel::handleToolTip(S32 x, S32 y, MASK mask)
.delay_time(LLView::getTooltipTimeout())
.create_callback(boost::bind(&LLInspectTextureUtil::createInventoryToolTip, _1))
.create_params(params));
- return TRUE;
+ return true;
}
}
return LLPanel::handleToolTip(x, y, mask);
}
-BOOL LLInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+bool LLInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg)
{
- BOOL handled = FALSE;
+ bool handled = false;
if (mAcceptsDragAndDrop)
{
@@ -1542,11 +1539,11 @@ bool LLInventoryPanel::addBadge(LLBadge * badge)
void LLInventoryPanel::openAllFolders()
{
- mFolderRoot.get()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_DOWN);
+ mFolderRoot.get()->setOpenArrangeRecursively(true, LLFolderViewFolder::RECURSE_DOWN);
mFolderRoot.get()->arrangeAll();
}
-void LLInventoryPanel::setSelection(const LLUUID& obj_id, BOOL take_keyboard_focus)
+void LLInventoryPanel::setSelection(const LLUUID& obj_id, bool take_keyboard_focus)
{
// Don't select objects in COF (e.g. to prevent refocus when items are worn).
const LLInventoryObject *obj = mInventory->getObject(obj_id);
@@ -1557,7 +1554,7 @@ void LLInventoryPanel::setSelection(const LLUUID& obj_id, BOOL take_keyboard_foc
setSelectionByID(obj_id, take_keyboard_focus);
}
-void LLInventoryPanel::setSelectCallback(const boost::function<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)>& cb)
+void LLInventoryPanel::setSelectCallback(const boost::function<void (const std::deque<LLFolderViewItem*>& items, bool user_action)>& cb)
{
if (mFolderRoot.get())
{
@@ -1577,7 +1574,7 @@ LLInventoryPanel::selected_items_t LLInventoryPanel::getSelectedItems() const
return mFolderRoot.get()->getSelectionList();
}
-void LLInventoryPanel::onSelectionChange(const std::deque<LLFolderViewItem*>& items, BOOL user_action)
+void LLInventoryPanel::onSelectionChange(const std::deque<LLFolderViewItem*>& items, bool user_action)
{
// Schedule updating the folder view context menu when all selected items become complete (STORM-373).
mCompletionObserver->reset();
@@ -1605,7 +1602,7 @@ void LLInventoryPanel::onSelectionChange(const std::deque<LLFolderViewItem*>& it
LLFolderView* fv = mFolderRoot.get();
if (fv->needsAutoRename()) // auto-selecting a new user-created asset and preparing to rename
{
- fv->setNeedsAutoRename(FALSE);
+ fv->setNeedsAutoRename(false);
if (items.size()) // new asset is visible and selected
{
fv->startRenamingSelectedItem();
@@ -1729,7 +1726,7 @@ bool LLInventoryPanel::beginIMSession()
item_array,
LLInventoryModel::EXCLUDE_TRASH,
is_buddy);
- S32 count = item_array.size();
+ auto count = item_array.size();
if(count > 0)
{
//*TODO by what to replace that?
@@ -1738,7 +1735,7 @@ bool LLInventoryPanel::beginIMSession()
// create the session
LLAvatarTracker& at = LLAvatarTracker::instance();
LLUUID id;
- for(S32 i = 0; i < count; ++i)
+ for(size_t i = 0; i < count; ++i)
{
id = item_array.at(i)->getCreatorUUID();
if(at.isBuddyOnline(id))
@@ -1807,7 +1804,7 @@ void LLInventoryPanel::purgeSelectedItems()
const std::set<LLFolderViewItem*> inventory_selected = mFolderRoot.get()->getSelectionList();
if (inventory_selected.empty()) return;
LLSD args;
- S32 count = inventory_selected.size();
+ auto count = inventory_selected.size();
std::vector<LLUUID> selected_items;
for (std::set<LLFolderViewItem*>::const_iterator it = inventory_selected.begin(), end_it = inventory_selected.end();
it != end_it;
@@ -1820,7 +1817,7 @@ void LLInventoryPanel::purgeSelectedItems()
count += items.size() + cats.size();
selected_items.push_back(item_id);
}
- args["COUNT"] = count;
+ args["COUNT"] = static_cast<S32>(count);
LLNotificationsUtil::add("PurgeSelectedItems", args, LLSD(), boost::bind(callbackPurgeSelectedItems, _1, _2, selected_items));
}
@@ -1859,7 +1856,7 @@ bool LLInventoryPanel::attachObject(const LLSD& userdata)
return true;
}
-BOOL LLInventoryPanel::getSinceLogoff()
+bool LLInventoryPanel::getSinceLogoff()
{
return getFilter().isSinceLogoff();
}
@@ -1872,15 +1869,15 @@ void LLInventoryPanel::dumpSelectionInformation(void* user_data)
iv->mFolderRoot.get()->dumpSelectionInformation();
}
-BOOL is_inventorysp_active()
+bool is_inventorysp_active()
{
LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
- if (!sidepanel_inventory || !sidepanel_inventory->isInVisibleChain()) return FALSE;
+ if (!sidepanel_inventory || !sidepanel_inventory->isInVisibleChain()) return false;
return sidepanel_inventory->isMainInventoryPanelActive();
}
// static
-LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
+LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(bool auto_open)
{
S32 z_min = S32_MAX;
LLInventoryPanel* res = NULL;
@@ -1890,7 +1887,7 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
if (!floater_inventory)
{
LL_WARNS() << "Could not find My Inventory floater" << LL_ENDL;
- return FALSE;
+ return nullptr;
}
LLSidepanelInventory *inventory_panel = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
@@ -1919,7 +1916,7 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
// Make sure the floater is not minimized (STORM-438).
if (active_inv_floaterp && active_inv_floaterp->isMinimized())
{
- active_inv_floaterp->setMinimized(FALSE);
+ active_inv_floaterp->setMinimized(false);
}
}
else if (auto_open)
@@ -2002,7 +1999,7 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(bool auto_open, const L
LLFloater* floater_inventory = LLFloaterReg::getInstance("inventory");
if (floater_inventory)
{
- floater_inventory->setFocus(TRUE);
+ floater_inventory->setFocus(true);
}
active_panel->setSelection(obj_id, take_keyboard_focus);
}
@@ -2037,7 +2034,7 @@ void LLInventoryPanel::addHideFolderType(LLFolderType::EType folder_type)
getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << folder_type));
}
-BOOL LLInventoryPanel::getIsHiddenFolderType(LLFolderType::EType folder_type) const
+bool LLInventoryPanel::getIsHiddenFolderType(LLFolderType::EType folder_type) const
{
return !(getFilter().getFilterCategoryTypes() & (1ULL << folder_type));
}
@@ -2051,7 +2048,7 @@ void LLInventoryPanel::removeItemID(const LLUUID& id)
{
LLInventoryModel::cat_array_t categories;
LLInventoryModel::item_array_t items;
- gInventory.collectDescendents(id, categories, items, TRUE);
+ gInventory.collectDescendents(id, categories, items, true);
mItemMap.erase(id);
@@ -2091,7 +2088,7 @@ LLFolderViewFolder* LLInventoryPanel::getFolderByID(const LLUUID& id)
}
-void LLInventoryPanel::setSelectionByID( const LLUUID& obj_id, BOOL take_keyboard_focus )
+void LLInventoryPanel::setSelectionByID( const LLUUID& obj_id, bool take_keyboard_focus )
{
LLFolderViewItem* itemp = getItemByID(obj_id);
@@ -2106,7 +2103,7 @@ void LLInventoryPanel::setSelectionByID( const LLUUID& obj_id, BOOL take_keyb
if(itemp && itemp->getViewModelItem())
{
- itemp->arrangeAndSet(TRUE, take_keyboard_focus);
+ itemp->arrangeAndSet(true, take_keyboard_focus);
mSelectThisID.setNull();
mFocusSelection = false;
return;
@@ -2139,9 +2136,9 @@ void LLInventoryPanel::doToSelected(const LLSD& userdata)
return;
}
-BOOL LLInventoryPanel::handleKeyHere( KEY key, MASK mask )
+bool LLInventoryPanel::handleKeyHere( KEY key, MASK mask )
{
- BOOL handled = FALSE;
+ bool handled = false;
switch (key)
{
case KEY_RETURN:
@@ -2161,7 +2158,7 @@ BOOL LLInventoryPanel::handleKeyHere( KEY key, MASK mask )
}
}
LLInventoryAction::doToSelected(mInventory, mFolderRoot.get(), "open");
- handled = TRUE;
+ handled = true;
}
break;
case KEY_DELETE:
@@ -2173,7 +2170,7 @@ BOOL LLInventoryPanel::handleKeyHere( KEY key, MASK mask )
if (isSelectionRemovable() && (mask == MASK_NONE))
{
LLInventoryAction::doToSelected(mInventory, mFolderRoot.get(), "delete");
- handled = TRUE;
+ handled = true;
}
break;
}
@@ -2267,7 +2264,6 @@ protected:
friend class LLUICtrlFactory;
void findAndInitRootContent(const LLUUID& folder_id) override;
- void initRootContent() override;
bool removeFavorite(const LLUUID& id, const LLInventoryObject* model_item);
void itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item) override;
@@ -2309,8 +2305,8 @@ void LLInventoryFavoritesItemsPanel::findAndInitRootContent(const LLUUID& id)
if (categories)
{
- S32 count = categories->size();
- for (S32 i = 0; i < count; ++i)
+ size_t count = categories->size();
+ for (size_t i = 0; i < count; ++i)
{
LLViewerInventoryCategory* cat = categories->at(i);
if (cat->getPreferredType() == LLFolderType::FT_TRASH)
@@ -2337,8 +2333,8 @@ void LLInventoryFavoritesItemsPanel::findAndInitRootContent(const LLUUID& id)
if (items)
{
- S32 count = items->size();
- for (S32 i = 0; i < count; ++i)
+ size_t count = items->size();
+ for (size_t i = 0; i < count; ++i)
{
LLViewerInventoryItem* item = items->at(i);
const LLUUID item_id = item->getUUID();
@@ -2357,11 +2353,6 @@ void LLInventoryFavoritesItemsPanel::findAndInitRootContent(const LLUUID& id)
}
}
-void LLInventoryFavoritesItemsPanel::initRootContent()
-{
- findAndInitRootContent(gInventory.getRootFolderID()); // My Inventory
-}
-
bool LLInventoryFavoritesItemsPanel::removeFavorite(const LLUUID& id, const LLInventoryObject* model_item)
{
std::set<LLUUID>::iterator found = mRootContentIDs.find(id);
@@ -2491,9 +2482,9 @@ LLInventorySingleFolderPanel::LLInventorySingleFolderPanel(const Params& params)
getFilter().setEmptyLookupMessage("InventorySingleFolderNoMatches");
getFilter().setDefaultEmptyLookupMessage("InventorySingleFolderEmpty");
- mCommitCallbackRegistrar.replace("Inventory.DoToSelected", boost::bind(&LLInventorySingleFolderPanel::doToSelected, this, _2));
- mCommitCallbackRegistrar.replace("Inventory.DoCreate", boost::bind(&LLInventorySingleFolderPanel::doCreate, this, _2));
- mCommitCallbackRegistrar.replace("Inventory.Share", boost::bind(&LLInventorySingleFolderPanel::doShare, this));
+ mCommitCallbackRegistrar.replace("Inventory.DoToSelected", { boost::bind(&LLInventorySingleFolderPanel::doToSelected, this, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.replace("Inventory.DoCreate", { boost::bind(&LLInventorySingleFolderPanel::doCreate, this, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.replace("Inventory.Share", { boost::bind(&LLInventorySingleFolderPanel::doShare, this), cb_info::UNTRUSTED_BLOCK });
}
LLInventorySingleFolderPanel::~LLInventorySingleFolderPanel()
@@ -2525,7 +2516,7 @@ void LLInventorySingleFolderPanel::onFocusReceived()
if (folder_view->getVisible())
{
const LLFolderViewModelItemInventory* modelp = static_cast<const LLFolderViewModelItemInventory*>(folder_view->getViewModelItem());
- setSelectionByID(modelp->getUUID(), TRUE);
+ setSelectionByID(modelp->getUUID(), true);
// quick and dirty fix: don't scroll on switching focus
// todo: better 'tab' support, one that would work for LLInventoryPanel
mFolderRoot.get()->stopAutoScollining();
@@ -2546,7 +2537,7 @@ void LLInventorySingleFolderPanel::onFocusReceived()
if (item_view->getVisible())
{
const LLFolderViewModelItemInventory* modelp = static_cast<const LLFolderViewModelItemInventory*>(item_view->getViewModelItem());
- setSelectionByID(modelp->getUUID(), TRUE);
+ setSelectionByID(modelp->getUUID(), true);
mFolderRoot.get()->stopAutoScollining();
break;
}
@@ -2613,14 +2604,14 @@ void LLInventorySingleFolderPanel::clearNavigationHistory()
mBackwardFolders.clear();
}
-bool LLInventorySingleFolderPanel::isBackwardAvailable()
+bool LLInventorySingleFolderPanel::isBackwardAvailable() const
{
- return (!mBackwardFolders.empty() && (mFolderID != mBackwardFolders.back()));
+ return !mBackwardFolders.empty() && (mFolderID != mBackwardFolders.back());
}
-bool LLInventorySingleFolderPanel::isForwardAvailable()
+bool LLInventorySingleFolderPanel::isForwardAvailable() const
{
- return (!mForwardFolders.empty() && (mFolderID != mForwardFolders.back()));
+ return !mForwardFolders.empty() && (mFolderID != mForwardFolders.back());
}
boost::signals2::connection LLInventorySingleFolderPanel::setRootChangedCallback(root_changed_callback_t cb)
@@ -2685,9 +2676,14 @@ void LLInventorySingleFolderPanel::updateSingleFolderRoot()
}
}
-bool LLInventorySingleFolderPanel::hasVisibleItems()
+bool LLInventorySingleFolderPanel::hasVisibleItems() const
{
- return mFolderRoot.get()->hasVisibleChildren();
+ if (const LLFolderView* root = mFolderRoot.get())
+ {
+ return root->hasVisibleChildren();
+ }
+
+ return false;
}
void LLInventorySingleFolderPanel::doCreate(const LLSD& userdata)
@@ -2772,13 +2768,13 @@ void LLAssetFilteredInventoryPanel::initFromParams(const Params& p)
getFilter().setFilterNoMarketplaceFolder();
}
-BOOL LLAssetFilteredInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+bool LLAssetFilteredInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg)
{
- BOOL result = FALSE;
+ bool result = false;
if (mAcceptsDragAndDrop)
{