From 37b04c150792bb3e53a5ba02c6631aa1d0f8686f Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 21 Dec 2009 14:54:55 -0500 Subject: EXT-3582 : My Outfits populates from library if I delete my last outfit Tracking a "Is this my first time in viewer2.0?" flag and only populating My Outfits folder if it's true. --- indra/newview/llinventorymodel.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 0a8108899a..26a81ab084 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -67,6 +67,7 @@ F32 LLInventoryModel::sMaxTimeBetweenFetches = 10.f; BOOL LLInventoryModel::sTimelyFetchPending = FALSE; LLFrameTimer LLInventoryModel::sFetchTimer; S16 LLInventoryModel::sBulkFetchCount = 0; +BOOL LLInventoryModel::sFirstTimeInViewer2 = TRUE; // Increment this if the inventory contents change in a non-backwards-compatible way. // For viewer 2, the addition of link items makes a pre-viewer-2 cache incorrect. @@ -2614,6 +2615,9 @@ void LLInventoryModel::buildParentChildMap() notifyObservers(); } } + + const BOOL COF_exists = (findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, FALSE) != LLUUID::null); + sFirstTimeInViewer2 = !COF_exists; } struct LLUUIDAndName @@ -3530,6 +3534,19 @@ void LLInventoryModel::setLibraryOwnerID(const LLUUID& val) mLibraryOwnerID = val; } +// static +BOOL LLInventoryModel::getIsFirstTimeInViewer2() +{ + // Do not call this before parentchild map is built. + if (!gInventory.mIsAgentInvUsable) + { + llwarns << "Parent Child Map not yet built; guessing as first time in viewer2." << llendl; + return TRUE; + } + + return sFirstTimeInViewer2; +} + //---------------------------------------------------------------------------- // *NOTE: DEBUG functionality -- cgit v1.2.3 From c26034531a25590e718edc4d7efa41c04aa42731 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 21 Dec 2009 16:49:14 -0500 Subject: EXT-3582 : My Outfits populates from library if I delete my last outfit Autopopulation logic is now smarter and only triggers if this is the first time you're logging into viewer2.0. --- indra/newview/llinventorymodel.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 26a81ab084..96925490cf 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2518,6 +2518,10 @@ void LLInventoryModel::buildParentChildMap() llwarns << "Found " << lost << " lost categories." << llendl; } + const BOOL COF_exists = (findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, FALSE) != LLUUID::null); + sFirstTimeInViewer2 = !COF_exists || gAgent.isFirstLogin(); + + // Now the items. We allocated in the last step, so now all we // have to do is iterate over the items and put them in the right // place. @@ -2615,9 +2619,6 @@ void LLInventoryModel::buildParentChildMap() notifyObservers(); } } - - const BOOL COF_exists = (findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, FALSE) != LLUUID::null); - sFirstTimeInViewer2 = !COF_exists; } struct LLUUIDAndName -- cgit v1.2.3