SH-4621 WIP

master
Brad Payne (Vir Linden) 2013-11-15 13:33:31 -05:00
parent 9fe7ec50e0
commit c1f60e7f2f
4 changed files with 38 additions and 4 deletions

View File

@ -38,6 +38,7 @@
#include "llcallingcard.h" // for LLAvatarTracker
#include "llviewerinventory.h"
#include "llinventorymodel.h"
#include "llcallbacklist.h"
// Constants;
@ -154,7 +155,7 @@ void LLInitialFriendCardsFetch::done()
// This observer is no longer needed.
gInventory.removeObserver(this);
mCheckFolderCallback();
doOnIdleOneTime(mCheckFolderCallback);
delete this;
}

View File

@ -1467,6 +1467,19 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent)
// (which is in the process of processing the list of items marked for change).
// This means the change may fail to be processed.
llwarns << "Adding changed mask within notify observers! Change will likely be lost." << llendl;
LLViewerInventoryItem *item = getItem(referent);
if (item)
{
llwarns << "Item " << item->getName() << llendl;
}
else
{
LLViewerInventoryCategory *cat = getCategory(referent);
if (cat)
{
llwarns << "Category " << cat->getName() << llendl;
}
}
}
mModifyMask |= mask;
@ -2344,9 +2357,10 @@ void LLInventoryModel::buildParentChildMap()
// The inv tree is built.
mIsAgentInvUsable = true;
llinfos << "Inventory initialized, notifying observers" << llendl;
addChangedMask(LLInventoryObserver::ALL, LLUUID::null);
notifyObservers();
// notifyObservers() has been moved to
// llstartup/idle_startup() after this func completes.
// Allows some system categories to be created before
// observers start firing.
}
}
@ -2356,6 +2370,14 @@ void LLInventoryModel::buildParentChildMap()
}
}
void LLInventoryModel::createCommonSystemCategories()
{
gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH,true);
gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE,true);
gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD,true);
gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS,true);
}
struct LLUUIDAndName
{
LLUUIDAndName() {}

View File

@ -134,6 +134,8 @@ public:
// during authentication. Returns true if everything parsed.
bool loadSkeleton(const LLSD& options, const LLUUID& owner_id);
void buildParentChildMap(); // brute force method to rebuild the entire parent-child relations
void createCommonSystemCategories();
// Call on logout to save a terse representation.
void cache(const LLUUID& parent_folder_id, const LLUUID& agent_id);
private:

View File

@ -1779,6 +1779,15 @@ bool idle_startup()
// This method MUST be called before gInventory.findCategoryUUIDForType because of
// gInventory.mIsAgentInvUsable is set to true in the gInventory.buildParentChildMap.
gInventory.buildParentChildMap();
gInventory.createCommonSystemCategories();
// It's debatable whether this flag is a good idea - sets all
// bits, and in general it isn't true that inventory
// initialization generates all types of changes. Maybe add an
// INITIALIZE mask bit instead?
gInventory.addChangedMask(LLInventoryObserver::ALL, LLUUID::null);
gInventory.notifyObservers();
display_startup();
//all categories loaded. lets create "My Favorites" category