Skip to content
Snippets Groups Projects
Commit 00fe1b7f authored by Merov Linden's avatar Merov Linden
Browse files

DD-3 : WIP : Add test data to LLMarketplaceData when opening the floater for the first time

parent 00068403
No related branches found
No related tags found
No related merge requests found
...@@ -697,6 +697,10 @@ BOOL LLFloaterMerchantItems::postBuild() ...@@ -697,6 +697,10 @@ BOOL LLFloaterMerchantItems::postBuild()
mCategoryAddedObserver = new LLMerchantItemsAddedObserver(this); mCategoryAddedObserver = new LLMerchantItemsAddedObserver(this);
gInventory.addObserver(mCategoryAddedObserver); 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; return TRUE;
} }
...@@ -737,6 +741,26 @@ void LLFloaterMerchantItems::onOpen(const LLSD& key) ...@@ -737,6 +741,26 @@ void LLFloaterMerchantItems::onOpen(const LLSD& key)
// Trigger fetch of the contents // Trigger fetch of the contents
// //
fetchContents(); 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() void LLFloaterMerchantItems::onFocusReceived()
......
...@@ -629,10 +629,12 @@ bool LLMarketplaceData::setActivation(const LLUUID& folder_id, bool activate) ...@@ -629,10 +629,12 @@ bool LLMarketplaceData::setActivation(const LLUUID& folder_id, bool activate)
// Test methods // Test methods
void LLMarketplaceData::addTestItem(const LLUUID& folder_id) void LLMarketplaceData::addTestItem(const LLUUID& folder_id)
{ {
llinfos << "Merov : addTestItem, id = " << folder_id << llendl;
mMarketplaceItems[folder_id] = LLMarketplaceTuple(folder_id); mMarketplaceItems[folder_id] = LLMarketplaceTuple(folder_id);
} }
void LLMarketplaceData::addTestItem(const LLUUID& folder_id, const LLUUID& version_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); mMarketplaceItems[folder_id] = LLMarketplaceTuple(folder_id);
setVersionFolderID(folder_id, version_id); setVersionFolderID(folder_id, version_id);
} }
......
...@@ -142,6 +142,8 @@ class LLMarketplaceData ...@@ -142,6 +142,8 @@ class LLMarketplaceData
public: public:
LLMarketplaceData(); LLMarketplaceData();
bool isEmpty() { return (mMarketplaceItems.size() == 0); }
// Access Marketplace Data : methods return default value if the folder_id can't be found // Access Marketplace Data : methods return default value if the folder_id can't be found
bool getActivationState(const LLUUID& folder_id); bool getActivationState(const LLUUID& folder_id);
std::string getListingID(const LLUUID& folder_id); std::string getListingID(const LLUUID& folder_id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment