From 4d412d38ce63cc040f25b883bfc3e358a8c1bb7c Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Tue, 9 Mar 2010 16:16:07 -0800 Subject: EXT-6030 - [ Assert Failure] Assert in LLFolderViewFolder when select inventory folder after moving item between folders reviewed by Leyla --- indra/newview/llfolderviewitem.cpp | 82 -------------------------------------- 1 file changed, 82 deletions(-) (limited to 'indra/newview/llfolderviewitem.cpp') diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 76607e4874..d3e3d2b57b 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -121,7 +121,6 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mHasVisibleChildren(FALSE), mIndentation(0), mItemHeight(p.item_height), - mNumDescendantsSelected(0), mPassedFilter(FALSE), mLastFilterGeneration(-1), mStringMatchOffset(std::string::npos), @@ -497,22 +496,6 @@ BOOL LLFolderViewItem::changeSelection(LLFolderViewItem* selection, BOOL selecte return FALSE; } -void LLFolderViewItem::recursiveDeselect(BOOL deselect_self) -{ - if (mIsSelected && deselect_self) - { - mIsSelected = FALSE; - - // update ancestors' count of selected descendents - LLFolderViewFolder* parent_folder = getParentFolder(); - while(parent_folder) - { - parent_folder->mNumDescendantsSelected--; - parent_folder = parent_folder->getParentFolder(); - } - } -} - BOOL LLFolderViewItem::isMovable() { @@ -1459,7 +1442,6 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem { rv = TRUE; child_selected = TRUE; - mNumDescendantsSelected++; } } for (items_t::iterator iter = mItems.begin(); @@ -1470,7 +1452,6 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem { rv = TRUE; child_selected = TRUE; - mNumDescendantsSelected++; } } if(openitem && child_selected) @@ -1503,14 +1484,6 @@ BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection, folders_t::iterator fit = iter++; if((*fit)->changeSelection(selection, selected)) { - if (selected) - { - mNumDescendantsSelected++; - } - else - { - mNumDescendantsSelected--; - } rv = TRUE; } } @@ -1520,14 +1493,6 @@ BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection, items_t::iterator iit = iter++; if((*iit)->changeSelection(selection, selected)) { - if (selected) - { - mNumDescendantsSelected++; - } - else - { - mNumDescendantsSelected--; - } rv = TRUE; } } @@ -1544,7 +1509,6 @@ S32 LLFolderViewFolder::extendSelection(LLFolderViewItem* selection, LLFolderVie { folders_t::iterator fit = iter++; num_selected += (*fit)->extendSelection(selection, last_selected, selected_items); - mNumDescendantsSelected += num_selected; } // handle selection of our immediate children... @@ -1637,7 +1601,6 @@ S32 LLFolderViewFolder::extendSelection(LLFolderViewItem* selection, LLFolderVie if (item->changeSelection(item, TRUE)) { selected_items.put(item); - mNumDescendantsSelected++; num_selected++; } } @@ -1648,7 +1611,6 @@ S32 LLFolderViewFolder::extendSelection(LLFolderViewItem* selection, LLFolderVie if (selection->changeSelection(selection, TRUE)) { selected_items.put(selection); - mNumDescendantsSelected++; num_selected++; } } @@ -1656,47 +1618,6 @@ S32 LLFolderViewFolder::extendSelection(LLFolderViewItem* selection, LLFolderVie return num_selected; } -void LLFolderViewFolder::recursiveDeselect(BOOL deselect_self) -{ - // make sure we don't have negative values - llassert(mNumDescendantsSelected >= 0); - - if (mIsSelected && deselect_self) - { - mIsSelected = FALSE; - - // update ancestors' count of selected descendents - LLFolderViewFolder* parent_folder = getParentFolder(); - while(parent_folder) - { - parent_folder->mNumDescendantsSelected--; - parent_folder = parent_folder->getParentFolder(); - } - } - - if (0 == mNumDescendantsSelected) - { - return; - } - - for (items_t::iterator iter = mItems.begin(); - iter != mItems.end();) - { - items_t::iterator iit = iter++; - LLFolderViewItem* item = (*iit); - item->recursiveDeselect(TRUE); - } - - for (folders_t::iterator iter = mFolders.begin(); - iter != mFolders.end();) - { - folders_t::iterator fit = iter++; - LLFolderViewFolder* folder = (*fit); - folder->recursiveDeselect(TRUE); - } - -} - void LLFolderViewFolder::destroyView() { for (items_t::iterator iter = mItems.begin(); @@ -1730,8 +1651,6 @@ BOOL LLFolderViewFolder::removeItem(LLFolderViewItem* item) { if(item->remove()) { - //RN: this seem unneccessary as remove() moves to trash - //removeView(item); return TRUE; } return FALSE; @@ -1746,7 +1665,6 @@ void LLFolderViewFolder::removeView(LLFolderViewItem* item) return; } // deselect without traversing hierarchy - item->recursiveDeselect(TRUE); getRoot()->removeFromSelectionList(item); extractItem(item); delete item; -- cgit v1.2.3 From 27a7a68883ab93a41df815684b74631a5dca0a73 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Tue, 16 Mar 2010 19:22:17 +0200 Subject: =?UTF-8?q?Fix=20for=20normal=20task=20(EXT-6355)=20[TRANSLATED=20?= =?UTF-8?q?BUT=20IN=20EN]=20-=20Inventory,=20hovertext=20of=20system=20fol?= =?UTF-8?q?ders:=20hovertext=20isn=C2=B4t=20localized.=20-=20Added=20updat?= =?UTF-8?q?ing=20tooltips=20with=20localized=20names.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed by Vadim Savchuk https://codereview.productengine.com/secondlife/r/39/ --HG-- branch : product-engine --- indra/newview/llfolderviewitem.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfolderviewitem.cpp') diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index d3e3d2b57b..72e34594db 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -260,6 +260,7 @@ void LLFolderViewItem::refreshFromListener() LLTrans::findString(mLabel, "InvFolder " + mLabel); }; + setToolTip(mLabel); setIcon(mListener->getIcon()); time_t creation_date = mListener->getCreationDate(); if (mCreationDate != creation_date) -- cgit v1.2.3 From 38ab25aed8f413b95cdaf1bddca4f38c4222cf48 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Tue, 16 Mar 2010 20:27:10 +0200 Subject: Fixed normal bug EXT - 6027 ([TRANSLATED BUT IN EN] Bubble shown when you mouseover on system folder within Inventory > Library) - Added localized string from strings.xml as a tooltip --HG-- branch : product-engine --- indra/newview/llfolderviewitem.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfolderviewitem.cpp') diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 72e34594db..8b3ba6c72b 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -258,6 +258,7 @@ void LLFolderViewItem::refreshFromListener() if (LLFolderType::lookupIsProtectedType(preferred_type)) { LLTrans::findString(mLabel, "InvFolder " + mLabel); + setToolTip(mLabel); }; setToolTip(mLabel); -- cgit v1.2.3 From 632afda4dd8abc5bfc7b3a47d4f7bef44fa2f821 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 17 Mar 2010 14:02:54 +0200 Subject: Code cleanup: remove superfluous call of the setToolTip method. These calls were added while working on two separate tickets - EXT - 6027 ([TRANSLATED BUT IN EN] Bubble shown when you mouseover on system folder within Inventory > Library) (37baa70ea94b) - (EXT-6355) [TRANSLATED BUT IN EN] - Inventory, hovertext of system folders: hovertext isn?t localized. (80b6110ba41e) --HG-- branch : product-engine --- indra/newview/llfolderviewitem.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llfolderviewitem.cpp') diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 8b3ba6c72b..72e34594db 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -258,7 +258,6 @@ void LLFolderViewItem::refreshFromListener() if (LLFolderType::lookupIsProtectedType(preferred_type)) { LLTrans::findString(mLabel, "InvFolder " + mLabel); - setToolTip(mLabel); }; setToolTip(mLabel); -- cgit v1.2.3 From 464092e2c9354c62143f3cbf5503445e6e6fe84e Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Wed, 17 Mar 2010 14:17:35 +0200 Subject: Fixed normal EXT - 6028 ( [HARD CODED]? Inventory > Library > \"Accessories\" folder) Added localization string to the strings.xml for Accessories folder and localization support of Accessories folder from source code (llfolderviewitem.cpp). TRANSLATION TO THE CORRESPONDING LANGUAGE -- this string should be added to the strings.xml for each locale. Note: due to Accessories category is created out of viewer & has the FT_NONE type it can not be localized as other protected (system) categories. So, hack was provided to check this folder (in a Library) & localize it. Reviewd by Mike Antipov at https://codereview.productengine.com/secondlife/r/42/ --HG-- branch : product-engine --- indra/newview/llfolderviewitem.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfolderviewitem.cpp') diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 72e34594db..bb4c75d3ac 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -255,7 +255,25 @@ void LLFolderViewItem::refreshFromListener() // temporary attempt to display the inventory folder in the user locale. // mantipov: *NOTE: be sure this code is synchronized with LLFriendCardsManager::findChildFolderUUID // it uses the same way to find localized string - if (LLFolderType::lookupIsProtectedType(preferred_type)) + + // HACK: EXT - 6028 ([HARD CODED]? Inventory > Library > "Accessories" folder) + // Translation of Accessories folder in Library inventory folder + bool accessories = false; + if(mLabel == std::string("Accessories")) + { + //To ensure that Accessories folder is in Library we have to check its parent folder. + //Due to parent LLFolderViewFloder is not set to this item yet we have to check its parent via Inventory Model + LLInventoryCategory* cat = gInventory.getCategory(mListener->getUUID()); + if(cat) + { + const LLUUID& parent_folder_id = cat->getParentUUID(); + accessories = (parent_folder_id == gInventory.getLibraryRootFolderID()); + } + } + + //"Accessories" inventory category has folder type FT_NONE. So, this folder + //can not be detected as protected with LLFolderType::lookupIsProtectedType + if (accessories || LLFolderType::lookupIsProtectedType(preferred_type)) { LLTrans::findString(mLabel, "InvFolder " + mLabel); }; -- cgit v1.2.3