MAINT-3320 : WIP : Introduced a cleanOutbox() method to be called on outbox deletion

master
Merov Linden 2013-11-13 13:29:51 -08:00
parent e6b4b89bf1
commit 148c3780e1
3 changed files with 40 additions and 5 deletions

View File

@ -163,6 +163,38 @@ BOOL LLFloaterOutbox::postBuild()
return TRUE;
}
void LLFloaterOutbox::cleanOutbox()
{
/*
// Create a new category creation observer
if (mCategoryAddedObserver == NULL)
{
mCategoryAddedObserver = new LLOutboxAddedObserver(this);
gInventory.addObserver(mCategoryAddedObserver);
}
llassert(mCategoryAddedObserver);
// Delete the observer for outbox modifications
if (mCategoriesObserver)
{
gInventory.removeObserver(mCategoriesObserver);
delete mCategoriesObserver;
mCategoriesObserver = NULL;
}
llassert(!mCategoriesObserver);
*/
// Clear the outbox data
mOutboxId.setNull();
mOutboxItemCount = 0;
// Note: we cannot delete the mOutboxInventoryPanel as that point
// as this is called through callback observers of the panel itself.
// Doing so crashes rapidly.
llinfos << "Merov : cleanOutbox!" << llendl;
}
void LLFloaterOutbox::onClose(bool app_quitting)
{
if (mWindowShade)
@ -303,7 +335,7 @@ void LLFloaterOutbox::setStatusString(const std::string& statusString)
void LLFloaterOutbox::updateFolderCount()
{
if (mOutboxInventoryPanel.get())
if (mOutboxInventoryPanel.get() && mOutboxId.notNull())
{
S32 item_count = 0;
@ -332,7 +364,7 @@ void LLFloaterOutbox::updateFolderCount()
void LLFloaterOutbox::updateFolderCountStatus()
{
if (mOutboxInventoryPanel.get())
if (mOutboxInventoryPanel.get() && mOutboxId.notNull())
{
switch (mOutboxItemCount)
{
@ -445,7 +477,8 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
{
if ((mOutboxInventoryPanel.get() == NULL) ||
(mWindowShade && mWindowShade->isShown()) ||
LLMarketplaceInventoryImporter::getInstance()->isImportInProgress())
LLMarketplaceInventoryImporter::getInstance()->isImportInProgress() ||
mOutboxId.isNull())
{
return FALSE;
}
@ -516,7 +549,7 @@ void LLFloaterOutbox::onImportButtonClicked()
void LLFloaterOutbox::onOutboxChanged()
{
llassert(!mOutboxId.isNull());
//llassert(!mOutboxId.isNull());
LLInventoryPanel* panel = mOutboxInventoryPanel.get();
llinfos << "Merov : onOutboxChanged!!!, panel = " << panel << ", view model = " << (panel ? panel->getFolderViewModel() : NULL) << llendl;
LLViewerInventoryCategory* category = gInventory.getCategory(mOutboxId);
@ -528,7 +561,7 @@ void LLFloaterOutbox::onOutboxChanged()
else
{
llinfos << "Merov : onOutboxChanged!!!, the category disappeared!" << llendl;
//setupOutbox();
cleanOutbox();
}
}

View File

@ -71,6 +71,7 @@ public:
protected:
void setupOutbox();
void cleanOutbox();
void fetchOutboxContents();
void importReportResults(U32 status, const LLSD& content);

View File

@ -590,6 +590,7 @@ LLUUID LLInventoryPanel::getRootFolderID()
}
else if (preferred_type != LLFolderType::FT_NONE)
{
llinfos << "Merov : getRootFolderID, name = " << mParams.start_folder.name() << ", type = " << mParams.start_folder.type << llendl;
root_id = gInventory.findCategoryUUIDForType(preferred_type, false);
if (root_id.isNull())
{