From a2e22732f195dc075a733c79f15156752f522a43 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 30 Jul 2013 19:13:45 -0700 Subject: Summer cleaning - removed a lot of llcommon dependencies to speed up build times consolidated most indra-specific constants in llcommon under indra_constants.h fixed issues with operations on mixed unit types (implicit and explicit) made LL_INFOS() style macros variadic in order to subsume other logging methods such as ll_infos added optional tag output to error recorders --- indra/llui/llfolderview.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'indra/llui/llfolderview.cpp') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 8aa1eb7cd5..5628baa4a1 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -255,8 +255,6 @@ LLFolderView::~LLFolderView( void ) mRenamer = NULL; mStatusTextBox = NULL; - mAutoOpenItems.removeAllNodes(); - if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die(); mAutoOpenItems.removeAllNodes(); @@ -736,7 +734,7 @@ void LLFolderView::removeSelectedItems() } else { - llinfos << "Cannot delete " << item->getName() << llendl; + LL_INFOS() << "Cannot delete " << item->getName() << LL_ENDL; return; } } @@ -762,20 +760,21 @@ void LLFolderView::removeSelectedItems() } else if (count > 1) { - LLDynamicArray listeners; + std::vector listeners; LLFolderViewModelItem* listener; setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel->hasFocus()); + listeners.reserve(count); for(S32 i = 0; i < count; ++i) { listener = items[i]->getViewModelItem(); - if(listener && (listeners.find(listener) == LLDynamicArray::FAIL)) + if(listener && (std::find(listeners.begin(), listeners.end(), listener) == listeners.end())) { - listeners.put(listener); + listeners.push_back(listener); } } - listener = static_cast(listeners.get(0)); + listener = static_cast(listeners.at(0)); if(listener) { listener->removeBatch(listeners); @@ -1282,7 +1281,7 @@ BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char) if (uni_char > 0x7f) { - llwarns << "LLFolderView::handleUnicodeCharHere - Don't handle non-ascii yet, aborting" << llendl; + LL_WARNS() << "LLFolderView::handleUnicodeCharHere - Don't handle non-ascii yet, aborting" << LL_ENDL; return FALSE; } @@ -1744,14 +1743,14 @@ void LLFolderView::update() void LLFolderView::dumpSelectionInformation() { - llinfos << "LLFolderView::dumpSelectionInformation()" << llendl; - llinfos << "****************************************" << llendl; + LL_INFOS() << "LLFolderView::dumpSelectionInformation()" << LL_NEWLINE + << "****************************************" << LL_ENDL; selected_items_t::iterator item_it; for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) { - llinfos << " " << (*item_it)->getName() << llendl; + LL_INFOS() << " " << (*item_it)->getName() << LL_ENDL; } - llinfos << "****************************************" << llendl; + LL_INFOS() << "****************************************" << LL_ENDL; } void LLFolderView::updateRenamerPosition() -- cgit v1.2.3 From cbe397ad13665c7bc993e10d8fe1e4a876253378 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 5 Sep 2013 14:04:13 -0700 Subject: changed fast timer over to using macro another attempt to move mem stat into base class --- indra/llui/llfolderview.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/llui/llfolderview.cpp') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 5628baa4a1..419ad56e64 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -317,11 +317,11 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height ) return llround(mTargetHeight); } -static LLFastTimer::DeclareTimer FTM_FILTER("Filter Folder View"); +static LLTrace::TimeBlock FTM_FILTER("Filter Folder View"); void LLFolderView::filter( LLFolderViewFilter& filter ) { - LLFastTimer t2(FTM_FILTER); + LL_RECORD_BLOCK_TIME(FTM_FILTER); filter.setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000)); getViewModelItem()->filter(filter); @@ -480,10 +480,10 @@ BOOL LLFolderView::changeSelection(LLFolderViewItem* selection, BOOL selected) return rv; } -static LLFastTimer::DeclareTimer FTM_SANITIZE_SELECTION("Sanitize Selection"); +static LLTrace::TimeBlock FTM_SANITIZE_SELECTION("Sanitize Selection"); void LLFolderView::sanitizeSelection() { - LLFastTimer _(FTM_SANITIZE_SELECTION); + LL_RECORD_BLOCK_TIME(FTM_SANITIZE_SELECTION); // store off current item in case it is automatically deselected // and we want to preserve context LLFolderViewItem* original_selected_item = getCurSelectedItem(); @@ -1586,15 +1586,15 @@ void LLFolderView::setShowSingleSelection(BOOL show) } } -static LLFastTimer::DeclareTimer FTM_AUTO_SELECT("Open and Select"); -static LLFastTimer::DeclareTimer FTM_INVENTORY("Inventory"); +static LLTrace::TimeBlock FTM_AUTO_SELECT("Open and Select"); +static LLTrace::TimeBlock FTM_INVENTORY("Inventory"); // Main idle routine void LLFolderView::update() { // If this is associated with the user's inventory, don't do anything // until that inventory is loaded up. - LLFastTimer t2(FTM_INVENTORY); + LL_RECORD_BLOCK_TIME(FTM_INVENTORY); if (getFolderViewModel()->getFilter().isModified() && getFolderViewModel()->getFilter().isNotDefault()) { @@ -1612,7 +1612,7 @@ void LLFolderView::update() // automatically show matching items, and select first one if we had a selection if (mNeedsAutoSelect) { - LLFastTimer t3(FTM_AUTO_SELECT); + LL_RECORD_BLOCK_TIME(FTM_AUTO_SELECT); // select new item only if a filtered item not currently selected LLFolderViewItem* selected_itemp = mSelectedItems.empty() ? NULL : mSelectedItems.back(); if (!mAutoSelectOverride && (!selected_itemp || !selected_itemp->getViewModelItem()->potentiallyVisible())) -- cgit v1.2.3 From ab8f64a96754edaa68dd1ff97b9519eff4496aa6 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 24 Sep 2013 00:05:43 -0700 Subject: converted memory tracking units to KB from B added more memory tracking to LLFolderView and kin --- indra/llui/llfolderview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui/llfolderview.cpp') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 373b0e05ac..f0caba3e13 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -174,6 +174,7 @@ LLFolderView::LLFolderView(const Params& p) mShowItemLinkOverlays(p.show_item_link_overlays), mViewModel(p.view_model) { + memClaim(mViewModel); mViewModel->setFolderView(this); mRoot = this; @@ -1578,7 +1579,7 @@ BOOL LLFolderView::getShowSelectionContext() return FALSE; } -void LLFolderView::setShowSingleSelection(BOOL show) +void LLFolderView::setShowSingleSelection(bool show) { if (show != mShowSingleSelection) { -- cgit v1.2.3 From 053d97db1b283ca2548dc1f64756ddfc5166158f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 25 Sep 2013 19:12:35 -0700 Subject: better memory usage for LLTrace (tighter packing of recording arrays) removed complicated and unnecessary fast timer gapless handoff logic (it should be gapless anyway) improved MemTrackable API, better separation of shadow and footprint added memory usage stats to floater_stats.xml --- indra/llui/llfolderview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llfolderview.cpp') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index f0caba3e13..e6582a7ae9 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -174,7 +174,7 @@ LLFolderView::LLFolderView(const Params& p) mShowItemLinkOverlays(p.show_item_link_overlays), mViewModel(p.view_model) { - memClaim(mViewModel); + claimMem(mViewModel); mViewModel->setFolderView(this); mRoot = this; -- cgit v1.2.3 From 697d2e720ba75e142a4d56ae8794bab8d7698dad Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 15 Oct 2013 20:24:42 -0700 Subject: renamed TimeBlock to BlockTimerStatHandle --- indra/llui/llfolderview.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llui/llfolderview.cpp') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index e6582a7ae9..253b23b2fb 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -318,7 +318,7 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height ) return llround(mTargetHeight); } -static LLTrace::TimeBlock FTM_FILTER("Filter Folder View"); +static LLTrace::BlockTimerStatHandle FTM_FILTER("Filter Folder View"); void LLFolderView::filter( LLFolderViewFilter& filter ) { @@ -482,7 +482,7 @@ BOOL LLFolderView::changeSelection(LLFolderViewItem* selection, BOOL selected) return rv; } -static LLTrace::TimeBlock FTM_SANITIZE_SELECTION("Sanitize Selection"); +static LLTrace::BlockTimerStatHandle FTM_SANITIZE_SELECTION("Sanitize Selection"); void LLFolderView::sanitizeSelection() { LL_RECORD_BLOCK_TIME(FTM_SANITIZE_SELECTION); @@ -1588,8 +1588,8 @@ void LLFolderView::setShowSingleSelection(bool show) } } -static LLTrace::TimeBlock FTM_AUTO_SELECT("Open and Select"); -static LLTrace::TimeBlock FTM_INVENTORY("Inventory"); +static LLTrace::BlockTimerStatHandle FTM_AUTO_SELECT("Open and Select"); +static LLTrace::BlockTimerStatHandle FTM_INVENTORY("Inventory"); // Main idle routine void LLFolderView::update() -- cgit v1.2.3 From e6b4b89bf12ae410fa87baf01117daa2a47754c0 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 11 Nov 2013 18:39:02 -0800 Subject: MAINT-3320 : WIP : Use handle for elements that'll get deleted under us, quite a bit of debug spam to clean later --- indra/llui/llfolderview.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/llui/llfolderview.cpp') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index cf449217f5..4d1c2a38d0 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -176,6 +176,7 @@ LLFolderView::LLFolderView(const Params& p) { mViewModel->setFolderView(this); mRoot = this; + llinfos << "Merov : create folder view, this = " << this << ", name = " << (std::string(p.name)) << ", model = " << getFolderViewModel() << llendl; LLRect rect = p.rect; LLRect new_rect(rect.mLeft, rect.mBottom + getRect().getHeight(), rect.mLeft + getRect().getWidth(), rect.mBottom); @@ -243,6 +244,7 @@ LLFolderView::LLFolderView(const Params& p) // Destroys the object LLFolderView::~LLFolderView( void ) { + llinfos << "Merov : delete folder view (start), this = " << this << ", model = " << getFolderViewModel() << llendl; closeRenamer(); // The release focus call can potentially call the @@ -264,7 +266,9 @@ LLFolderView::~LLFolderView( void ) mItems.clear(); mFolders.clear(); + mViewModel->setFolderView(NULL); mViewModel = NULL; + llinfos << "Merov : delete folder view (end), this = " << this << ", model = " << getFolderViewModel() << llendl; } BOOL LLFolderView::canFocusChildren() const @@ -1598,6 +1602,13 @@ void LLFolderView::update() // If this is associated with the user's inventory, don't do anything // until that inventory is loaded up. LLFastTimer t2(FTM_INVENTORY); + + // If there's no model, the view is in suspended state (being deleted) and shouldn't be updated + if (getFolderViewModel() == NULL) + { + return; + } + //llinfos << "Merov : update, this = " << this << ", model = " << getFolderViewModel() << llendl; if (getFolderViewModel()->getFilter().isModified() && getFolderViewModel()->getFilter().isNotDefault()) { -- cgit v1.2.3 From 6ec99570cd86a89ed6367f81d6b0cccd7fe0e913 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 15 Nov 2013 15:12:11 -0800 Subject: MAINT-3320 : Fixed! Inventory panels are not resistant to folder root deletion, using handle instead of pointer and cleaning things consistently --- indra/llui/llfolderview.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'indra/llui/llfolderview.cpp') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 4d1c2a38d0..225bf21b0a 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -167,16 +167,16 @@ LLFolderView::LLFolderView(const Params& p) mMinWidth(0), mDragAndDropThisFrame(FALSE), mCallbackRegistrar(NULL), - mParentPanel(p.parent_panel), mUseEllipses(p.use_ellipses), mDraggingOverItem(NULL), mStatusTextBox(NULL), mShowItemLinkOverlays(p.show_item_link_overlays), mViewModel(p.view_model) { + LLPanel* panel = p.parent_panel; + mParentPanel = panel->getHandle(); mViewModel->setFolderView(this); mRoot = this; - llinfos << "Merov : create folder view, this = " << this << ", name = " << (std::string(p.name)) << ", model = " << getFolderViewModel() << llendl; LLRect rect = p.rect; LLRect new_rect(rect.mLeft, rect.mBottom + getRect().getHeight(), rect.mLeft + getRect().getWidth(), rect.mBottom); @@ -244,7 +244,6 @@ LLFolderView::LLFolderView(const Params& p) // Destroys the object LLFolderView::~LLFolderView( void ) { - llinfos << "Merov : delete folder view (start), this = " << this << ", model = " << getFolderViewModel() << llendl; closeRenamer(); // The release focus call can potentially call the @@ -268,7 +267,6 @@ LLFolderView::~LLFolderView( void ) mViewModel->setFolderView(NULL); mViewModel = NULL; - llinfos << "Merov : delete folder view (end), this = " << this << ", model = " << getFolderViewModel() << llendl; } BOOL LLFolderView::canFocusChildren() const @@ -329,7 +327,7 @@ void LLFolderView::filter( LLFolderViewFilter& filter ) { // Entry point of inventory filtering (CHUI-849) LLFastTimer t2(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); @@ -423,7 +421,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 @@ -761,7 +759,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(); @@ -771,7 +769,7 @@ void LLFolderView::removeSelectedItems() LLDynamicArray 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()); for(S32 i = 0; i < count; ++i) { @@ -951,7 +949,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(); } @@ -1293,7 +1291,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. @@ -1327,7 +1325,7 @@ BOOL LLFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) mKeyboardSelection = FALSE; mSearchString.clear(); - mParentPanel->setFocus(TRUE); + mParentPanel.get()->setFocus(TRUE); LLEditMenuHandler::gEditMenuHandler = this; @@ -1410,7 +1408,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(); @@ -1608,7 +1606,6 @@ void LLFolderView::update() { return; } - //llinfos << "Merov : update, this = " << this << ", model = " << getFolderViewModel() << llendl; if (getFolderViewModel()->getFilter().isModified() && getFolderViewModel()->getFilter().isNotDefault()) { @@ -1655,8 +1652,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; -- cgit v1.2.3 From c16de4df1834ccc15a6776c4fef7abb1789c2099 Mon Sep 17 00:00:00 2001 From: merov Date: Fri, 22 Nov 2013 20:16:03 +0000 Subject: ACME-1219 : Fix crash on exit on Windows 7 --- indra/llui/llfolderview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llfolderview.cpp') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 87cc070770..704e03a605 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -265,7 +265,7 @@ LLFolderView::~LLFolderView( void ) mItems.clear(); mFolders.clear(); - mViewModel->setFolderView(NULL); + //mViewModel->setFolderView(NULL); mViewModel = NULL; } -- cgit v1.2.3 From 813bc232e7175ba3e20a70f16427d12c7681a996 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 9 Dec 2013 15:42:51 -0800 Subject: MAINT-3017 FIX Inventory filter for Recent tab does not persist between sessions as it used to. added names back to inventory filters, so they can be deserialized --- indra/llui/llfolderview.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'indra/llui/llfolderview.cpp') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index f32a52e6c6..884fd0ed0f 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1599,19 +1599,21 @@ void LLFolderView::update() // until that inventory is loaded up. LLFastTimer t2(FTM_INVENTORY); - if (getFolderViewModel()->getFilter().isModified() && getFolderViewModel()->getFilter().isNotDefault()) + LLFolderViewFilter& filter_object = getFolderViewModel()->getFilter(); + + if (filter_object.isModified() && filter_object.isNotDefault()) { mNeedsAutoSelect = TRUE; } // Filter to determine visibility before arranging - filter(getFolderViewModel()->getFilter()); + filter(filter_object); // Clear the modified setting on the filter only if the filter finished after running the filter process // Note: if the filter count has timed out, that means the filter halted before completing the entire set of items - if (getFolderViewModel()->getFilter().isModified() && (!getFolderViewModel()->getFilter().isTimedOut())) + if (filter_object.isModified() && (!filter_object.isTimedOut())) { - getFolderViewModel()->getFilter().clearModified(); + filter_object.clearModified(); } // automatically show matching items, and select first one if we had a selection @@ -1630,7 +1632,7 @@ void LLFolderView::update() // Open filtered folders for folder views with mAutoSelectOverride=TRUE. // Used by LLPlacesFolderView. - if (getFolderViewModel()->getFilter().showAllResults()) + if (filter_object.showAllResults()) { // these are named variables to get around gcc not binding non-const references to rvalues // and functor application is inherently non-const to allow for stateful functors -- cgit v1.2.3 From c243578337cb4be0d0445dba90719dd279a54cb5 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 8 Jan 2014 12:34:35 +0200 Subject: =?UTF-8?q?MAINT-3520=20FIXED=20=D0=A1all=20arrange(NULL,=20NULL)?= =?UTF-8?q?=20to=20avoid=20occasional=20drag'n'drop=20folders=20after=20re?= =?UTF-8?q?naming.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/llui/llfolderview.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llui/llfolderview.cpp') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 884fd0ed0f..13d231d712 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -629,6 +629,8 @@ bool LLFolderView::startDrag() void LLFolderView::commitRename( const LLSD& data ) { finishRenamingItem(); + arrange( NULL, NULL ); + } void LLFolderView::draw() -- cgit v1.2.3