summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewscript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
-rwxr-xr-xindra/newview/llpreviewscript.cpp89
1 files changed, 42 insertions, 47 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index a4798f3911..1cfea2c547 100755
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -479,7 +479,7 @@ BOOL LLScriptEdCore::postBuild()
childSetAction("Edit_btn", boost::bind(&LLScriptEdCore::openInExternalEditor, this));
initMenu();
-
+
std::vector<std::string> funcs;
std::vector<std::string> tooltips;
@@ -624,14 +624,14 @@ bool LLScriptEdCore::loadScriptText(const std::string& filename)
{
if (filename.empty())
{
- llwarns << "Empty file name" << llendl;
+ LL_WARNS() << "Empty file name" << LL_ENDL;
return false;
}
LLFILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/
if (!file)
{
- llwarns << "Error opening " << filename << llendl;
+ LL_WARNS() << "Error opening " << filename << LL_ENDL;
return false;
}
@@ -643,7 +643,7 @@ bool LLScriptEdCore::loadScriptText(const std::string& filename)
size_t nread = fread(buffer, 1, file_length, file);
if (nread < file_length)
{
- llwarns << "Short read" << llendl;
+ LL_WARNS() << "Short read" << LL_ENDL;
}
buffer[nread] = '\0';
fclose(file);
@@ -659,7 +659,7 @@ bool LLScriptEdCore::writeToFile(const std::string& filename)
LLFILE* fp = LLFile::fopen(filename, "wb");
if (!fp)
{
- llwarns << "Unable to write to " << filename << llendl;
+ LL_WARNS() << "Unable to write to " << filename << LL_ENDL;
LLSD row;
row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?";
@@ -1039,7 +1039,7 @@ void LLScriptEdCore::onBtnInsertFunction(LLUICtrl *ui, void* userdata)
void LLScriptEdCore::doSave( BOOL close_after_save )
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_LSL_SAVE_COUNT );
+ add(LLStatViewer::LSL_SAVES, 1);
if( mSaveCallback )
{
@@ -1114,8 +1114,8 @@ void LLScriptEdCore::onErrorList(LLUICtrl*, void* user_data)
LLStringUtil::replaceChar(line, ',',' ');
LLStringUtil::replaceChar(line, ')',' ');
sscanf(line.c_str(), "%d %d", &row, &column);
- //llinfos << "LLScriptEdCore::onErrorList() - " << row << ", "
- //<< column << llendl;
+ //LL_INFOS() << "LLScriptEdCore::onErrorList() - " << row << ", "
+ //<< column << LL_ENDL;
self->mEditor->setCursor(row, column);
self->mEditor->setFocus(TRUE);
}
@@ -1162,15 +1162,15 @@ struct LLEntryAndEdCore
void LLScriptEdCore::deleteBridges()
{
- S32 count = mBridges.count();
+ S32 count = mBridges.size();
LLEntryAndEdCore* eandc;
for(S32 i = 0; i < count; i++)
{
- eandc = mBridges.get(i);
+ eandc = mBridges.at(i);
delete eandc;
mBridges[i] = NULL;
}
- mBridges.reset();
+ mBridges.clear();
}
// virtual
@@ -1243,8 +1243,7 @@ void LLScriptEdCore::onBtnLoadFromFile( void* data )
void LLScriptEdCore::onBtnSaveToFile( void* userdata )
{
-
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_LSL_SAVE_COUNT );
+ add(LLStatViewer::LSL_SAVES, 1);
LLScriptEdCore* self = (LLScriptEdCore*) userdata;
@@ -1507,7 +1506,7 @@ BOOL LLPreviewLSL::postBuild()
// virtual
void LLPreviewLSL::callbackLSLCompileSucceeded()
{
- llinfos << "LSL Bytecode saved" << llendl;
+ LL_INFOS() << "LSL Bytecode saved" << LL_ENDL;
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful"));
mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete"));
closeIfNeeded();
@@ -1516,7 +1515,7 @@ void LLPreviewLSL::callbackLSLCompileSucceeded()
// virtual
void LLPreviewLSL::callbackLSLCompileFailed(const LLSD& compile_errors)
{
- llinfos << "Compile failed!" << llendl;
+ LL_INFOS() << "Compile failed!" << LL_ENDL;
for(LLSD::array_const_iterator line = compile_errors.beginArray();
line < compile_errors.endArray();
@@ -1631,7 +1630,7 @@ void LLPreviewLSL::onSave(void* userdata, BOOL close_after_save)
// fails, go ahead and save the text anyway.
void LLPreviewLSL::saveIfNeeded(bool sync /*= true*/)
{
- // llinfos << "LLPreviewLSL::saveIfNeeded()" << llendl;
+ // LL_INFOS() << "LLPreviewLSL::saveIfNeeded()" << LL_ENDL;
if(!mScriptEd->hasChanged())
{
return;
@@ -1677,7 +1676,7 @@ void LLPreviewLSL::uploadAssetViaCaps(const std::string& url,
const std::string& filename,
const LLUUID& item_id)
{
- llinfos << "Update Agent Inventory via capability" << llendl;
+ LL_INFOS() << "Update Agent Inventory via capability" << LL_ENDL;
LLSD body;
body["item_id"] = item_id;
body["target"] = "lsl2";
@@ -1710,7 +1709,7 @@ void LLPreviewLSL::uploadAssetLegacy(const std::string& filename,
asset_id.asString().c_str(),
gAgent.isGodlike()))
{
- llinfos << "Compile failed!" << llendl;
+ LL_INFOS() << "Compile failed!" << LL_ENDL;
//char command[256];
//sprintf(command, "type %s\n", err_filename.c_str());
//system(command);
@@ -1748,7 +1747,7 @@ void LLPreviewLSL::uploadAssetLegacy(const std::string& filename,
}
else
{
- llinfos << "Compile worked!" << llendl;
+ LL_INFOS() << "Compile worked!" << LL_ENDL;
if(gAssetStorage)
{
getWindow()->incBusyCount();
@@ -1790,8 +1789,8 @@ void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32
}
else
{
- llwarns << "Inventory item for script " << info->mItemUUID
- << " is no longer in agent inventory." << llendl;
+ LL_WARNS() << "Inventory item for script " << info->mItemUUID
+ << " is no longer in agent inventory." << LL_ENDL;
}
// Find our window and close it if requested.
@@ -1810,7 +1809,7 @@ void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32
}
else
{
- llwarns << "Problem saving script: " << status << llendl;
+ LL_WARNS() << "Problem saving script: " << status << LL_ENDL;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
LLNotificationsUtil::add("SaveScriptFailReason", args);
@@ -1848,7 +1847,7 @@ void LLPreviewLSL::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_d
}
else
{
- llwarns << "Problem saving LSL Bytecode (Preview)" << llendl;
+ LL_WARNS() << "Problem saving LSL Bytecode (Preview)" << LL_ENDL;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
LLNotificationsUtil::add("SaveBytecodeFailReason", args);
@@ -1860,8 +1859,8 @@ void LLPreviewLSL::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_d
void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status)
{
- lldebugs << "LLPreviewLSL::onLoadComplete: got uuid " << asset_uuid
- << llendl;
+ LL_DEBUGS() << "LLPreviewLSL::onLoadComplete: got uuid " << asset_uuid
+ << LL_ENDL;
LLUUID* item_uuid = (LLUUID*)user_data;
LLPreviewLSL* preview = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", *item_uuid);
if( preview )
@@ -1891,8 +1890,6 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset
}
else
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
-
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ||
LL_ERR_FILE_EMPTY == status)
{
@@ -1908,7 +1905,7 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset
}
preview->mAssetStatus = PREVIEW_ASSET_ERROR;
- llwarns << "Problem loading script: " << status << llendl;
+ LL_WARNS() << "Problem loading script: " << status << LL_ENDL;
}
}
delete item_uuid;
@@ -1985,7 +1982,7 @@ void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id,
const LLUUID& item_id,
bool is_script_running)
{
- lldebugs << "LSL Bytecode saved" << llendl;
+ LL_DEBUGS() << "LSL Bytecode saved" << LL_ENDL;
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful"));
mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete"));
closeIfNeeded();
@@ -1994,7 +1991,7 @@ void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id,
// virtual
void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors)
{
- lldebugs << "Compile failed!" << llendl;
+ LL_DEBUGS() << "Compile failed!" << LL_ENDL;
for(LLSD::array_const_iterator line = compile_errors.beginArray();
line < compile_errors.endArray();
line++)
@@ -2013,7 +2010,7 @@ void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors)
void LLLiveLSLEditor::loadAsset()
{
- //llinfos << "LLLiveLSLEditor::loadAsset()" << llendl;
+ //LL_INFOS() << "LLLiveLSLEditor::loadAsset()" << LL_ENDL;
if(!mIsNew)
{
LLViewerObject* object = gObjectList.findObject(mObjectUUID);
@@ -2086,7 +2083,7 @@ void LLLiveLSLEditor::loadAsset()
LLHost host(object->getRegion()->getIP(),
object->getRegion()->getPort());
gMessageSystem->sendReliable(host);
- */
+ */
}
}
else
@@ -2118,10 +2115,10 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id,
LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status)
{
- lldebugs << "LLLiveLSLEditor::onLoadComplete: got uuid " << asset_id
- << llendl;
+ LL_DEBUGS() << "LLLiveLSLEditor::onLoadComplete: got uuid " << asset_id
+ << LL_ENDL;
LLUUID* xored_id = (LLUUID*)user_data;
-
+
LLLiveLSLEditor* instance = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", *xored_id);
if(instance )
@@ -2134,8 +2131,6 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id,
}
else
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
-
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ||
LL_ERR_FILE_EMPTY == status)
{
@@ -2166,7 +2161,7 @@ void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType
if (file.getLastBytesRead() != file_length ||
file_length <= 0)
{
- llwarns << "Error reading " << uuid << ":" << type << llendl;
+ LL_WARNS() << "Error reading " << uuid << ":" << type << LL_ENDL;
}
buffer[file_length] = '\0';
@@ -2385,7 +2380,7 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/)
void LLLiveLSLEditor::uploadAssetViaCaps( const std::string& url, const std::string& filename, const LLUUID& task_id, const LLUUID& item_id, BOOL is_running, const LLUUID& experience_public_id )
{
- llinfos << "Update Task Inventory via capability " << url << llendl;
+ LL_INFOS() << "Update Task Inventory via capability " << url << LL_ENDL;
LLSD body;
body["task_id"] = task_id;
body["item_id"] = item_id;
@@ -2425,7 +2420,7 @@ void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename,
gAgent.isGodlike()))
{
// load the error file into the error scrolllist
- llinfos << "Compile failed!" << llendl;
+ LL_INFOS() << "Compile failed!" << LL_ENDL;
if(NULL != (fp = LLFile::fopen(err_filename, "r")))
{
char buffer[MAX_STRING]; /*Flawfinder: ignore*/
@@ -2463,12 +2458,12 @@ void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename,
}
else
{
- llinfos << "Compile worked!" << llendl;
+ LL_INFOS() << "Compile worked!" << LL_ENDL;
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessfulSaving"));
if(gAssetStorage)
{
- llinfos << "LLLiveLSLEditor::saveAsset "
- << mItem->getAssetUUID() << llendl;
+ LL_INFOS() << "LLLiveLSLEditor::saveAsset "
+ << mItem->getAssetUUID() << LL_ENDL;
getWindow()->incBusyCount();
mPendingUploads++;
LLLiveLSLSaveData* data = NULL;
@@ -2501,7 +2496,7 @@ void LLLiveLSLEditor::onSaveTextComplete(const LLUUID& asset_uuid, void* user_da
if (status)
{
- llwarns << "Unable to save text for a script." << llendl;
+ LL_WARNS() << "Unable to save text for a script." << LL_ENDL;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
LLNotificationsUtil::add("CompileQueueSaveText", args);
@@ -2532,7 +2527,7 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use
return;
if(0 ==status)
{
- llinfos << "LSL Bytecode saved" << llendl;
+ LL_INFOS() << "LSL Bytecode saved" << LL_ENDL;
LLLiveLSLEditor* self = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", data->mItem->getUUID()); // ^ data->mSaveObjectID
if (self)
{
@@ -2558,8 +2553,8 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use
}
else
{
- llinfos << "Problem saving LSL Bytecode (Live Editor)" << llendl;
- llwarns << "Unable to save a compiled script." << llendl;
+ LL_INFOS() << "Problem saving LSL Bytecode (Live Editor)" << LL_ENDL;
+ LL_WARNS() << "Unable to save a compiled script." << LL_ENDL;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));