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

DD-289 : WIP : Prevent building tabs twice

parent d1d58fbf
No related branches found
No related tags found
No related merge requests found
...@@ -346,7 +346,7 @@ void LLFloaterMarketplaceListings::fetchContents() ...@@ -346,7 +346,7 @@ void LLFloaterMarketplaceListings::fetchContents()
} }
} }
void LLFloaterMarketplaceListings::setup() void LLFloaterMarketplaceListings::setRootFolder()
{ {
if (LLMarketplaceData::instance().getSLMStatus() != MarketplaceStatusCodes::MARKET_PLACE_MERCHANT) if (LLMarketplaceData::instance().getSLMStatus() != MarketplaceStatusCodes::MARKET_PLACE_MERCHANT)
{ {
...@@ -362,7 +362,7 @@ void LLFloaterMarketplaceListings::setup() ...@@ -362,7 +362,7 @@ void LLFloaterMarketplaceListings::setup()
LL_ERRS("SLM") << "Inventory problem: failure to create the marketplace listings folder for a merchant!" << LL_ENDL; LL_ERRS("SLM") << "Inventory problem: failure to create the marketplace listings folder for a merchant!" << LL_ENDL;
return; return;
} }
// No longer need to observe new category creation // No longer need to observe new category creation
if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver)) if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver))
{ {
...@@ -377,18 +377,27 @@ void LLFloaterMarketplaceListings::setup() ...@@ -377,18 +377,27 @@ void LLFloaterMarketplaceListings::setup()
LL_WARNS("SLM") << "Inventory warning: Marketplace listings folder already set" << LL_ENDL; LL_WARNS("SLM") << "Inventory warning: Marketplace listings folder already set" << LL_ENDL;
return; return;
} }
mRootFolderId = marketplacelistings_id; mRootFolderId = marketplacelistings_id;
}
void LLFloaterMarketplaceListings::setPanels()
{
if (mRootFolderId.isNull())
{
return;
}
// Consolidate Marketplace listings // Consolidate Marketplace listings
// We shouldn't have to do that but with a client/server system relying on a "well known folder" convention, // We shouldn't have to do that but with a client/server system relying on a "well known folder" convention,
// things get messy and conventions get broken down eventually // things get messy and conventions get broken down eventually
gInventory.consolidateForType(marketplacelistings_id, LLFolderType::FT_MARKETPLACE_LISTINGS); gInventory.consolidateForType(mRootFolderId, LLFolderType::FT_MARKETPLACE_LISTINGS);
// Now that we do have a non NULL root, we can build the inventory panels // Now that we do have a non NULL root, we can build the inventory panels
mPanelListings->buildAllPanels(); mPanelListings->buildAllPanels();
// Create observer for marketplace listings modifications // Create observer for marketplace listings modifications
if (!mCategoriesObserver && mRootFolderId.notNull()) if (!mCategoriesObserver)
{ {
mCategoriesObserver = new LLInventoryCategoriesObserver(); mCategoriesObserver = new LLInventoryCategoriesObserver();
llassert(mCategoriesObserver); llassert(mCategoriesObserver);
...@@ -433,7 +442,7 @@ void LLFloaterMarketplaceListings::updateView() ...@@ -433,7 +442,7 @@ void LLFloaterMarketplaceListings::updateView()
// Get or create the root folder if we are a merchant and it hasn't been done already // Get or create the root folder if we are a merchant and it hasn't been done already
if (mRootFolderId.isNull() && (mkt_status == MarketplaceStatusCodes::MARKET_PLACE_MERCHANT)) if (mRootFolderId.isNull() && (mkt_status == MarketplaceStatusCodes::MARKET_PLACE_MERCHANT))
{ {
setup(); setRootFolder();
} }
// Update the bottom initializing status and progress dial // Update the bottom initializing status and progress dial
...@@ -454,9 +463,7 @@ void LLFloaterMarketplaceListings::updateView() ...@@ -454,9 +463,7 @@ void LLFloaterMarketplaceListings::updateView()
if (mFirstViewListings) if (mFirstViewListings)
{ {
// We need to rebuild the tabs cleanly the first time we make them visible // We need to rebuild the tabs cleanly the first time we make them visible
// setup() does it if the root is nixed first setPanels();
mRootFolderId.setNull();
setup();
mFirstViewListings = false; mFirstViewListings = false;
} }
mPanelListings->setVisible(TRUE); mPanelListings->setVisible(TRUE);
......
...@@ -103,7 +103,8 @@ class LLFloaterMarketplaceListings : public LLFloater ...@@ -103,7 +103,8 @@ class LLFloaterMarketplaceListings : public LLFloater
void onMouseLeave(S32 x, S32 y, MASK mask); void onMouseLeave(S32 x, S32 y, MASK mask);
protected: protected:
void setup(); void setRootFolder();
void setPanels();
void fetchContents(); void fetchContents();
void setStatusString(const std::string& statusString); void setStatusString(const std::string& statusString);
......
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