Brad Payne (Vir Linden) 2014-09-08 10:32:55 -04:00
commit 411454a2d4
3 changed files with 28 additions and 23 deletions

View File

@ -185,6 +185,7 @@ public:
virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) = 0;
virtual void setPassedFolderFilter(bool passed, S32 filter_generation) = 0;
virtual void dirtyFilter() = 0;
virtual void dirtyDescendantsFilter() = 0;
virtual bool hasFilterStringMatch() = 0;
virtual std::string::size_type getFilterStringOffset() = 0;
virtual std::string::size_type getFilterStringSize() = 0;
@ -261,6 +262,14 @@ public:
mParent->dirtyFilter();
}
}
void dirtyDescendantsFilter()
{
mMostFilteredDescendantGeneration = -1;
if (mParent)
{
mParent->dirtyDescendantsFilter();
}
}
bool hasFilterStringMatch();
std::string::size_type getFilterStringOffset();
std::string::size_type getFilterStringSize();
@ -279,7 +288,7 @@ public:
return;
}
}
mChildren.push_back(child);
mChildren.push_back(child);
child->setParent(this);
dirtyFilter();
requestSort();
@ -287,7 +296,8 @@ public:
virtual void removeChild(LLFolderViewModelItem* child)
{
mChildren.remove(child);
child->setParent(NULL);
child->setParent(NULL);
dirtyDescendantsFilter();
dirtyFilter();
}
@ -297,6 +307,7 @@ public:
// This is different and not equivalent to calling removeChild() on each child
std::for_each(mChildren.begin(), mChildren.end(), DeletePointer());
mChildren.clear();
dirtyDescendantsFilter();
dirtyFilter();
}

View File

@ -293,6 +293,7 @@ void LLFloaterWebContent::onOpen(const LLSD& key)
void LLFloaterWebContent::onClose(bool app_quitting)
{
// If we close the web browsing window showing the facebook login, we need to signal to this object that the connection will not happen
// MAINT-3440 note change here to use findInstance and not getInstance - latter creates an instance if it's not there which is bad.
LLFloater* fbc_web = LLFloaterReg::findInstance("fbc_web");
if (fbc_web == this)
{
@ -302,7 +303,8 @@ void LLFloaterWebContent::onClose(bool app_quitting)
}
}
// Same with Flickr
LLFloater* flickr_web = LLFloaterReg::getInstance("flickr_web");
// MAINT-3440 note change here to use findInstance and not getInstance - latter creates an instance if it's not there which is bad.
LLFloater* flickr_web = LLFloaterReg::findInstance("flickr_web");
if (flickr_web == this)
{
if (!LLFlickrConnect::instance().isConnected())
@ -311,7 +313,8 @@ void LLFloaterWebContent::onClose(bool app_quitting)
}
}
// And Twitter
LLFloater* twitter_web = LLFloaterReg::getInstance("twitter_web");
// MAINT-3440 note change here to use findInstance and not getInstance - latter creates an instance if it's not there which is bad.
LLFloater* twitter_web = LLFloaterReg::findInstance("twitter_web");
if (twitter_web == this)
{
if (!LLTwitterConnect::instance().isConnected())

View File

@ -537,12 +537,13 @@ void LLInventoryPanel::modelChanged(U32 mask)
// This item already exists in both memory and UI. It was probably reparented.
else if (model_item && view_item)
{
LLFolderViewFolder* old_parent = view_item->getParentFolder();
// Don't process the item if it is the root
if (view_item->getParentFolder())
if (old_parent)
{
LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getItemByID(model_item->getParentUUID());
// Item has been moved.
if (view_item->getParentFolder() != new_parent)
if (old_parent != new_parent)
{
if (new_parent != NULL)
{
@ -568,6 +569,7 @@ void LLInventoryPanel::modelChanged(U32 mask)
// doesn't include trash). Just remove the item's UI.
view_item->destroyView();
}
old_parent->getViewModelItem()->dirtyDescendantsFilter();
}
}
}
@ -578,27 +580,16 @@ void LLInventoryPanel::modelChanged(U32 mask)
else if (!model_item && view_item && viewmodel_item)
{
// Remove the item's UI.
removeItemID(viewmodel_item->getUUID());
LLFolderViewFolder* parent = view_item->getParentFolder();
removeItemID(viewmodel_item->getUUID());
view_item->destroyView();
if(parent)
{
parent->getViewModelItem()->dirtyDescendantsFilter();
}
}
}
}
if (mask & (LLInventoryObserver::STRUCTURE | LLInventoryObserver::REMOVE))
{
// STRUCTURE and REMOVE model changes usually fail to update (clean)
// mMostFilteredDescendantGeneration of parent folder and dirtyFilter()
// is not sufficient for successful filter update, so we need to check
// all already passed element over again to remove obsolete elements.
// New items or moved items should be sufficiently covered by
// dirtyFilter().
LLInventoryFilter& filter = getFilter();
if (filter.getFilterTypes() & LLInventoryFilter::FILTERTYPE_DATE
|| filter.isNotDefault())
{
filter.setModified(LLFolderViewFilter::FILTER_MORE_RESTRICTIVE);
}
}
}
LLUUID LLInventoryPanel::getRootFolderID()