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 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') 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(); -- cgit v1.3