diff options
author | Merov Linden <merov@lindenlab.com> | 2014-03-10 11:44:40 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-03-10 11:44:40 -0700 |
commit | 00fe1b7fbe605ddcb6fb56e0a3d20b1208fbd5fd (patch) | |
tree | c94569a0e96ce6872b1ad71a17c89b20204f11e6 | |
parent | 0006840325fd88aea3c7514ca5d93f42659e4037 (diff) |
DD-3 : WIP : Add test data to LLMarketplaceData when opening the floater for the first time
-rwxr-xr-x | indra/newview/llfloateroutbox.cpp | 24 | ||||
-rwxr-xr-x | indra/newview/llmarketplacefunctions.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/llmarketplacefunctions.h | 2 |
3 files changed, 28 insertions, 0 deletions
diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index c5ece0ccd6..86387c548a 100755 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -697,6 +697,10 @@ BOOL LLFloaterMerchantItems::postBuild() mCategoryAddedObserver = new LLMerchantItemsAddedObserver(this); gInventory.addObserver(mCategoryAddedObserver); + // Merov : Debug : fetch aggressively so we can create test data right onOpen() + llinfos << "Merov : postBuild, do fetchContent() ahead of time" << llendl; + fetchContents(); + return TRUE; } @@ -737,6 +741,26 @@ void LLFloaterMerchantItems::onOpen(const LLSD& key) // Trigger fetch of the contents // fetchContents(); + + // Merov : Debug : Create fake Marketplace data if none is present + if (LLMarketplaceData::instance().isEmpty() && (getFolderCount() > 0)) + { + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + gInventory.getDirectDescendentsOf(mRootFolderId, cats, items); + + int index = 0; + for (LLInventoryModel::cat_array_t::iterator iter = cats->begin(); iter != cats->end(); iter++, index++) + { + LLViewerInventoryCategory* category = *iter; + LLMarketplaceData::instance().addTestItem(category->getUUID()); + if (index%2) + { + LLMarketplaceData::instance().setListingID(category->getUUID(),"TestingID1234"); + } + LLMarketplaceData::instance().setActivation(category->getUUID(),(index%3 == 0)); + } + } } void LLFloaterMerchantItems::onFocusReceived() diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index d231202f40..b39889c721 100755 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -629,10 +629,12 @@ bool LLMarketplaceData::setActivation(const LLUUID& folder_id, bool activate) // Test methods void LLMarketplaceData::addTestItem(const LLUUID& folder_id) { + llinfos << "Merov : addTestItem, id = " << folder_id << llendl; mMarketplaceItems[folder_id] = LLMarketplaceTuple(folder_id); } void LLMarketplaceData::addTestItem(const LLUUID& folder_id, const LLUUID& version_id) { + llinfos << "Merov : addTestItem, id = " << folder_id << ", version = " << version_id << llendl; mMarketplaceItems[folder_id] = LLMarketplaceTuple(folder_id); setVersionFolderID(folder_id, version_id); } diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h index c3cde740a2..c86df08476 100755 --- a/indra/newview/llmarketplacefunctions.h +++ b/indra/newview/llmarketplacefunctions.h @@ -142,6 +142,8 @@ class LLMarketplaceData public: LLMarketplaceData(); + bool isEmpty() { return (mMarketplaceItems.size() == 0); } + // Access Marketplace Data : methods return default value if the folder_id can't be found bool getActivationState(const LLUUID& folder_id); std::string getListingID(const LLUUID& folder_id); |