Fix upload snapshot to inventory callback mechanism.
This commit is contained in:
@@ -317,8 +317,10 @@ void LLAssetUploadResponder::uploadComplete(const LLSD& content)
|
||||
LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(
|
||||
const LLSD& post_data,
|
||||
const LLUUID& vfile_id,
|
||||
LLAssetType::EType asset_type)
|
||||
: LLAssetUploadResponder(post_data, vfile_id, asset_type)
|
||||
LLAssetType::EType asset_type,
|
||||
void (*callback)(bool, void*),
|
||||
void* user_data)
|
||||
: LLAssetUploadResponder(post_data, vfile_id, asset_type), mCallBack(callback), mUserData(user_data)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -326,13 +328,17 @@ LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(
|
||||
const LLSD& post_data,
|
||||
const std::string& file_name,
|
||||
LLAssetType::EType asset_type)
|
||||
: LLAssetUploadResponder(post_data, file_name, asset_type)
|
||||
: LLAssetUploadResponder(post_data, file_name, asset_type), mCallBack(NULL), mUserData(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLNewAgentInventoryResponder::error(U32 statusNum, const std::string& reason)
|
||||
{
|
||||
if (mCallBack)
|
||||
{
|
||||
(*mCallBack)(false, mUserData);
|
||||
}
|
||||
LLAssetUploadResponder::error(statusNum, reason);
|
||||
//LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, LLUUID(), FALSE);
|
||||
}
|
||||
@@ -340,6 +346,10 @@ void LLNewAgentInventoryResponder::error(U32 statusNum, const std::string& reaso
|
||||
//virtual
|
||||
void LLNewAgentInventoryResponder::uploadFailure(const LLSD& content)
|
||||
{
|
||||
if (mCallBack)
|
||||
{
|
||||
(*mCallBack)(false, mUserData);
|
||||
}
|
||||
LLAssetUploadResponder::uploadFailure(content);
|
||||
//LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], FALSE);
|
||||
}
|
||||
@@ -349,6 +359,11 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
|
||||
{
|
||||
lldebugs << "LLNewAgentInventoryResponder::result from capabilities" << llendl;
|
||||
|
||||
if (mCallBack)
|
||||
{
|
||||
(*mCallBack)(true, mUserData);
|
||||
}
|
||||
|
||||
//std::ostringstream llsdxml;
|
||||
//LLSDSerialize::toXML(content, llsdxml);
|
||||
//llinfos << "upload complete content:\n " << llsdxml.str() << llendl;
|
||||
|
||||
Reference in New Issue
Block a user