Commit 03d449dc authored by Rye Mutt's avatar Rye Mutt 🍞
Browse files

Cleanup various small bugs and string issues

parent 2f29687f
......@@ -629,7 +629,7 @@ void LLXUIXSDWriter::writeXSD(const std::string& type_name, const std::string& p
}
}
LLFILE* xsd_file = LLFile::fopen(file_name.c_str(), "w");
LLFILE* xsd_file = LLFile::fopen(file_name, "w");
LLXMLNode::writeHeaderToFile(xsd_file);
root_nodep->writeToFile(xsd_file);
fclose(xsd_file);
......
......@@ -612,7 +612,6 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
else if (message_name == "set_user_data_path")
{
std::string user_data_path_cache = message_in.getValue("cache_path");
std::string user_data_path_cookies = message_in.getValue("cookies_path");
mUserDataPath = user_data_path_cache + "cef_data";
mCachePath = user_data_path_cache + "cef_cache";
......
......@@ -1876,10 +1876,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
{
is_alpha_mask = true;
}
}
if (tex)
{
LLGLenum image_format = tex->getPrimaryFormat();
if (!is_alpha_mask && (image_format == GL_RGBA || image_format == GL_ALPHA))
{
......
......@@ -334,7 +334,7 @@ void LLFloaterAuction::doResetParcel()
<< parcelp->getArea()
<< "m";
std::string new_name(parcel_name.str().c_str());
std::string new_name(parcel_name.str());
body["name"] = new_name;
getChild<LLUICtrl>("parcel_text")->setValue(new_name); // Set name in dialog as well, since it won't get updated otherwise
......
......@@ -333,7 +333,7 @@ void LLFloaterBulkPermission::handleInventory(LLViewerObject* viewer_obj, LLInve
invname=item->getName().substr(0,item->getName().size() < 30 ? item->getName().size() : 30 );
LLUIString status_text = getString("status_text");
status_text.setArg("[NAME]", invname.c_str());
status_text.setArg("[NAME]", invname);
// Check whether we appear to have the appropriate permissions to change permission on this item.
// Although the server will disallow any forbidden changes, it is a good idea to guess correctly
// so that we can warn the user. The risk of getting this check wrong is therefore the possibility
......
......@@ -801,8 +801,7 @@ LLSD LLFloaterReporter::gatherReport()
// only send a screenshot ID if we're asked to and the email is
// going to LL - Estate Owners cannot see the screenshot asset
LLUUID screenshot_id = LLUUID::null;
screenshot_id = getChild<LLUICtrl>("screenshot")->getValue();
LLUUID screenshot_id = getChild<LLUICtrl>("screenshot")->getValue().asUUID();
LLSD report = LLSD::emptyMap();
report["report-type"] = (U8) mReportType;
......
......@@ -508,7 +508,7 @@ BOOL LLFloaterUIPreview::postBuild()
if((found = iter.next(language_directory))) // get next directory
{
std::string full_path = gDirUtilp->add(xui_dir, language_directory);
if(LLFile::isfile(full_path.c_str())) // if it's not a directory, skip it
if(LLFile::isfile(full_path)) // if it's not a directory, skip it
{
continue;
}
......@@ -657,7 +657,7 @@ void LLFloaterUIPreview::refreshList()
{
if((found = floater_iter.next(name))) // get next file matching pattern
{
addFloaterEntry(name.c_str()); // and add it to the list (file name only; localization code takes care of rest of path)
addFloaterEntry(name); // and add it to the list (file name only; localization code takes care of rest of path)
}
}
found = TRUE;
......@@ -667,7 +667,7 @@ void LLFloaterUIPreview::refreshList()
{
if((found = inspect_iter.next(name))) // get next file matching pattern
{
addFloaterEntry(name.c_str()); // and add it to the list (file name only; localization code takes care of rest of path)
addFloaterEntry(name); // and add it to the list (file name only; localization code takes care of rest of path)
}
}
found = TRUE;
......@@ -677,7 +677,7 @@ void LLFloaterUIPreview::refreshList()
{
if((found = menu_iter.next(name))) // get next file matching pattern
{
addFloaterEntry(name.c_str()); // and add it to the list (file name only; localization code takes care of rest of path)
addFloaterEntry(name); // and add it to the list (file name only; localization code takes care of rest of path)
}
}
found = TRUE;
......@@ -687,7 +687,7 @@ void LLFloaterUIPreview::refreshList()
{
if((found = panel_iter.next(name))) // get next file matching pattern
{
addFloaterEntry(name.c_str()); // and add it to the list (file name only; localization code takes care of rest of path)
addFloaterEntry(name); // and add it to the list (file name only; localization code takes care of rest of path)
}
}
found = TRUE;
......@@ -697,7 +697,7 @@ void LLFloaterUIPreview::refreshList()
{
if((found = sidepanel_iter.next(name))) // get next file matching pattern
{
addFloaterEntry(name.c_str()); // and add it to the list (file name only; localization code takes care of rest of path)
addFloaterEntry(name); // and add it to the list (file name only; localization code takes care of rest of path)
}
}
......@@ -902,7 +902,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID)
std::string full_path(getLocalizedDirectory().append(path));
std::string floater_lang("EN");
llstat dummy;
if(!LLFile::stat(full_path.c_str(), &dummy)) // if the file does not exist
if(!LLFile::stat(full_path, &dummy)) // if the file does not exist
{
floater_lang = getLocStr(ID);
}
......@@ -977,7 +977,7 @@ void LLFloaterUIPreview::onClickEditFloater()
// stat file to see if it exists (some localized versions may not have it there are no diffs, and then we try to open an nonexistent file)
llstat dummy;
if(LLFile::stat(file_path.c_str(), &dummy)) // if the file does not exist
if(LLFile::stat(file_path, &dummy)) // if the file does not exist
{
popupAndPrintWarning(LLStringExplicit("No file for this floater exists in the selected localization. Opening the EN version instead."));
file_path = get_xui_dir() + mDelim + "en" + mDelim + file_name; // open the en version instead, by default
......@@ -1130,7 +1130,7 @@ void LLFloaterUIPreview::onClickToggleDiffHighlighting()
}
llstat dummy;
if(LLFile::stat(path_in_textfield.c_str(), &dummy) && !error) // check if the file exists (empty check is reduntant but useful for the informative error message)
if(LLFile::stat(path_in_textfield, &dummy) && !error) // check if the file exists (empty check is reduntant but useful for the informative error message)
{
std::string warning = LLStringExplicit("Unable to highlight differences because an invalid path to a difference file was provided:\"") + path_in_textfield + "\"";
popupAndPrintWarning(warning);
......
......@@ -531,8 +531,6 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
is_owned_by_me = source->permYouOwner();
}
std::string separator_string(": ");
LLSD args;
LLSD payload;
LLNotification::Params params;
......
......@@ -1431,8 +1431,8 @@ void LLIMModel::sendMessage(const std::string& utf8_text,
FALSE,
gAgent.getSessionID(),
other_participant_id,
name.c_str(),
utf8_text.c_str(),
name,
utf8_text,
offline,
(EInstantMessage)new_dialog,
im_session_id);
......
......@@ -339,7 +339,6 @@ void LLLandmarkActions::onRegionResponseSLURL(slurl_callback_t cb,
bool escaped,
const std::string& url)
{
std::string sim_name;
std::string slurl;
const LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromPosGlobal(global_pos);
if (siminfo)
......
......@@ -606,7 +606,6 @@ BOOL LLPanelProfileLegacy::LLPanelProfilePicks::postBuild()
{
mPicksList = getChild<LLFlatListView>("picks_list");
mClassifiedsList = getChild<LLFlatListView>("classifieds_list");
mClassifiedsList = getChild<LLFlatListView>("classifieds_list");
childSetAction("add_btn", boost::bind(&LLPanelProfilePicks::onClickPlusBtn, this));
childSetAction("teleport_btn", boost::bind(&LLPanelProfilePicks::onClickTeleport, this));
childSetAction("show_on_map_btn", boost::bind(&LLPanelProfilePicks::onClickShowOnMap, this));
......
......@@ -282,7 +282,6 @@ void LLScriptEditor::drawSelectionBackground()
for (auto& rect_it : selection_rects)
{
LLRect selection_rect = rect_it;
selection_rect = rect_it;
selection_rect.translate(mVisibleTextRect.mLeft - content_display_rect.mLeft, mVisibleTextRect.mBottom - content_display_rect.mBottom);
gl_rect_2d(selection_rect, selection_color);
}
......
......@@ -476,7 +476,7 @@ bool idle_startup()
if (!found_template)
{
message_template_path = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "app_settings", "message_template.msg");
found_template = LLFile::fopen(message_template_path.c_str(), "r"); /* Flawfinder: ignore */
found_template = LLFile::fopen(message_template_path, "r"); /* Flawfinder: ignore */
}
#elif LL_DARWIN
// On Mac dev builds, message_template.msg lives in:
......@@ -532,7 +532,7 @@ bool idle_startup()
// be located in indra/build-vc**/newview/<config>/app_settings.
std::string message_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"message.xml");
if (!LLFile::isfile(message_path.c_str()))
if (!LLFile::isfile(message_path))
{
LLMessageConfig::initClass("viewer", gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "app_settings", ""));
}
......@@ -737,7 +737,7 @@ bool idle_startup()
{
LL_DEBUGS("AppInit") << "STATE_BROWSER_INIT" << LL_ENDL;
std::string msg = LLTrans::getString("LoginInitializingBrowser");
set_startup_status(0.03f, msg.c_str(), gAgent.mMOTD.c_str());
set_startup_status(0.03f, msg, gAgent.mMOTD);
display_startup();
// LLViewerMedia::initBrowser();
LLStartUp::setStartupState( STATE_LOGIN_SHOW );
......@@ -968,16 +968,16 @@ bool idle_startup()
//good a place as any to create user windlight directories
std::string user_windlight_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", ""));
LLFile::mkdir(user_windlight_path_name.c_str());
LLFile::mkdir(user_windlight_path_name);
std::string user_windlight_skies_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", ""));
LLFile::mkdir(user_windlight_skies_path_name.c_str());
LLFile::mkdir(user_windlight_skies_path_name);
std::string user_windlight_water_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/water", ""));
LLFile::mkdir(user_windlight_water_path_name.c_str());
LLFile::mkdir(user_windlight_water_path_name);
std::string user_windlight_days_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/days", ""));
LLFile::mkdir(user_windlight_days_path_name.c_str());
LLFile::mkdir(user_windlight_days_path_name);
if (show_connect_box)
......@@ -1376,11 +1376,11 @@ bool idle_startup()
{
LLStringUtil::format_map_t args;
args["[NUMBER]"] = llformat("%d", num_retries + 1);
set_startup_status(0.4f, LLTrans::getString("LoginRetrySeedCapGrant", args), gAgent.mMOTD.c_str());
set_startup_status(0.4f, LLTrans::getString("LoginRetrySeedCapGrant", args), gAgent.mMOTD);
}
else
{
set_startup_status(0.4f, LLTrans::getString("LoginRequestSeedCapGrant"), gAgent.mMOTD.c_str());
set_startup_status(0.4f, LLTrans::getString("LoginRequestSeedCapGrant"), gAgent.mMOTD);
}
}
display_startup();
......@@ -2132,7 +2132,7 @@ bool idle_startup()
update_texture_fetch();
set_startup_status(0.60f + 0.30f * timeout_frac,
LLTrans::getString("LoginPrecaching"),
gAgent.mMOTD.c_str());
gAgent.mMOTD);
display_startup();
}
......
......@@ -301,7 +301,6 @@ bool LLGoogleTranslationHandler::parseResponse(
{
std::stringstream stream(body);
nlohmann::json root;
std::string errors;
try
{
stream >> root;
......
......@@ -1229,7 +1229,6 @@ void LLViewerMedia::getOpenIDCookieCoro(std::string url)
httpOpts->setWantHeaders(true);
LLURL hostUrl(url.c_str());
std::string hostAuth = hostUrl.getAuthority();
// *TODO: Expand LLURL to split and extract this information better.
// The structure of a URL is well defined and needing to retrieve parts of it are common.
......
......@@ -718,8 +718,7 @@ std::string LLGridManager::getGrid(const std::string& grid) const
std::string LLGridManager::getGridByProbing(const std::string& identifier) const
{
std::string grid = LLStringUtil::null;
grid = getGridByAttribute(GRID_GATEKEEPER, identifier);
std::string grid = getGridByAttribute(GRID_GATEKEEPER, identifier);
if (!grid.empty()) return grid;
grid = getGridByAttribute(GRID_VALUE, identifier);
if (!grid.empty()) return grid;
......
......@@ -3147,8 +3147,10 @@ void LLViewerRegion::setCapability(const std::string& name, const std::string& u
mViewerAssetUrl = VIEWERASSET;
}
else
{
mViewerAssetUrl = url;
}
/*==============================================================*/
mViewerAssetUrl = url;
}
else if (name == "GetTexture")
{
......@@ -3175,8 +3177,10 @@ void LLViewerRegion::setCapabilityDebug(const std::string& name, const std::stri
mViewerAssetUrl = VIEWERASSET;
}
else
{
mViewerAssetUrl = url;
}
/*==============================================================*/
mViewerAssetUrl = url;
}
else if (name == "GetTexture")
{
......
......@@ -666,8 +666,8 @@ void RlvUtil::sendIMMessage(const LLUUID& idRecipient, const std::string& strMsg
false,
gAgent.getSessionID(),
idRecipient,
strAgentName.c_str(),
strMsg.c_str(),
strAgentName,
strMsg,
((!pBuddyInfo) || (pBuddyInfo->isOnline())) ? IM_ONLINE : IM_OFFLINE,
IM_NOTHING_SPECIAL,
idSession);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment