diff options
author | Graham Linden <graham@lindenlab.com> | 2018-08-06 18:39:52 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-08-06 18:39:52 +0100 |
commit | 46c6ead5c3fe87405a644e3167f15b9c6239ee03 (patch) | |
tree | 4117fbb6dc9aa7bc198e4796fe2c194b4938df3f /indra/newview/llpreviewscript.cpp | |
parent | 7da3a1eb4f14b67c698977eb1947ce06a312d507 (diff) | |
parent | 057d115ac3de49db0e35066975441e64111c8369 (diff) |
Merge
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
-rw-r--r-- | indra/newview/llpreviewscript.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index b85e48ec77..2773e02598 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1742,14 +1742,22 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset buffer[file_length] = 0; preview->mScriptEd->setScriptText(LLStringExplicit(&buffer[0]), TRUE); preview->mScriptEd->mEditor->makePristine(); + + std::string script_name = DEFAULT_SCRIPT_NAME; LLInventoryItem* item = gInventory.getItem(*item_uuid); BOOL is_modifiable = FALSE; - if(item - && gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), - GP_OBJECT_MANIPULATE)) + if (item) { - is_modifiable = TRUE; + if (!item->getName().empty()) + { + script_name = item->getName(); + } + if (gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE)) + { + is_modifiable = TRUE; + } } + preview->mScriptEd->setScriptName(script_name); preview->mScriptEd->setEnableEditing(is_modifiable); preview->mAssetStatus = PREVIEW_ASSET_LOADED; } |