diff options
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 27f57bda81..d0832e16d7 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1696,9 +1696,21 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge, parent_id = gInventory.getRootFolderID(); } - LLUUID category = gInventory.createNewCategory(parent_id, preferred_type, LLStringUtil::null); - gInventory.notifyObservers(); - panel->setSelectionByID(category, TRUE); + LLHandle<LLPanel> handle = panel->getHandle(); + gInventory.createNewCategory( + parent_id, + preferred_type, + LLStringUtil::null, + [handle](const LLUUID &new_category_id) + { + gInventory.notifyObservers(); + LLInventoryPanel* panel = static_cast<LLInventoryPanel*>(handle.get()); + if (panel) + { + panel->setSelectionByID(new_category_id, TRUE); + } + } + ); } else if ("lsl" == type_name) { |