Skip to content
Snippets Groups Projects
Commit 479f13d5 authored by andreykproductengine's avatar andreykproductengine
Browse files

MAINT-288 Fixed Content of 'Object contents' tab blinks after editing it's permissions

parent e3974dbb
No related branches found
No related tags found
No related merge requests found
......@@ -779,23 +779,7 @@ void LLSidepanelItemInfo::onCommitName()
{
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
new_item->rename(labelItemName->getText());
if(mObjectID.isNull())
{
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
gInventory.notifyObservers();
}
else
{
LLViewerObject* object = gObjectList.findObject(mObjectID);
if(object)
{
object->updateInventory(
new_item,
TASK_INVENTORY_ITEM_KEY,
false);
}
}
onCommitChanges(new_item);
}
}
......@@ -816,23 +800,7 @@ void LLSidepanelItemInfo::onCommitDescription()
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
new_item->setDescription(labelItemDesc->getText());
if(mObjectID.isNull())
{
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
gInventory.notifyObservers();
}
else
{
LLViewerObject* object = gObjectList.findObject(mObjectID);
if(object)
{
object->updateInventory(
new_item,
TASK_INVENTORY_ITEM_KEY,
false);
}
}
onCommitChanges(new_item);
}
}
......@@ -908,23 +876,7 @@ void LLSidepanelItemInfo::onCommitPermissions()
flags |= LLInventoryItemFlags::II_FLAGS_OBJECT_PERM_OVERWRITE_GROUP;
}
new_item->setFlags(flags);
if(mObjectID.isNull())
{
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
gInventory.notifyObservers();
}
else
{
LLViewerObject* object = gObjectList.findObject(mObjectID);
if(object)
{
object->updateInventory(
new_item,
TASK_INVENTORY_ITEM_KEY,
false);
}
}
onCommitChanges(new_item);
}
else
{
......@@ -1008,25 +960,7 @@ void LLSidepanelItemInfo::updateSaleInfo()
}
new_item->setSaleInfo(sale_info);
if(mObjectID.isNull())
{
// This is in the agent's inventory.
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
gInventory.notifyObservers();
}
else
{
// This is in an object's contents.
LLViewerObject* object = gObjectList.findObject(mObjectID);
if(object)
{
object->updateInventory(
new_item,
TASK_INVENTORY_ITEM_KEY,
false);
}
}
onCommitChanges(new_item);
}
else
{
......@@ -1035,6 +969,45 @@ void LLSidepanelItemInfo::updateSaleInfo()
}
}
void LLSidepanelItemInfo::onCommitChanges(LLPointer<LLViewerInventoryItem> item)
{
if (item.isNull())
{
return;
}
if (mObjectID.isNull())
{
// This is in the agent's inventory.
item->updateServer(FALSE);
gInventory.updateItem(item);
gInventory.notifyObservers();
}
else
{
// This is in an object's contents.
LLViewerObject* object = gObjectList.findObject(mObjectID);
if (object)
{
object->updateInventory(
item,
TASK_INVENTORY_ITEM_KEY,
false);
if (object->isSelected())
{
// Since object is selected (build floater is open) object will
// receive properties update, detect serial mismatch, dirty and
// reload inventory, meanwhile some other updates will refresh it.
// So mark dirty early, this will prevent unnecessary changes
// and download will be triggered by LLPanelObjectInventory - it
// prevents flashing in content tab and some duplicated request.
object->dirtyInventory();
}
}
}
}
LLViewerInventoryItem* LLSidepanelItemInfo::findItem() const
{
LLViewerInventoryItem* item = NULL;
......
......@@ -89,6 +89,7 @@ class LLSidepanelItemInfo : public LLSidepanelInventorySubpanel
void onCommitSaleInfo();
void onCommitSaleType();
void updateSaleInfo();
void onCommitChanges(LLPointer<LLViewerInventoryItem> item);
};
#endif // LL_LLSIDEPANELITEMINFO_H
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