diff options
Diffstat (limited to 'linden/indra/newview/llfolderview.cpp')
-rw-r--r-- | linden/indra/newview/llfolderview.cpp | 92 |
1 files changed, 31 insertions, 61 deletions
diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp index 431f212..377e620 100644 --- a/linden/indra/newview/llfolderview.cpp +++ b/linden/indra/newview/llfolderview.cpp | |||
@@ -327,10 +327,10 @@ void LLFolderViewItem::arrangeFromRoot() | |||
327 | // UI. If open is TRUE, then folders are opened up along the way to | 327 | // UI. If open is TRUE, then folders are opened up along the way to |
328 | // the selection. | 328 | // the selection. |
329 | void LLFolderViewItem::setSelectionFromRoot(LLFolderViewItem* selection, | 329 | void LLFolderViewItem::setSelectionFromRoot(LLFolderViewItem* selection, |
330 | BOOL open, | 330 | BOOL open, /* Flawfinder: ignore */ |
331 | BOOL take_keyboard_focus) | 331 | BOOL take_keyboard_focus) |
332 | { | 332 | { |
333 | getRoot()->setSelection(selection, open, take_keyboard_focus); | 333 | getRoot()->setSelection(selection, open, take_keyboard_focus); /* Flawfinder: ignore */ |
334 | } | 334 | } |
335 | 335 | ||
336 | // helper function to change the selection from the root. | 336 | // helper function to change the selection from the root. |
@@ -534,7 +534,7 @@ void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
534 | } | 534 | } |
535 | } | 535 | } |
536 | 536 | ||
537 | void LLFolderViewItem::open( void ) | 537 | void LLFolderViewItem::open( void ) /* Flawfinder: ignore */ |
538 | { | 538 | { |
539 | if( mListener ) | 539 | if( mListener ) |
540 | { | 540 | { |
@@ -1365,7 +1365,7 @@ BOOL LLFolderViewFolder::hasFilteredDescendants() | |||
1365 | 1365 | ||
1366 | // Passes selection information on to children and record selection | 1366 | // Passes selection information on to children and record selection |
1367 | // information if necessary. | 1367 | // information if necessary. |
1368 | BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL open, | 1368 | BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL open, /* Flawfinder: ignore */ |
1369 | BOOL take_keyboard_focus) | 1369 | BOOL take_keyboard_focus) |
1370 | { | 1370 | { |
1371 | BOOL rv = FALSE; | 1371 | BOOL rv = FALSE; |
@@ -1389,7 +1389,7 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL open, | |||
1389 | iter != mFolders.end();) | 1389 | iter != mFolders.end();) |
1390 | { | 1390 | { |
1391 | folders_t::iterator fit = iter++; | 1391 | folders_t::iterator fit = iter++; |
1392 | if((*fit)->setSelection(selection, open, take_keyboard_focus)) | 1392 | if((*fit)->setSelection(selection, open, take_keyboard_focus)) /* Flawfinder: ignore */ |
1393 | { | 1393 | { |
1394 | rv = TRUE; | 1394 | rv = TRUE; |
1395 | child_selected = TRUE; | 1395 | child_selected = TRUE; |
@@ -1400,14 +1400,14 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL open, | |||
1400 | iter != mItems.end();) | 1400 | iter != mItems.end();) |
1401 | { | 1401 | { |
1402 | items_t::iterator iit = iter++; | 1402 | items_t::iterator iit = iter++; |
1403 | if((*iit)->setSelection(selection, open, take_keyboard_focus)) | 1403 | if((*iit)->setSelection(selection, open, take_keyboard_focus)) /* Flawfinder: ignore */ |
1404 | { | 1404 | { |
1405 | rv = TRUE; | 1405 | rv = TRUE; |
1406 | child_selected = TRUE; | 1406 | child_selected = TRUE; |
1407 | mNumDescendantsSelected++; | 1407 | mNumDescendantsSelected++; |
1408 | } | 1408 | } |
1409 | } | 1409 | } |
1410 | if(open && child_selected) | 1410 | if(open && child_selected) /* Flawfinder: ignore */ |
1411 | { | 1411 | { |
1412 | setOpenArrangeRecursively(TRUE); | 1412 | setOpenArrangeRecursively(TRUE); |
1413 | } | 1413 | } |
@@ -1964,16 +1964,16 @@ void LLFolderViewFolder::toggleOpen() | |||
1964 | } | 1964 | } |
1965 | 1965 | ||
1966 | // Force a folder open or closed | 1966 | // Force a folder open or closed |
1967 | void LLFolderViewFolder::setOpen(BOOL open) | 1967 | void LLFolderViewFolder::setOpen(BOOL open) /* Flawfinder: ignore */ |
1968 | { | 1968 | { |
1969 | setOpenArrangeRecursively(open); | 1969 | setOpenArrangeRecursively(open); /* Flawfinder: ignore */ |
1970 | } | 1970 | } |
1971 | 1971 | ||
1972 | void LLFolderViewFolder::setOpenArrangeRecursively(BOOL open, ERecurseType recurse) | 1972 | void LLFolderViewFolder::setOpenArrangeRecursively(BOOL open, ERecurseType recurse) /* Flawfinder: ignore */ |
1973 | { | 1973 | { |
1974 | BOOL was_open = mIsOpen; | 1974 | BOOL was_open = mIsOpen; |
1975 | mIsOpen = open; | 1975 | mIsOpen = open; /* Flawfinder: ignore */ |
1976 | if(!was_open && open) | 1976 | if(!was_open && open) /* Flawfinder: ignore */ |
1977 | { | 1977 | { |
1978 | if(mListener) | 1978 | if(mListener) |
1979 | { | 1979 | { |
@@ -1986,12 +1986,12 @@ void LLFolderViewFolder::setOpenArrangeRecursively(BOOL open, ERecurseType recur | |||
1986 | iter != mFolders.end();) | 1986 | iter != mFolders.end();) |
1987 | { | 1987 | { |
1988 | folders_t::iterator fit = iter++; | 1988 | folders_t::iterator fit = iter++; |
1989 | (*fit)->setOpenArrangeRecursively(open, RECURSE_DOWN); | 1989 | (*fit)->setOpenArrangeRecursively(open, RECURSE_DOWN); /* Flawfinder: ignore */ |
1990 | } | 1990 | } |
1991 | } | 1991 | } |
1992 | if (mParentFolder && (recurse == RECURSE_UP || recurse == RECURSE_UP_DOWN)) | 1992 | if (mParentFolder && (recurse == RECURSE_UP || recurse == RECURSE_UP_DOWN)) |
1993 | { | 1993 | { |
1994 | mParentFolder->setOpenArrangeRecursively(open, RECURSE_UP); | 1994 | mParentFolder->setOpenArrangeRecursively(open, RECURSE_UP); /* Flawfinder: ignore */ |
1995 | } | 1995 | } |
1996 | 1996 | ||
1997 | if (was_open != mIsOpen) | 1997 | if (was_open != mIsOpen) |
@@ -2024,7 +2024,7 @@ BOOL LLFolderViewFolder::handleDragAndDropFromChild(MASK mask, | |||
2024 | return TRUE; | 2024 | return TRUE; |
2025 | } | 2025 | } |
2026 | 2026 | ||
2027 | void LLFolderViewFolder::open( void ) | 2027 | void LLFolderViewFolder::open( void ) /* Flawfinder: ignore */ |
2028 | { | 2028 | { |
2029 | toggleOpen(); | 2029 | toggleOpen(); |
2030 | } | 2030 | } |
@@ -2713,10 +2713,10 @@ void LLFolderView::openFolder(const LLString& foldername) | |||
2713 | } | 2713 | } |
2714 | } | 2714 | } |
2715 | 2715 | ||
2716 | void LLFolderView::setOpenArrangeRecursively(BOOL open, ERecurseType recurse) | 2716 | void LLFolderView::setOpenArrangeRecursively(BOOL open, ERecurseType recurse) /* Flawfinder: ignore */ |
2717 | { | 2717 | { |
2718 | // call base class to do proper recursion | 2718 | // call base class to do proper recursion |
2719 | LLFolderViewFolder::setOpenArrangeRecursively(open, recurse); | 2719 | LLFolderViewFolder::setOpenArrangeRecursively(open, recurse); /* Flawfinder: ignore */ |
2720 | // make sure root folder is always open | 2720 | // make sure root folder is always open |
2721 | mIsOpen = TRUE; | 2721 | mIsOpen = TRUE; |
2722 | } | 2722 | } |
@@ -2892,7 +2892,7 @@ LLFolderViewItem* LLFolderView::getCurSelectedItem( void ) | |||
2892 | 2892 | ||
2893 | 2893 | ||
2894 | // Record the selected item and pass it down the hierachy. | 2894 | // Record the selected item and pass it down the hierachy. |
2895 | BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL open, | 2895 | BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL open, /* Flawfinder: ignore */ |
2896 | BOOL take_keyboard_focus) | 2896 | BOOL take_keyboard_focus) |
2897 | { | 2897 | { |
2898 | if( selection == this ) | 2898 | if( selection == this ) |
@@ -2914,8 +2914,8 @@ BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL open, | |||
2914 | addToSelectionList(selection); | 2914 | addToSelectionList(selection); |
2915 | } | 2915 | } |
2916 | 2916 | ||
2917 | BOOL rv = LLFolderViewFolder::setSelection(selection, open, take_keyboard_focus); | 2917 | BOOL rv = LLFolderViewFolder::setSelection(selection, open, take_keyboard_focus); /* Flawfinder: ignore */ |
2918 | if(open) | 2918 | if(open) /* Flawfinder: ignore */ |
2919 | { | 2919 | { |
2920 | selection->getParentFolder()->requestArrange(); | 2920 | selection->getParentFolder()->requestArrange(); |
2921 | } | 2921 | } |
@@ -3331,7 +3331,7 @@ void LLFolderView::openSelectedItems( void ) | |||
3331 | { | 3331 | { |
3332 | if (mSelectedItems.size() == 1) | 3332 | if (mSelectedItems.size() == 1) |
3333 | { | 3333 | { |
3334 | mSelectedItems.front()->open(); | 3334 | mSelectedItems.front()->open(); /* Flawfinder: ignore */ |
3335 | } | 3335 | } |
3336 | else | 3336 | else |
3337 | { | 3337 | { |
@@ -3345,11 +3345,11 @@ void LLFolderView::openSelectedItems( void ) | |||
3345 | selected_items_t::iterator item_it; | 3345 | selected_items_t::iterator item_it; |
3346 | for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) | 3346 | for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) |
3347 | { | 3347 | { |
3348 | (*item_it)->open(); | 3348 | (*item_it)->open(); /* Flawfinder: ignore */ |
3349 | } | 3349 | } |
3350 | 3350 | ||
3351 | LLFloater::setFloaterHost(NULL); | 3351 | LLFloater::setFloaterHost(NULL); |
3352 | multi_previewp->open(); | 3352 | multi_previewp->open(); /* Flawfinder: ignore */ |
3353 | } | 3353 | } |
3354 | } | 3354 | } |
3355 | } | 3355 | } |
@@ -3380,7 +3380,7 @@ void LLFolderView::propertiesSelectedItems( void ) | |||
3380 | } | 3380 | } |
3381 | 3381 | ||
3382 | LLFloater::setFloaterHost(NULL); | 3382 | LLFloater::setFloaterHost(NULL); |
3383 | multi_propertiesp->open(); | 3383 | multi_propertiesp->open(); /* Flawfinder: ignore */ |
3384 | } | 3384 | } |
3385 | } | 3385 | } |
3386 | } | 3386 | } |
@@ -3858,34 +3858,8 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ) | |||
3858 | search(getCurSelectedItem(), mSearchString.c_str(), FALSE); | 3858 | search(getCurSelectedItem(), mSearchString.c_str(), FALSE); |
3859 | handled = TRUE; | 3859 | handled = TRUE; |
3860 | } | 3860 | } |
3861 | else if (mask & MASK_CONTROL && key == 'N') | ||
3862 | { | ||
3863 | LLFolderViewItem* selection = getCurSelectedItem(); | ||
3864 | if (selection) | ||
3865 | { | ||
3866 | selection = selection->getNextOpenNode(); | ||
3867 | } | ||
3868 | search(selection, mSearchString.c_str(), FALSE); | ||
3869 | mSearchTimer.reset(); | ||
3870 | handled = TRUE; | ||
3871 | } | ||
3872 | else if (mask & MASK_CONTROL && key == 'P') | ||
3873 | { | ||
3874 | LLFolderViewItem* selection = getCurSelectedItem(); | ||
3875 | if (selection) | ||
3876 | { | ||
3877 | selection = selection->getPreviousOpenNode(); | ||
3878 | } | ||
3879 | search(selection, mSearchString.c_str(), TRUE); | ||
3880 | mSearchTimer.reset(); | ||
3881 | handled = TRUE; | ||
3882 | } | ||
3883 | } | 3861 | } |
3884 | 3862 | ||
3885 | if (handled) | ||
3886 | { | ||
3887 | gViewerWindow->requestFastFrame(this); | ||
3888 | } | ||
3889 | return handled; | 3863 | return handled; |
3890 | } | 3864 | } |
3891 | 3865 | ||
@@ -3921,11 +3895,6 @@ BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_pare | |||
3921 | handled = TRUE; | 3895 | handled = TRUE; |
3922 | } | 3896 | } |
3923 | 3897 | ||
3924 | if (handled) | ||
3925 | { | ||
3926 | gViewerWindow->requestFastFrame(this); | ||
3927 | } | ||
3928 | |||
3929 | return handled; | 3898 | return handled; |
3930 | } | 3899 | } |
3931 | 3900 | ||
@@ -4078,7 +4047,7 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) | |||
4078 | } | 4047 | } |
4079 | 4048 | ||
4080 | menu->arrange(); | 4049 | menu->arrange(); |
4081 | menu->updateParent(gMenuHolder); | 4050 | menu->updateParent(LLMenuGL::sMenuContainer); |
4082 | LLMenuGL::showPopup(this, menu, x, y); | 4051 | LLMenuGL::showPopup(this, menu, x, y); |
4083 | } | 4052 | } |
4084 | else | 4053 | else |
@@ -4499,14 +4468,15 @@ std::string::size_type LLInventoryFilter::getStringMatchOffset() const | |||
4499 | return mSubStringMatchOffset; | 4468 | return mSubStringMatchOffset; |
4500 | } | 4469 | } |
4501 | 4470 | ||
4471 | // has user modified default filter params? | ||
4502 | BOOL LLInventoryFilter::isActive() | 4472 | BOOL LLInventoryFilter::isActive() |
4503 | { | 4473 | { |
4504 | return mFilterOps.mFilterTypes != 0xffffffff | 4474 | return mFilterOps.mFilterTypes != mDefaultFilterOps.mFilterTypes |
4505 | || mFilterSubString.size() | 4475 | || mFilterSubString.size() |
4506 | || mFilterOps.mPermissions != PERM_NONE | 4476 | || mFilterOps.mPermissions != mDefaultFilterOps.mPermissions |
4507 | || mFilterOps.mMinDate != 0 | 4477 | || mFilterOps.mMinDate != mDefaultFilterOps.mMinDate |
4508 | || mFilterOps.mMaxDate != U32_MAX | 4478 | || mFilterOps.mMaxDate != mDefaultFilterOps.mMaxDate |
4509 | || mFilterOps.mHoursAgo != 0; | 4479 | || mFilterOps.mHoursAgo != mDefaultFilterOps.mHoursAgo; |
4510 | } | 4480 | } |
4511 | 4481 | ||
4512 | BOOL LLInventoryFilter::isModified() | 4482 | BOOL LLInventoryFilter::isModified() |