summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.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/llinventoryfunctions.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/llinventoryfunctions.cpp')
-rwxr-xr-xindra/newview/llinventoryfunctions.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 8216830336..aef05fead5 100755
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -90,6 +90,14 @@
BOOL LLInventoryState::sWearNewClothing = FALSE;
LLUUID LLInventoryState::sWearNewClothingTransactionID;
+// Helper function : callback to update a folder after inventory action happened in the background
+void update_folder_cb(const LLUUID& dest_folder)
+{
+ LLViewerInventoryCategory* dest_cat = gInventory.getCategory(dest_folder);
+ gInventory.updateCategory(dest_cat);
+ gInventory.notifyObservers();
+}
+
// Generates a string containing the path to the item specified by
// item_id.
void append_path(const LLUUID& id, std::string& path)
@@ -163,13 +171,14 @@ void copy_inventory_category(LLInventoryModel* model,
for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++)
{
LLInventoryItem* item = *iter;
+ LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(update_folder_cb, new_cat_uuid));
copy_inventory_item(
gAgent.getID(),
item->getPermissions().getOwner(),
item->getUUID(),
new_cat_uuid,
std::string(),
- LLPointer<LLInventoryCallback>(NULL));
+ cb);
}
// Copy all the folders
@@ -746,14 +755,14 @@ void move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_fol
if (copy)
{
// Copy the item
+ LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(update_folder_cb, dest_folder));
copy_inventory_item(
gAgent.getID(),
viewer_inv_item->getPermissions().getOwner(),
viewer_inv_item->getUUID(),
dest_folder,
std::string(),
- LLPointer<LLInventoryCallback>(NULL));
-
+ cb);
}
else
{