diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2014-04-22 12:19:28 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2014-04-22 12:19:28 -0600 |
commit | ae564140c0ff1e05ebfab0752458313da0c07a79 (patch) | |
tree | fc8a1c9828f2baf8a64b8439561d2db99fc12a81 /indra/llui | |
parent | e36b90539525095101526086db5c0cd282060388 (diff) | |
parent | c71e459bed68c1602d409e5c946c5e016d09d105 (diff) |
Merge
Diffstat (limited to 'indra/llui')
-rwxr-xr-x | indra/llui/llfolderview.cpp | 30 | ||||
-rwxr-xr-x | indra/llui/llfolderview.h | 7 |
2 files changed, 24 insertions, 13 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 0243e45e17..53f2e15ed0 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -167,7 +167,6 @@ LLFolderView::LLFolderView(const Params& p) mMinWidth(0), mDragAndDropThisFrame(FALSE), mCallbackRegistrar(NULL), - mParentPanel(p.parent_panel), mUseEllipses(p.use_ellipses), mDraggingOverItem(NULL), mStatusTextBox(NULL), @@ -175,6 +174,8 @@ LLFolderView::LLFolderView(const Params& p) mViewModel(p.view_model) { claimMem(mViewModel); + LLPanel* panel = p.parent_panel; + mParentPanel = panel->getHandle(); mViewModel->setFolderView(this); mRoot = this; @@ -263,6 +264,7 @@ LLFolderView::~LLFolderView( void ) mItems.clear(); mFolders.clear(); + //mViewModel->setFolderView(NULL); mViewModel = NULL; } @@ -323,7 +325,7 @@ static LLTrace::BlockTimerStatHandle FTM_FILTER("Filter Folder View"); void LLFolderView::filter( LLFolderViewFilter& filter ) { LL_RECORD_BLOCK_TIME(FTM_FILTER); - filter.resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32(mParentPanel->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100)); + filter.resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32(mParentPanel.get()->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100)); // Note: we filter the model, not the view getViewModelItem()->filter(filter); @@ -417,7 +419,7 @@ BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL openitem, if( selection && take_keyboard_focus) { - mParentPanel->setFocus(TRUE); + mParentPanel.get()->setFocus(TRUE); } // clear selection down here because change of keyboard focus can potentially @@ -755,7 +757,7 @@ void LLFolderView::removeSelectedItems() if (item_to_delete->remove()) { // change selection on successful delete - setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel->hasFocus()); + setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel.get()->hasFocus()); } } arrangeAll(); @@ -765,7 +767,7 @@ void LLFolderView::removeSelectedItems() std::vector<LLFolderViewModelItem*> listeners; LLFolderViewModelItem* listener; - setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel->hasFocus()); + setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel.get()->hasFocus()); listeners.reserve(count); for(S32 i = 0; i < count; ++i) @@ -946,7 +948,7 @@ void LLFolderView::cut() } // Update the selection - setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel->hasFocus()); + setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel.get()->hasFocus()); } mSearchString.clear(); } @@ -1288,7 +1290,7 @@ BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char) } BOOL handled = FALSE; - if (mParentPanel->hasFocus()) + if (mParentPanel.get()->hasFocus()) { // SL-51858: Key presses are not being passed to the Popup menu. // A proper fix is non-trivial so instead just close the menu. @@ -1322,7 +1324,7 @@ BOOL LLFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) mKeyboardSelection = FALSE; mSearchString.clear(); - mParentPanel->setFocus(TRUE); + mParentPanel.get()->setFocus(TRUE); LLEditMenuHandler::gEditMenuHandler = this; @@ -1405,7 +1407,7 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) { // all user operations move keyboard focus to inventory // this way, we know when to stop auto-updating a search - mParentPanel->setFocus(TRUE); + mParentPanel.get()->setFocus(TRUE); BOOL handled = childrenHandleRightMouseDown(x, y, mask) != NULL; S32 count = mSelectedItems.size(); @@ -1597,6 +1599,12 @@ void LLFolderView::update() // If this is associated with the user's inventory, don't do anything // until that inventory is loaded up. LL_RECORD_BLOCK_TIME(FTM_INVENTORY); + + // If there's no model, the view is in suspended state (being deleted) and shouldn't be updated + if (getFolderViewModel() == NULL) + { + return; + } if (getFolderViewModel()->getFilter().isModified() && getFolderViewModel()->getFilter().isNotDefault()) { @@ -1643,8 +1651,8 @@ void LLFolderView::update() BOOL filter_finished = getViewModelItem()->passedFilter() && mViewModel->contentsReady(); if (filter_finished - || gFocusMgr.childHasKeyboardFocus(mParentPanel) - || gFocusMgr.childHasMouseCapture(mParentPanel)) + || gFocusMgr.childHasKeyboardFocus(mParentPanel.get()) + || gFocusMgr.childHasMouseCapture(mParentPanel.get())) { // finishing the filter process, giving focus to the folder view, or dragging the scrollbar all stop the auto select process mNeedsAutoSelect = FALSE; diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 4ef685ba0c..f188fdd0dc 100755 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -228,7 +228,7 @@ public: void setCallbackRegistrar(LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* registrar) { mCallbackRegistrar = registrar; } - LLPanel* getParentPanel() { return mParentPanel; } + LLPanel* getParentPanel() { return mParentPanel.get(); } // DEBUG only void dumpSelectionInformation(); @@ -237,6 +237,9 @@ public: bool useLabelSuffix() { return mUseLabelSuffix; } void updateMenu(); + // Note: We may eventually have to move that method up the hierarchy to LLFolderViewItem. + LLHandle<LLFolderView> getHandle() const { return getDerivedHandle<LLFolderView>(); } + private: void updateMenuOptions(LLMenuGL* menu); void updateRenamerPosition(); @@ -294,7 +297,7 @@ protected: S32 mSignalSelectCallback; S32 mMinWidth; - LLPanel* mParentPanel; + LLHandle<LLPanel> mParentPanel; LLFolderViewModelInterface* mViewModel; |