More stuff migrated to llinventoryfunctions.cpp
This commit is contained in:
@@ -446,6 +446,7 @@ set(viewer_SOURCE_FILES
|
||||
llviewercamera.cpp
|
||||
llviewercontrol.cpp
|
||||
llviewerdisplay.cpp
|
||||
llviewerfoldertype.cpp
|
||||
llviewergenericmessage.cpp
|
||||
llviewergesture.cpp
|
||||
#llviewerimage.cpp
|
||||
@@ -735,6 +736,7 @@ set(viewer_HEADER_FILES
|
||||
llfloaterwindlight.h
|
||||
llfloaterworldmap.h
|
||||
llfolderview.h
|
||||
llfoldervieweventlistener.h
|
||||
llfollowcam.h
|
||||
llframestats.h
|
||||
llframestatview.h
|
||||
@@ -923,6 +925,7 @@ set(viewer_HEADER_FILES
|
||||
llviewercamera.h
|
||||
llviewercontrol.h
|
||||
llviewerdisplay.h
|
||||
llviewerfoldertype.h
|
||||
llviewergenericmessage.h
|
||||
llviewergesture.h
|
||||
#llviewerimage.h
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "llfoldervieweventlistener.h"
|
||||
#include "llinventoryclipboard.h" // *TODO: remove this once hack below gone.
|
||||
#include "llinventoryview.h"// hacked in for the bonus context menu items.
|
||||
#include "llinventoryfunctions.h"
|
||||
#include "llkeyboard.h"
|
||||
#include "lllineeditor.h"
|
||||
#include "llmenugl.h"
|
||||
|
||||
@@ -70,6 +70,7 @@ class LLMenuGL;
|
||||
class LLFolderViewItem;
|
||||
class LLFolderView;
|
||||
class LLInventoryModel;
|
||||
class LLFolderViewFunctor;
|
||||
class LLScrollableContainerView;
|
||||
class LLFolderViewEventListener;
|
||||
|
||||
@@ -100,13 +101,6 @@ public:
|
||||
class LLFolderViewItem;
|
||||
class LLFolderViewFolder;
|
||||
|
||||
class LLFolderViewFunctor
|
||||
{
|
||||
public:
|
||||
virtual ~LLFolderViewFunctor() {}
|
||||
virtual void doFolder(LLFolderViewFolder* folder) = 0;
|
||||
virtual void doItem(LLFolderViewItem* item) = 0;
|
||||
};
|
||||
|
||||
class LLInventoryFilter
|
||||
{
|
||||
|
||||
@@ -1883,29 +1883,6 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
|
||||
return accept;
|
||||
}
|
||||
|
||||
class LLFindWearables : public LLInventoryCollectFunctor
|
||||
{
|
||||
public:
|
||||
LLFindWearables() {}
|
||||
virtual ~LLFindWearables() {}
|
||||
virtual bool operator()(LLInventoryCategory* cat,
|
||||
LLInventoryItem* item);
|
||||
};
|
||||
|
||||
bool LLFindWearables::operator()(LLInventoryCategory* cat,
|
||||
LLInventoryItem* item)
|
||||
{
|
||||
if(item)
|
||||
{
|
||||
if((item->getType() == LLAssetType::AT_CLOTHING)
|
||||
|| (item->getType() == LLAssetType::AT_BODYPART))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//Used by LLFolderBridge as callback for directory recursion.
|
||||
class LLRightClickInventoryFetchObserver : public LLInventoryFetchObserver
|
||||
{
|
||||
|
||||
@@ -159,6 +159,38 @@ void change_category_parent(LLInventoryModel* model,
|
||||
model->notifyObservers();
|
||||
}
|
||||
|
||||
/*void remove_category(LLInventoryModel* model, const LLUUID& cat_id)
|
||||
{
|
||||
if (!model || !get_is_category_removable(model, cat_id))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Look for any gestures and deactivate them
|
||||
LLInventoryModel::cat_array_t descendent_categories;
|
||||
LLInventoryModel::item_array_t descendent_items;
|
||||
gInventory.collectDescendents(cat_id, descendent_categories, descendent_items, FALSE);
|
||||
|
||||
for (LLInventoryModel::item_array_t::const_iterator iter = descendent_items.begin();
|
||||
iter != descendent_items.end();
|
||||
++iter)
|
||||
{
|
||||
const LLViewerInventoryItem* item = (*iter);
|
||||
const LLUUID& item_id = item->getUUID();
|
||||
if (item->getType() == LLAssetType::AT_GESTURE
|
||||
&& LLGestureMgr::instance().isGestureActive(item_id))
|
||||
{
|
||||
LLGestureMgr::instance().deactivateGesture(item_id);
|
||||
}
|
||||
}
|
||||
|
||||
LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
|
||||
if (cat)
|
||||
{
|
||||
const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
change_category_parent(model, cat, trash_id, TRUE);
|
||||
}
|
||||
}*/
|
||||
|
||||
void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name)
|
||||
{
|
||||
@@ -370,6 +402,50 @@ BOOL get_is_item_removable(const LLInventoryModel* model, const LLUUID& id)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id)
|
||||
{
|
||||
// NOTE: This function doesn't check the folder's children.
|
||||
// See LLFolderBridge::isItemRemovable for a function that does
|
||||
// consider the children.
|
||||
|
||||
if (!model)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!model->isObjectDescendentOf(id, gInventory.getRootFolderID()))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!isAgentAvatarValid()) return FALSE;
|
||||
|
||||
const LLInventoryCategory* category = model->getCategory(id);
|
||||
if (!category)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
const LLFolderType::EType folder_type = category->getPreferredType();
|
||||
|
||||
if (LLFolderType::lookupIsProtectedType(folder_type))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Can't delete the outfit that is currently being worn.
|
||||
if (folder_type == LLFolderType::FT_OUTFIT)
|
||||
{
|
||||
const LLViewerInventoryItem *base_outfit_link = LLAppearanceMgr::instance().getBaseOutfitLink();
|
||||
if (base_outfit_link && (category == base_outfit_link->getLinkedCategory()))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}*/
|
||||
|
||||
BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id)
|
||||
{
|
||||
if (!model)
|
||||
@@ -536,6 +612,21 @@ bool LLNameCategoryCollector::operator()(
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LLFindWearables::operator()(LLInventoryCategory* cat,
|
||||
LLInventoryItem* item)
|
||||
{
|
||||
if(item)
|
||||
{
|
||||
if((item->getType() == LLAssetType::AT_CLOTHING)
|
||||
|| (item->getType() == LLAssetType::AT_BODYPART))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
/// LLAssetIDMatches
|
||||
///----------------------------------------------------------------------------
|
||||
@@ -552,4 +643,112 @@ bool LLLinkedItemIDMatches::operator()(LLInventoryCategory* cat, LLInventoryItem
|
||||
return (item &&
|
||||
(item->getIsLinkType()) &&
|
||||
(item->getLinkedUUID() == mBaseItemID)); // A linked item's assetID will be the compared-to item's itemID.
|
||||
}
|
||||
}
|
||||
|
||||
void LLSaveFolderState::setApply(BOOL apply)
|
||||
{
|
||||
mApply = apply;
|
||||
// before generating new list of open folders, clear the old one
|
||||
if(!apply)
|
||||
{
|
||||
clearOpenFolders();
|
||||
}
|
||||
}
|
||||
|
||||
void LLSaveFolderState::doFolder(LLFolderViewFolder* folder)
|
||||
{
|
||||
if(mApply)
|
||||
{
|
||||
// we're applying the open state
|
||||
LLInvFVBridge* bridge = (LLInvFVBridge*)folder->getListener();
|
||||
if(!bridge) return;
|
||||
LLUUID id(bridge->getUUID());
|
||||
if(mOpenFolders.find(id) != mOpenFolders.end())
|
||||
{
|
||||
folder->setOpen(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// keep selected filter in its current state, this is less jarring to user
|
||||
if (!folder->isSelected())
|
||||
{
|
||||
folder->setOpen(FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// we're recording state at this point
|
||||
if(folder->isOpen())
|
||||
{
|
||||
LLInvFVBridge* bridge = (LLInvFVBridge*)folder->getListener();
|
||||
if(!bridge) return;
|
||||
mOpenFolders.insert(bridge->getUUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLOpenFilteredFolders::doItem(LLFolderViewItem *item)
|
||||
{
|
||||
if (item->getFiltered())
|
||||
{
|
||||
item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||
}
|
||||
}
|
||||
|
||||
void LLOpenFilteredFolders::doFolder(LLFolderViewFolder* folder)
|
||||
{
|
||||
if (folder->getFiltered() && folder->getParentFolder())
|
||||
{
|
||||
folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||
}
|
||||
// if this folder didn't pass the filter, and none of its descendants did
|
||||
else if (!folder->getFiltered() && !folder->hasFilteredDescendants())
|
||||
{
|
||||
folder->setOpenArrangeRecursively(FALSE, LLFolderViewFolder::RECURSE_NO);
|
||||
}
|
||||
}
|
||||
|
||||
void LLSelectFirstFilteredItem::doItem(LLFolderViewItem *item)
|
||||
{
|
||||
if (item->getFiltered() && !mItemSelected)
|
||||
{
|
||||
item->getRoot()->setSelection(item, FALSE, FALSE);
|
||||
if (item->getParentFolder())
|
||||
{
|
||||
item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||
}
|
||||
item->getRoot()->scrollToShowSelection();
|
||||
mItemSelected = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void LLSelectFirstFilteredItem::doFolder(LLFolderViewFolder* folder)
|
||||
{
|
||||
if (folder->getFiltered() && !mItemSelected)
|
||||
{
|
||||
folder->getRoot()->setSelection(folder, FALSE, FALSE);
|
||||
if (folder->getParentFolder())
|
||||
{
|
||||
folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||
}
|
||||
folder->getRoot()->scrollToShowSelection();
|
||||
mItemSelected = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void LLOpenFoldersWithSelection::doItem(LLFolderViewItem *item)
|
||||
{
|
||||
if (item->getParentFolder() && item->isSelected())
|
||||
{
|
||||
item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||
}
|
||||
}
|
||||
|
||||
void LLOpenFoldersWithSelection::doFolder(LLFolderViewFolder* folder)
|
||||
{
|
||||
if (folder->getParentFolder() && folder->isSelected())
|
||||
{
|
||||
folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,6 +62,8 @@ void change_category_parent(LLInventoryModel* model,
|
||||
LLViewerInventoryCategory* cat,
|
||||
const LLUUID& new_parent_id,
|
||||
BOOL restamp);
|
||||
|
||||
void remove_category(LLInventoryModel* model, const LLUUID& cat_id);
|
||||
void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name);
|
||||
|
||||
// Generates a string containing the path to the item specified by item_id.
|
||||
@@ -259,6 +261,42 @@ public:
|
||||
protected:
|
||||
std::string mName;
|
||||
};
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLFindWearables
|
||||
//
|
||||
// Collects wearables based on item type.
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
class LLFindWearables : public LLInventoryCollectFunctor
|
||||
{
|
||||
public:
|
||||
LLFindWearables() {}
|
||||
virtual ~LLFindWearables() {}
|
||||
virtual bool operator()(LLInventoryCategory* cat,
|
||||
LLInventoryItem* item);
|
||||
};
|
||||
|
||||
/** Inventory Collector Functions
|
||||
** **
|
||||
*******************************************************************************/
|
||||
class LLFolderViewItem;
|
||||
class LLFolderViewFolder;
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLFolderViewFunctor
|
||||
//
|
||||
// Simple abstract base class for applying a functor to folders and
|
||||
// items in a folder view hierarchy. This is suboptimal for algorithms
|
||||
// that only work folders or only work on items, but I'll worry about
|
||||
// that later when it's determined to be too slow.
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
class LLFolderViewFunctor
|
||||
{
|
||||
public:
|
||||
virtual ~LLFolderViewFunctor() {}
|
||||
virtual void doFolder(LLFolderViewFolder* folder) = 0;
|
||||
virtual void doItem(LLFolderViewItem* item) = 0;
|
||||
};
|
||||
|
||||
class LLInventoryState
|
||||
{
|
||||
public:
|
||||
@@ -267,6 +305,49 @@ public:
|
||||
static LLUUID sWearNewClothingTransactionID; // wear all clothing in this transaction
|
||||
};
|
||||
|
||||
class LLSelectFirstFilteredItem : public LLFolderViewFunctor
|
||||
{
|
||||
public:
|
||||
LLSelectFirstFilteredItem() : mItemSelected(FALSE) {}
|
||||
virtual ~LLSelectFirstFilteredItem() {}
|
||||
virtual void doFolder(LLFolderViewFolder* folder);
|
||||
virtual void doItem(LLFolderViewItem* item);
|
||||
BOOL wasItemSelected() { return mItemSelected; }
|
||||
protected:
|
||||
BOOL mItemSelected;
|
||||
};
|
||||
|
||||
class LLOpenFilteredFolders : public LLFolderViewFunctor
|
||||
{
|
||||
public:
|
||||
LLOpenFilteredFolders() {}
|
||||
virtual ~LLOpenFilteredFolders() {}
|
||||
virtual void doFolder(LLFolderViewFolder* folder);
|
||||
virtual void doItem(LLFolderViewItem* item);
|
||||
};
|
||||
|
||||
class LLSaveFolderState : public LLFolderViewFunctor
|
||||
{
|
||||
public:
|
||||
LLSaveFolderState() : mApply(FALSE) {}
|
||||
virtual ~LLSaveFolderState() {}
|
||||
virtual void doFolder(LLFolderViewFolder* folder);
|
||||
virtual void doItem(LLFolderViewItem* item) {}
|
||||
void setApply(BOOL apply);
|
||||
void clearOpenFolders() { mOpenFolders.clear(); }
|
||||
protected:
|
||||
std::set<LLUUID> mOpenFolders;
|
||||
BOOL mApply;
|
||||
};
|
||||
|
||||
class LLOpenFoldersWithSelection : public LLFolderViewFunctor
|
||||
{
|
||||
public:
|
||||
LLOpenFoldersWithSelection() {}
|
||||
virtual ~LLOpenFoldersWithSelection() {}
|
||||
virtual void doFolder(LLFolderViewFolder* folder);
|
||||
virtual void doItem(LLFolderViewItem* item);
|
||||
};
|
||||
|
||||
#endif // LL_LLINVENTORYFUNCTIONS_H
|
||||
|
||||
|
||||
@@ -413,49 +413,6 @@ void LLInventoryViewFinder::selectNoTypes(void* user_data)
|
||||
///----------------------------------------------------------------------------
|
||||
/// LLInventoryView
|
||||
///----------------------------------------------------------------------------
|
||||
void LLSaveFolderState::setApply(BOOL apply)
|
||||
{
|
||||
mApply = apply;
|
||||
// before generating new list of open folders, clear the old one
|
||||
if(!apply)
|
||||
{
|
||||
clearOpenFolders();
|
||||
}
|
||||
}
|
||||
|
||||
void LLSaveFolderState::doFolder(LLFolderViewFolder* folder)
|
||||
{
|
||||
if(mApply)
|
||||
{
|
||||
// we're applying the open state
|
||||
LLInvFVBridge* bridge = (LLInvFVBridge*)folder->getListener();
|
||||
if(!bridge) return;
|
||||
LLUUID id(bridge->getUUID());
|
||||
if(mOpenFolders.find(id) != mOpenFolders.end())
|
||||
{
|
||||
folder->setOpen(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// keep selected filter in its current state, this is less jarring to user
|
||||
if (!folder->isSelected())
|
||||
{
|
||||
folder->setOpen(FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// we're recording state at this point
|
||||
if(folder->isOpen())
|
||||
{
|
||||
LLInvFVBridge* bridge = (LLInvFVBridge*)folder->getListener();
|
||||
if(!bridge) return;
|
||||
mOpenFolders.insert(bridge->getUUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Default constructor
|
||||
LLInventoryView::LLInventoryView(const std::string& name,
|
||||
const std::string& rect,
|
||||
@@ -667,71 +624,6 @@ void LLInventoryView::draw()
|
||||
LLFloater::draw();
|
||||
}
|
||||
|
||||
void LLOpenFilteredFolders::doItem(LLFolderViewItem *item)
|
||||
{
|
||||
if (item->getFiltered())
|
||||
{
|
||||
item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||
}
|
||||
}
|
||||
|
||||
void LLOpenFilteredFolders::doFolder(LLFolderViewFolder* folder)
|
||||
{
|
||||
if (folder->getFiltered() && folder->getParentFolder())
|
||||
{
|
||||
folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||
}
|
||||
// if this folder didn't pass the filter, and none of its descendants did
|
||||
else if (!folder->getFiltered() && !folder->hasFilteredDescendants())
|
||||
{
|
||||
folder->setOpenArrangeRecursively(FALSE, LLFolderViewFolder::RECURSE_NO);
|
||||
}
|
||||
}
|
||||
|
||||
void LLSelectFirstFilteredItem::doItem(LLFolderViewItem *item)
|
||||
{
|
||||
if (item->getFiltered() && !mItemSelected)
|
||||
{
|
||||
item->getRoot()->setSelection(item, FALSE, FALSE);
|
||||
if (item->getParentFolder())
|
||||
{
|
||||
item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||
}
|
||||
item->getRoot()->scrollToShowSelection();
|
||||
mItemSelected = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void LLSelectFirstFilteredItem::doFolder(LLFolderViewFolder* folder)
|
||||
{
|
||||
if (folder->getFiltered() && !mItemSelected)
|
||||
{
|
||||
folder->getRoot()->setSelection(folder, FALSE, FALSE);
|
||||
if (folder->getParentFolder())
|
||||
{
|
||||
folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||
}
|
||||
folder->getRoot()->scrollToShowSelection();
|
||||
mItemSelected = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void LLOpenFoldersWithSelection::doItem(LLFolderViewItem *item)
|
||||
{
|
||||
if (item->getParentFolder() && item->isSelected())
|
||||
{
|
||||
item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||
}
|
||||
}
|
||||
|
||||
void LLOpenFoldersWithSelection::doFolder(LLFolderViewFolder* folder)
|
||||
{
|
||||
if (folder->getParentFolder() && folder->isSelected())
|
||||
{
|
||||
folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||
}
|
||||
}
|
||||
|
||||
void LLInventoryView::startSearch()
|
||||
{
|
||||
// this forces focus to line editor portion of search editor
|
||||
|
||||
@@ -318,50 +318,6 @@ protected:
|
||||
static LLDynamicArray<LLInventoryView*> sActiveViews;
|
||||
};
|
||||
|
||||
class LLSelectFirstFilteredItem : public LLFolderViewFunctor
|
||||
{
|
||||
public:
|
||||
LLSelectFirstFilteredItem() : mItemSelected(FALSE) {}
|
||||
virtual ~LLSelectFirstFilteredItem() {}
|
||||
virtual void doFolder(LLFolderViewFolder* folder);
|
||||
virtual void doItem(LLFolderViewItem* item);
|
||||
BOOL wasItemSelected() { return mItemSelected; }
|
||||
protected:
|
||||
BOOL mItemSelected;
|
||||
};
|
||||
|
||||
class LLOpenFilteredFolders : public LLFolderViewFunctor
|
||||
{
|
||||
public:
|
||||
LLOpenFilteredFolders() {}
|
||||
virtual ~LLOpenFilteredFolders() {}
|
||||
virtual void doFolder(LLFolderViewFolder* folder);
|
||||
virtual void doItem(LLFolderViewItem* item);
|
||||
};
|
||||
|
||||
class LLSaveFolderState : public LLFolderViewFunctor
|
||||
{
|
||||
public:
|
||||
LLSaveFolderState() : mApply(FALSE) {}
|
||||
virtual ~LLSaveFolderState() {}
|
||||
virtual void doFolder(LLFolderViewFolder* folder);
|
||||
virtual void doItem(LLFolderViewItem* item) {}
|
||||
void setApply(BOOL apply);
|
||||
void clearOpenFolders() { mOpenFolders.clear(); }
|
||||
protected:
|
||||
std::set<LLUUID> mOpenFolders;
|
||||
BOOL mApply;
|
||||
};
|
||||
|
||||
class LLOpenFoldersWithSelection : public LLFolderViewFunctor
|
||||
{
|
||||
public:
|
||||
LLOpenFoldersWithSelection() {}
|
||||
virtual ~LLOpenFoldersWithSelection() {}
|
||||
virtual void doFolder(LLFolderViewFolder* folder);
|
||||
virtual void doItem(LLFolderViewItem* item);
|
||||
};
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
/// Function declarations, constants, enums, and typedefs
|
||||
///----------------------------------------------------------------------------
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "llagent.h"
|
||||
#include "llcallbacklist.h"
|
||||
#include "llstartup.h"
|
||||
#include "llviewerfoldertype.h"
|
||||
#include "llviewerobject.h"
|
||||
#include "llvoavatar.h"
|
||||
|
||||
@@ -29,9 +30,6 @@
|
||||
|
||||
#include "boost/algorithm/string.hpp"
|
||||
|
||||
// Only defined in llinventorymodel.cpp
|
||||
extern const char* NEW_CATEGORY_NAME;
|
||||
|
||||
// ============================================================================
|
||||
// Static variable initialization
|
||||
//
|
||||
@@ -394,6 +392,7 @@ void RlvRenameOnWearObserver::doneIdle()
|
||||
continue;
|
||||
}
|
||||
|
||||
static const std::string &new_category_name = LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_NONE);
|
||||
for (S32 idxItem = 0, cntItem = items.count(); idxItem < cntItem; idxItem++)
|
||||
{
|
||||
LLViewerInventoryItem* pItem = items.get(idxItem);
|
||||
@@ -428,7 +427,7 @@ void RlvRenameOnWearObserver::doneIdle()
|
||||
std::string strFolderName = ".(" + strAttachPt + ")";
|
||||
|
||||
// Rename the item's parent folder if it's called "New Folder", isn't directly under #RLV and contains exactly 1 object
|
||||
if ( (NEW_CATEGORY_NAME == pFolder->getName()) &&
|
||||
if ( (new_category_name == pFolder->getName()) &&
|
||||
(pFolder->getParentUUID() != pRlvRoot->getUUID()) &&
|
||||
(1 == RlvInventory::getDirectDescendentsCount(pFolder, LLAssetType::AT_OBJECT)) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user