summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-04-02 18:06:22 -0700
committerMerov Linden <merov@lindenlab.com>2014-04-02 18:06:22 -0700
commita98346b0c3b90e75858f6ef98985c1246ad30418 (patch)
tree7bf8e088dafcdc04b839043ff2c2779994534f95 /indra/newview/llinventorybridge.cpp
parentf66de28a7cf735df15d167df270943547bdbde81 (diff)
DD-20 : WIP : Improve Cut and Paste for marketplace. Still some use cases that are not working well
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rwxr-xr-xindra/newview/llinventorybridge.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 5462b2bef4..68418063e7 100755
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1186,6 +1186,22 @@ void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid)
}
}
+void LLInvFVBridge::removeObject(LLInventoryModel *model, const LLUUID &uuid)
+{
+ // Keep track of the parent
+ LLInventoryItem* itemp = model->getItem(uuid);
+ LLUUID parent_id = (itemp ? itemp->getParentUUID() : LLUUID::null);
+ // Remove the object
+ model->removeObject(uuid);
+ // Get the parent updated
+ if (parent_id.notNull())
+ {
+ LLViewerInventoryCategory* parent_cat = model->getCategory(parent_id);
+ model->updateCategory(parent_cat);
+ model->notifyObservers();
+ }
+}
+
bool LLInvFVBridge::canShare() const
{
bool can_share = false;
@@ -1406,7 +1422,7 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
else if ("cut" == action)
{
cutToClipboard();
- gInventory.removeObject(mUUID);
+ removeObject(model, mUUID);
return;
}
else if ("copy" == action)
@@ -1973,7 +1989,7 @@ std::string LLFolderBridge::getLabelSuffix() const
}
else if (getCategory()->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK)
{
- llinfos << "Merov : in merchant folder and is a stock folder : name = " << getCategory()->getName() << ", stock = " << getCategory()->getDescendentCount() << llendl;
+ //llinfos << "Merov : getLabelSuffix : stock folder : name = " << getCategory()->getName() << ", stock = " << getCategory()->getDescendentCount() << llendl;
std::string stock = llformat("%d", getCategory()->getDescendentCount());
std::string suffix = " (" + LLTrans::getString("MarketplaceStock") + ") (" + stock + ")";
return LLInvFVBridge::getLabelSuffix() + suffix;
@@ -3026,7 +3042,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
else if ("cut" == action)
{
cutToClipboard();
- gInventory.removeObject(mUUID);
+ removeObject(model, mUUID);
return;
}
else if ("copy" == action)