summaryrefslogtreecommitdiff
path: root/indra/newview/llfolderviewitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfolderviewitem.cpp')
-rw-r--r--indra/newview/llfolderviewitem.cpp96
1 files changed, 4 insertions, 92 deletions
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 80893c3037..e84c765ac8 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -28,16 +28,9 @@
#include "llfolderviewitem.h"
// viewer includes
-#include "llfolderview.h" // Items depend extensively on LLFolderViews
#include "llfolderview.h"
#include "llfolderviewmodel.h"
-#include "llviewerfoldertype.h"
-#include "llinventorybridge.h" // for LLItemBridge in LLInventorySort::operator()
-#include "llinventoryfunctions.h"
-#include "llinventorymodelbackgroundfetch.h"
#include "llpanel.h"
-#include "llviewercontrol.h" // gSavedSettings
-#include "llviewerwindow.h" // Argh, only for setCursor()
// linden library includes
#include "llclipboard.h"
@@ -529,11 +522,11 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask )
if (can_drag)
{
- gViewerWindow->setCursor(UI_CURSOR_ARROW);
+ getWindow()->setCursor(UI_CURSOR_ARROW);
}
else
{
- gViewerWindow->setCursor(UI_CURSOR_NOLOCKED);
+ getWindow()->setCursor(UI_CURSOR_NOLOCKED);
}
return TRUE;
}
@@ -541,9 +534,9 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask )
{
if (getRoot())
{
- getRoot()->setShowSelectionContext(FALSE);
+ getRoot()->setShowSelectionContext(FALSE);
}
- gViewerWindow->setCursor(UI_CURSOR_ARROW);
+ getWindow()->setCursor(UI_CURSOR_ARROW);
// let parent handle this then...
return FALSE;
}
@@ -2075,84 +2068,3 @@ LLFolderViewItem* LLFolderViewFolder::getPreviousFromChild( LLFolderViewItem* it
return result;
}
-bool LLInventorySort::operator()(const LLFolderViewModelItemInventory* const& a, const LLFolderViewModelItemInventory* const& b) const
-{
- // ignore sort order for landmarks in the Favorites folder.
- // they should be always sorted as in Favorites bar. See EXT-719
- //TODO RN: fix sorting in favorites folder
- //if (a->getSortGroup() == SG_ITEM
- // && b->getSortGroup() == SG_ITEM
- // && a->getInventoryType() == LLInventoryType::IT_LANDMARK
- // && b->getInventoryType() == LLInventoryType::IT_LANDMARK)
- //{
-
- // static const LLUUID& favorites_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
-
- // LLUUID a_uuid = a->getParentFolder()->getUUID();
- // LLUUID b_uuid = b->getParentFolder()->getUUID();
-
- // if ((a_uuid == favorites_folder_id && b_uuid == favorites_folder_id))
- // {
- // // *TODO: mantipov: probably it is better to add an appropriate method to LLFolderViewItem
- // // or to LLInvFVBridge
- // LLViewerInventoryItem* aitem = (static_cast<const LLItemBridge*>(a))->getItem();
- // LLViewerInventoryItem* bitem = (static_cast<const LLItemBridge*>(b))->getItem();
- // if (!aitem || !bitem)
- // return false;
- // S32 a_sort = aitem->getSortField();
- // S32 b_sort = bitem->getSortField();
- // return a_sort < b_sort;
- // }
- //}
-
- // We sort by name if we aren't sorting by date
- // OR if these are folders and we are sorting folders by name.
- bool by_name = (!mByDate
- || (mFoldersByName
- && (a->getSortGroup() != SG_ITEM)));
-
- if (a->getSortGroup() != b->getSortGroup())
- {
- if (mSystemToTop)
- {
- // Group order is System Folders, Trash, Normal Folders, Items
- return (a->getSortGroup() < b->getSortGroup());
- }
- else if (mByDate)
- {
- // Trash needs to go to the bottom if we are sorting by date
- if ( (a->getSortGroup() == SG_TRASH_FOLDER)
- || (b->getSortGroup() == SG_TRASH_FOLDER))
- {
- return (b->getSortGroup() == SG_TRASH_FOLDER);
- }
- }
- }
-
- if (by_name)
- {
- S32 compare = LLStringUtil::compareDict(a->getDisplayName(), b->getDisplayName());
- if (0 == compare)
- {
- return (a->getCreationDate() > b->getCreationDate());
- }
- else
- {
- return (compare < 0);
- }
- }
- else
- {
- time_t first_create = a->getCreationDate();
- time_t second_create = b->getCreationDate();
- if (first_create == second_create)
- {
- return (LLStringUtil::compareDict(a->getDisplayName(), b->getDisplayName()) < 0);
- }
- else
- {
- return (first_create > second_create);
- }
- }
-}
-