summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorygallery.cpp15
-rw-r--r--indra/newview/llinventorygallery.h1
-rw-r--r--indra/newview/llpanelmaininventory.cpp3
3 files changed, 17 insertions, 2 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index 083dfdc65e..caf93b924c 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -158,6 +158,13 @@ LLInventoryGallery::~LLInventoryGallery()
mUnusedItemPanels.pop_back();
panelp->die();
}
+ while (!mHiddenItems.empty())
+ {
+ LLPanel* panelp = mHiddenItems.back();
+ mHiddenItems.pop_back();
+ panelp->die();
+ }
+
if (gInventory.containsObserver(mCategoriesObserver))
{
@@ -490,6 +497,7 @@ void LLInventoryGallery::removeFromGalleryLast(LLInventoryGalleryItem* item)
if(item->isHidden())
{
mHiddenItems.pop_back();
+ // Note: item still exists!!!
return;
}
int n_prev = mItemsAddedCount;
@@ -519,6 +527,7 @@ void LLInventoryGallery::removeFromGalleryMiddle(LLInventoryGalleryItem* item)
if(item->isHidden())
{
mHiddenItems.erase(std::remove(mHiddenItems.begin(), mHiddenItems.end(), item), mHiddenItems.end());
+ // item still exists and needs to be deleted or used!!!
return;
}
int n = mItemIndexMap[item];
@@ -859,6 +868,7 @@ void LLInventoryGallery::updateRemovedItem(LLUUID item_id)
// kill removed item
if (item != NULL)
{
+ // Todo: instead of deleting, store somewhere to reuse later
item->die();
}
}
@@ -1876,6 +1886,11 @@ BOOL LLInventoryGallery::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
return handled;
}
+bool LLInventoryGallery::areViewsInitialized()
+{
+ return mGalleryCreated && mItemBuildQuery.empty();
+}
+
bool LLInventoryGallery::hasDescendents(const LLUUID& cat_id)
{
LLInventoryModel::cat_array_t* cats;
diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h
index 66cffccebc..d82d466aaf 100644
--- a/indra/newview/llinventorygallery.h
+++ b/indra/newview/llinventorygallery.h
@@ -134,6 +134,7 @@ public:
void setSearchType(LLInventoryFilter::ESearchType type);
LLInventoryFilter::ESearchType getSearchType() { return mSearchType; }
+ bool areViewsInitialized();
bool hasDescendents(const LLUUID& cat_id);
bool hasVisibleItems();
void handleModifiedFilter();
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 3226cb51a4..107a00f35a 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -2386,7 +2386,6 @@ void LLPanelMainInventory::updateCombinationVisibility()
bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems();
bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty || mForceShowInvLayout;
mCombinationGalleryLayoutPanel->setVisible(!is_gallery_empty);
- mCombinationGalleryPanel->setVisible(true); // to make sure root updates are getting processed
mCombinationListLayoutPanel->setVisible(show_inv_pane);
mCombinationInventoryPanel->getRootFolder()->setForceArrange(!show_inv_pane);
if(mCombinationInventoryPanel->hasVisibleItems())
@@ -2402,7 +2401,7 @@ void LLPanelMainInventory::updateCombinationVisibility()
if (mReshapeInvLayout
&& show_inv_pane
- && mCombinationGalleryPanel->hasVisibleItems()
+ && (mCombinationGalleryPanel->hasVisibleItems() || mCombinationGalleryPanel->areViewsInitialized())
&& mCombinationInventoryPanel->areViewsInitialized())
{
mReshapeInvLayout = false;