diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-11-15 13:33:31 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-11-15 13:33:31 -0500 |
commit | c1f60e7f2fe1775d8ca5f79af23579ac8a1fd851 (patch) | |
tree | fbb062f2da95973aa6a7fbcdf5372fc7097aad5c | |
parent | 9fe7ec50e0cf4d743b05e335ee27d6fb7fbe37b7 (diff) |
SH-4621 WIP
-rwxr-xr-x | indra/newview/llfriendcard.cpp | 3 | ||||
-rwxr-xr-x | indra/newview/llinventorymodel.cpp | 28 | ||||
-rwxr-xr-x | indra/newview/llinventorymodel.h | 2 | ||||
-rwxr-xr-x | indra/newview/llstartup.cpp | 9 |
4 files changed, 38 insertions, 4 deletions
diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index a6be604222..01f70d4b57 100755 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -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; } diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 1ad70492ca..3dbc1ae288 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -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() {} diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 779319fa67..ab8bbac6d8 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -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: diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d440ba246a..9f0abd858e 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -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 |