summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatergesture.cpp
diff options
context:
space:
mode:
authorPalmer Truelson <palmer@lindenlab.com>2010-02-23 17:19:58 -0800
committerPalmer Truelson <palmer@lindenlab.com>2010-02-23 17:19:58 -0800
commit54a95f706fe42cbef272c53e3fadfc2cf7ecfd0f (patch)
treed9b1f05ce695fa3ef5ee41949d3799d4e9a3e050 /indra/newview/llfloatergesture.cpp
parent7885748497d8b95f51c65f7f84a40d1405429616 (diff)
parent0980df1e0ce99bdafdd4e806cbacad96c71729cc (diff)
merge
Diffstat (limited to 'indra/newview/llfloatergesture.cpp')
-rw-r--r--indra/newview/llfloatergesture.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp
index b684e1f985..9c1ac2631d 100644
--- a/indra/newview/llfloatergesture.cpp
+++ b/indra/newview/llfloatergesture.cpp
@@ -203,12 +203,12 @@ BOOL LLFloaterGesture::postBuild()
gInventory.addObserver(this);
fetchDescendents(folders);
- buildGestureList();
-
- mGestureList->setFocus(TRUE);
-
if (mGestureList)
{
+ buildGestureList();
+
+ mGestureList->setFocus(TRUE);
+
const BOOL ascending = TRUE;
mGestureList->sortByColumn(std::string("name"), ascending);
mGestureList->selectFirstItem();
@@ -223,10 +223,10 @@ BOOL LLFloaterGesture::postBuild()
void LLFloaterGesture::refreshAll()
{
- buildGestureList();
-
if (!mGestureList) return;
+ buildGestureList();
+
if (mSelectedID.isNull())
{
mGestureList->selectFirstItem();
@@ -427,8 +427,13 @@ void LLFloaterGesture::onClickPlay()
BOOL inform_server = TRUE;
BOOL deactivate_similar = FALSE;
LLGestureManager::instance().setGestureLoadedCallback(item_id, boost::bind(&LLFloaterGesture::playGesture, this, item_id));
- LLGestureManager::instance().activateGestureWithAsset(item_id, gInventory.getItem(item_id)->getAssetUUID(), inform_server, deactivate_similar);
- LL_DEBUGS("Gesture")<< "Activating gesture with inventory ID: " << item_id <<LL_ENDL;
+ LLViewerInventoryItem *item = gInventory.getItem(item_id);
+ llassert(item);
+ if (item)
+ {
+ LLGestureManager::instance().activateGestureWithAsset(item_id, item->getAssetUUID(), inform_server, deactivate_similar);
+ LL_DEBUGS("Gesture")<< "Activating gesture with inventory ID: " << item_id <<LL_ENDL;
+ }
}
else
{
@@ -510,15 +515,16 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID))
return;
LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID);
+ llassert(gesture_dir);
LLPointer<GestureCopiedCallback> cb = new GestureCopiedCallback(this);
for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
- LLStringUtil::format_map_t string_args;
- string_args["[COPY_NAME]"] = item->getName();
- if(item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
+ if(gesture_dir && item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
{
+ LLStringUtil::format_map_t string_args;
+ string_args["[COPY_NAME]"] = item->getName();
LL_DEBUGS("Gesture")<< "Copying gesture " << item->getName() << " "<< item->getUUID() << " into "
<< gesture_dir->getName() << " "<< gesture_dir->getUUID() << LL_ENDL;
copy_inventory_item(gAgent.getID(), item->getPermissions().getOwner(), item->getUUID(),