summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterbuycontents.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterbuycontents.cpp')
-rw-r--r--indra/newview/llfloaterbuycontents.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp
index bca4b5e447..fffd724b22 100644
--- a/indra/newview/llfloaterbuycontents.cpp
+++ b/indra/newview/llfloaterbuycontents.cpp
@@ -80,6 +80,7 @@ BOOL LLFloaterBuyContents::postBuild()
LLFloaterBuyContents::~LLFloaterBuyContents()
{
+ removeVOInventoryListener();
}
@@ -147,23 +148,26 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj,
return;
}
- if (!inv)
+ LLScrollListCtrl* item_list = getChild<LLScrollListCtrl>("item_list");
+ if (!item_list)
{
- llwarns << "No inventory in LLFloaterBuyContents::inventoryChanged"
- << llendl;
removeVOInventoryListener();
return;
}
- LLCtrlListInterface *item_list = childGetListInterface("item_list");
- if (!item_list)
+ item_list->deleteAllItems();
+
+ if (!inv)
{
- removeVOInventoryListener();
+ llwarns << "No inventory in LLFloaterBuyContents::inventoryChanged"
+ << llendl;
+
return;
}
// default to turning off the buy button.
- getChildView("buy_btn")->setEnabled(FALSE);
+ LLView* buy_btn = getChildView("buy_btn");
+ buy_btn->setEnabled(FALSE);
LLUUID owner_id;
BOOL is_group_owned;
@@ -204,7 +208,7 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj,
// There will be at least one item shown in the display, so go
// ahead and enable the buy button.
- getChildView("buy_btn")->setEnabled(TRUE);
+ buy_btn->setEnabled(TRUE);
// Create the line in the list
LLSD row;
@@ -255,8 +259,6 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj,
getChildView("wear_check")->setEnabled(TRUE);
getChild<LLUICtrl>("wear_check")->setValue(LLSD(false) );
}
-
- removeVOInventoryListener();
}