summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerinventory.cpp
diff options
context:
space:
mode:
authorJonathan Yap <none@none>2014-01-08 09:30:30 -0500
committerJonathan Yap <none@none>2014-01-08 09:30:30 -0500
commita4173dc81a21dfac6a8b57e8e1c354b9a37fe5ba (patch)
tree7c90d4551631abf782fdfcc7cd9cdffbe5bfb532 /indra/newview/llviewerinventory.cpp
parentc804c6b69e9de586225b9cc84c6e6adafba83f8f (diff)
STORM-68 Remove obsolete note. Refactor a few blocks of code to not have early returns
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rwxr-xr-xindra/newview/llviewerinventory.cpp89
1 files changed, 46 insertions, 43 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 5c41ef52b6..e8ae621e41 100755
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -992,66 +992,69 @@ void activate_gesture_cb(const LLUUID& inv_item)
void create_script_cb(const LLUUID& inv_item)
{
- if (inv_item.isNull())
- return;
-
- LLViewerInventoryItem* item = gInventory.getItem(inv_item);
- if (!item) return;
-
- LLPermissions perm = item->getPermissions();
- perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Scripts"));
- perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Scripts"));
+ if (!inv_item.isNull())
+ {
+ LLViewerInventoryItem* item = gInventory.getItem(inv_item);
+ if (item)
+ {
+ LLPermissions perm = item->getPermissions();
+ perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Scripts"));
+ perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Scripts"));
- item->setPermissions(perm);
+ item->setPermissions(perm);
- item->updateServer(FALSE);
- gInventory.updateItem(item);
- gInventory.notifyObservers();
+ item->updateServer(FALSE);
+ gInventory.updateItem(item);
+ gInventory.notifyObservers();
+ }
+ }
}
void create_gesture_cb(const LLUUID& inv_item)
{
- if (inv_item.isNull())
- return;
-
- LLGestureMgr::instance().activateGesture(inv_item);
+ if (!inv_item.isNull())
+ {
+ LLGestureMgr::instance().activateGesture(inv_item);
- LLViewerInventoryItem* item = gInventory.getItem(inv_item);
- if (!item) return;
-
- LLPermissions perm = item->getPermissions();
- perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Gestures"));
- perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Gestures"));
+ LLViewerInventoryItem* item = gInventory.getItem(inv_item);
+ if (item)
+ {
+ LLPermissions perm = item->getPermissions();
+ perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Gestures"));
+ perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Gestures"));
- item->setPermissions(perm);
+ item->setPermissions(perm);
- item->updateServer(FALSE);
- gInventory.updateItem(item);
- gInventory.notifyObservers();
+ item->updateServer(FALSE);
+ gInventory.updateItem(item);
+ gInventory.notifyObservers();
- LLPreviewGesture* preview = LLPreviewGesture::show(inv_item, LLUUID::null);
- // Force to be entirely onscreen.
- gFloaterView->adjustToFitScreen(preview, FALSE);
+ LLPreviewGesture* preview = LLPreviewGesture::show(inv_item, LLUUID::null);
+ // Force to be entirely onscreen.
+ gFloaterView->adjustToFitScreen(preview, FALSE);
+ }
+ }
}
void create_notecard_cb(const LLUUID& inv_item)
{
- if (inv_item.isNull())
- return;
-
- LLViewerInventoryItem* item = gInventory.getItem(inv_item);
- if (!item) return;
-
- LLPermissions perm = item->getPermissions();
- perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Notecards"));
- perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Notecards"));
+ if (!inv_item.isNull())
+ {
+ LLViewerInventoryItem* item = gInventory.getItem(inv_item);
+ if (item)
+ {
+ LLPermissions perm = item->getPermissions();
+ perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Notecards"));
+ perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Notecards"));
- item->setPermissions(perm);
+ item->setPermissions(perm);
- item->updateServer(FALSE);
- gInventory.updateItem(item);
- gInventory.notifyObservers();
+ item->updateServer(FALSE);
+ gInventory.updateItem(item);
+ gInventory.notifyObservers();
+ }
+ }
}
LLInventoryCallbackManager gInventoryCallbacks;