diff options
author | McCabe Maxsted | 2011-05-10 13:39:41 -0700 |
---|---|---|
committer | McCabe Maxsted | 2011-06-08 22:00:52 -0700 |
commit | 0517495bf6caedc08fc7ae45cefc6a1a2cb8fe62 (patch) | |
tree | 0804f0eb3092426b3c3469f2d77f4a0f4b32e8db | |
parent | Committing fix for #0000302: inventory reloads on every login. Needs more tes... (diff) | |
download | meta-impy-0517495bf6caedc08fc7ae45cefc6a1a2cb8fe62.zip meta-impy-0517495bf6caedc08fc7ae45cefc6a1a2cb8fe62.tar.gz meta-impy-0517495bf6caedc08fc7ae45cefc6a1a2cb8fe62.tar.bz2 meta-impy-0517495bf6caedc08fc7ae45cefc6a1a2cb8fe62.tar.xz |
Now that the cache persists, start background fetching on login. We begin with the Animations folder uuid sent in the skeleton to hopefully make the AO work as soon as possible
-rw-r--r-- | linden/indra/newview/llinventorymodel.cpp | 28 | ||||
-rw-r--r-- | linden/indra/newview/llinventorymodel.h | 5 | ||||
-rw-r--r-- | linden/indra/newview/llstartup.cpp | 12 |
3 files changed, 35 insertions, 10 deletions
diff --git a/linden/indra/newview/llinventorymodel.cpp b/linden/indra/newview/llinventorymodel.cpp index 9794dfa..75c5162 100644 --- a/linden/indra/newview/llinventorymodel.cpp +++ b/linden/indra/newview/llinventorymodel.cpp | |||
@@ -192,6 +192,7 @@ LLInventoryModel::LLInventoryModel() : | |||
192 | mCategoryLock(), | 192 | mCategoryLock(), |
193 | mItemLock(), | 193 | mItemLock(), |
194 | mLastItem(NULL), | 194 | mLastItem(NULL), |
195 | mAnimationsFolderUUID(LLUUID::null), | ||
195 | mParentChildCategoryTree(), | 196 | mParentChildCategoryTree(), |
196 | mParentChildItemTree(), | 197 | mParentChildItemTree(), |
197 | mObservers(), | 198 | mObservers(), |
@@ -1945,16 +1946,6 @@ bool LLInventoryModel::loadSkeleton(const LLInventoryModel::options_t& options, | |||
1945 | 1946 | ||
1946 | clean_cat = false; | 1947 | clean_cat = false; |
1947 | 1948 | ||
1948 | skel = (*it).find("name"); | ||
1949 | if (skel == no_response) | ||
1950 | { | ||
1951 | clean_cat = true; | ||
1952 | } | ||
1953 | else | ||
1954 | { | ||
1955 | cat->rename(std::string((*skel).second)); | ||
1956 | } | ||
1957 | |||
1958 | skel = (*it).find("folder_id"); | 1949 | skel = (*it).find("folder_id"); |
1959 | if (skel == no_response) | 1950 | if (skel == no_response) |
1960 | { | 1951 | { |
@@ -1986,6 +1977,16 @@ bool LLInventoryModel::loadSkeleton(const LLInventoryModel::options_t& options, | |||
1986 | cat->setParent(id); | 1977 | cat->setParent(id); |
1987 | } | 1978 | } |
1988 | 1979 | ||
1980 | skel = (*it).find("name"); | ||
1981 | if (skel == no_response) | ||
1982 | { | ||
1983 | clean_cat = true; | ||
1984 | } | ||
1985 | else | ||
1986 | { | ||
1987 | cat->rename(std::string((*skel).second)); | ||
1988 | } | ||
1989 | |||
1989 | skel = (*it).find("type_default"); | 1990 | skel = (*it).find("type_default"); |
1990 | if (skel == no_response) | 1991 | if (skel == no_response) |
1991 | { | 1992 | { |
@@ -1995,6 +1996,13 @@ bool LLInventoryModel::loadSkeleton(const LLInventoryModel::options_t& options, | |||
1995 | { | 1996 | { |
1996 | S32 t = atoi((*skel).second.c_str()); | 1997 | S32 t = atoi((*skel).second.c_str()); |
1997 | preferred_type = (LLAssetType::EType)t; | 1998 | preferred_type = (LLAssetType::EType)t; |
1999 | |||
2000 | // This UUID is different for each avatar and "Animations" is hardcoded into the skeleton -- MC | ||
2001 | if (LLAssetType::AT_ANIMATION == preferred_type && cat->getName() == "Animations") | ||
2002 | { | ||
2003 | //llinfos << "Animations folder uuid from skeleton: " << cat->getUUID() << llendl; | ||
2004 | mAnimationsFolderUUID = id; | ||
2005 | } | ||
1998 | } | 2006 | } |
1999 | cat->setPreferredType(preferred_type); | 2007 | cat->setPreferredType(preferred_type); |
2000 | 2008 | ||
diff --git a/linden/indra/newview/llinventorymodel.h b/linden/indra/newview/llinventorymodel.h index fee509b..7222c60 100644 --- a/linden/indra/newview/llinventorymodel.h +++ b/linden/indra/newview/llinventorymodel.h | |||
@@ -452,6 +452,9 @@ protected: | |||
452 | // cache recent lookups | 452 | // cache recent lookups |
453 | mutable LLPointer<LLViewerInventoryItem> mLastItem; | 453 | mutable LLPointer<LLViewerInventoryItem> mLastItem; |
454 | 454 | ||
455 | // UUID of the 'Animations' folder in 'My Inventory' | ||
456 | LLUUID mAnimationsFolderUUID; | ||
457 | |||
455 | // This last set of indices is used to map parents to children. | 458 | // This last set of indices is used to map parents to children. |
456 | typedef std::map<LLUUID, cat_array_t*> parent_cat_map_t; | 459 | typedef std::map<LLUUID, cat_array_t*> parent_cat_map_t; |
457 | typedef std::map<LLUUID, item_array_t*> parent_item_map_t; | 460 | typedef std::map<LLUUID, item_array_t*> parent_item_map_t; |
@@ -474,6 +477,8 @@ protected: | |||
474 | bool mIsAgentInvUsable; | 477 | bool mIsAgentInvUsable; |
475 | 478 | ||
476 | public: | 479 | public: |
480 | // Returns the UUID of the 'Animations' folder in 'My Inventory' sent from the server at startup | ||
481 | LLUUID getAnimationsFolderUUID() const { return mAnimationsFolderUUID; } | ||
477 | // *NOTE: DEBUG functionality | 482 | // *NOTE: DEBUG functionality |
478 | void dumpInventory(); | 483 | void dumpInventory(); |
479 | static bool isBulkFetchProcessingComplete(); | 484 | static bool isBulkFetchProcessingComplete(); |
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 083a082..a2ed9fc 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp | |||
@@ -2450,6 +2450,18 @@ bool idle_startup() | |||
2450 | } | 2450 | } |
2451 | } | 2451 | } |
2452 | 2452 | ||
2453 | // start background fetching for animations here in case the cache is empty. | ||
2454 | // We do this to improve AO support (that's Animatoni Overrider, not LL's | ||
2455 | // silly "AO" acronym -- MC | ||
2456 | if (gInventory.getAnimationsFolderUUID() != LLUUID::null) | ||
2457 | { | ||
2458 | gInventory.startBackgroundFetch(gInventory.getAnimationsFolderUUID()); | ||
2459 | } | ||
2460 | else | ||
2461 | { | ||
2462 | gInventory.startBackgroundFetch(); | ||
2463 | } | ||
2464 | |||
2453 | options.clear(); | 2465 | options.clear(); |
2454 | if(LLUserAuth::getInstance()->getOptions("buddy-list", options)) | 2466 | if(LLUserAuth::getInstance()->getOptions("buddy-list", options)) |
2455 | { | 2467 | { |