From c5979e11b6b18e893cc96b31498eb7a3a30e3780 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 7 Jun 2023 21:56:32 +0300 Subject: SL-19686 Fix selection callback --- indra/newview/llinventorypanel.cpp | 15 ++++++--------- indra/newview/llinventorypanel.h | 5 ++--- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index c29638ee78..3b8aa3f296 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -305,6 +305,11 @@ void LLInventoryPanel::initFolderRoot() mFolderRoot.get()->setFollowsAll(); mFolderRoot.get()->addChild(mFolderRoot.get()->mStatusTextBox); + if (mSelectionCallback) + { + mFolderRoot.get()->setSelectCallback(mSelectionCallback); + } + // Set up the callbacks from the inventory we're viewing, and then build everything. mInventoryObserver = new LLInventoryPanelObserver(this); mInventory->addObserver(mInventoryObserver); @@ -1433,6 +1438,7 @@ void LLInventoryPanel::setSelectCallback(const boost::functionsetSelectCallback(cb); } + mSelectionCallback = cb; } void LLInventoryPanel::clearSelection() @@ -2135,15 +2141,6 @@ LLInventorySingleFolderPanel::~LLInventorySingleFolderPanel() { } -void LLInventorySingleFolderPanel::setSelectCallback(const boost::function& items, BOOL user_action)>& cb) -{ - if (mFolderRoot.get()) - { - mFolderRoot.get()->setSelectCallback(cb); - mSelectionCallback = cb; - } -} - void LLInventorySingleFolderPanel::initFromParams(const Params& p) { mFolderID = gInventory.getRootFolderID(); diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index f4f6940743..8d05fcb8b9 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -368,6 +368,8 @@ protected: virtual LLFolderView * createFolderRoot(LLUUID root_id ); virtual LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop); virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge); + + boost::function& items, BOOL user_action)> mSelectionCallback; private: // buildViewsTree does not include some checks and is meant // for recursive use, use buildNewViews() for first call @@ -425,8 +427,6 @@ public: std::list getNavBackwardList() { return mBackwardFolders; } std::list getNavForwardList() { return mForwardFolders; } - void setSelectCallback(const boost::function& items, BOOL user_action)>& cb); - typedef boost::function root_changed_callback_t; boost::signals2::connection setRootChangedCallback(root_changed_callback_t cb); @@ -435,7 +435,6 @@ protected: ~LLInventorySingleFolderPanel(); void updateSingleFolderRoot(); - boost::function& items, BOOL user_action)> mSelectionCallback; friend class LLUICtrlFactory; LLUUID mFolderID; -- cgit v1.2.3