diff options
Diffstat (limited to 'indra/newview/lltranslate.cpp')
| -rw-r--r-- | indra/newview/lltranslate.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 72e30bd765..dcd1582eb9 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -155,10 +155,10 @@ void LLTranslationAPIHandler::verifyKeyCoro(LLTranslate::EService service, LLSD { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared<LLCoreHttpUtil::HttpCoroutineAdapter>("getMerchantStatusCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared<LLCore::HttpRequest>(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared<LLCore::HttpOptions>(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared<LLCore::HttpHeaders>(); std::string user_agent = stringize( @@ -199,7 +199,7 @@ void LLTranslationAPIHandler::verifyKeyCoro(LLTranslate::EService service, LLSD bOk = false; } - if (!fnc.empty()) + if (fnc != nullptr) { fnc(service, bOk, parseResult); } @@ -210,10 +210,10 @@ void LLTranslationAPIHandler::translateMessageCoro(LanguagePair_t fromTo, std::s { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared<LLCoreHttpUtil::HttpCoroutineAdapter>("getMerchantStatusCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared<LLCore::HttpRequest>(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared<LLCore::HttpOptions>(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared<LLCore::HttpHeaders>(); std::string user_agent = stringize( @@ -275,7 +275,7 @@ void LLTranslationAPIHandler::translateMessageCoro(LanguagePair_t fromTo, std::s LLStringUtil::replaceString(translation, "&", "&"); LLStringUtil::replaceString(translation, "'", "'"); - if (!success.empty()) + if (success != nullptr) success(translation, detected_lang); } else @@ -291,7 +291,7 @@ void LLTranslationAPIHandler::translateMessageCoro(LanguagePair_t fromTo, std::s } LL_WARNS() << "Translation request failed: " << err_msg << LL_ENDL; - if (!failure.empty()) + if (failure != nullptr) failure(status, err_msg); } } |
