Cleaned up (now unnecessary) .c_str() converstions to CList::SetItemName

dev-time-step
krzys-h 2016-03-15 20:46:48 +01:00
parent bce99308c6
commit 6e89d097e8
6 changed files with 11 additions and 11 deletions

View File

@ -523,7 +523,7 @@ void PutList(const std::string& baseName, bool bArray, CBot::CBotVar *var, Ui::C
if (previous.find(pStatic) != previous.end())
{
list->SetItemName(rankList++, StrUtils::Format("%s = [circular reference]", varName.c_str()).c_str());
list->SetItemName(rankList++, StrUtils::Format("%s = [circular reference]", varName.c_str()));
}
else
{
@ -531,11 +531,11 @@ void PutList(const std::string& baseName, bool bArray, CBot::CBotVar *var, Ui::C
if (type <= CBot::CBotTypBoolean)
{
list->SetItemName(rankList++, StrUtils::Format("%s = %s;", varName.c_str(), pStatic->GetValString().c_str()).c_str());
list->SetItemName(rankList++, StrUtils::Format("%s = %s;", varName.c_str(), pStatic->GetValString().c_str()));
}
else if (type == CBot::CBotTypString)
{
list->SetItemName(rankList++, StrUtils::Format("%s = \"%s\";", varName.c_str(), pStatic->GetValString().c_str()).c_str());
list->SetItemName(rankList++, StrUtils::Format("%s = \"%s\";", varName.c_str(), pStatic->GetValString().c_str()));
}
else if (type == CBot::CBotTypArrayPointer)
{
@ -552,7 +552,7 @@ void PutList(const std::string& baseName, bool bArray, CBot::CBotVar *var, Ui::C
}
else
{
//list->SetItemName(rankList++, StrUtils::Format("%s = ?;", varName.c_str()).c_str());
//list->SetItemName(rankList++, StrUtils::Format("%s = ?;", varName.c_str()));
assert(false);
}
}

View File

@ -103,7 +103,7 @@ void CScreenIO::IOReadList(bool isWrite)
m_saveList.clear();
for(const SavedScene& save : m_main->GetPlayerProfile()->GetSavedSceneList())
{
pl->SetItemName(m_saveList.size(), save.name.c_str());
pl->SetItemName(m_saveList.size(), save.name);
m_saveList.push_back(save.path);
}
@ -112,7 +112,7 @@ void CScreenIO::IOReadList(bool isWrite)
{
std::string nameStr;
GetResource(RES_TEXT, RT_IO_NEW, nameStr);
pl->SetItemName(m_saveList.size(), nameStr.c_str());
pl->SetItemName(m_saveList.size(), nameStr);
}
pl->SetSelect(m_saveList.size());

View File

@ -370,12 +370,12 @@ void CScreenLevelList::UpdateSceneChap(int &chap)
{
CLevelParser levelParser("custom", j+1, 0);
levelParser.Load();
pl->SetItemName(j, levelParser.Get("Title")->GetParam("text")->AsString().c_str());
pl->SetItemName(j, levelParser.Get("Title")->GetParam("text")->AsString());
pl->SetEnable(j, true);
}
catch (CLevelParserException& e)
{
pl->SetItemName(j, (std::string("[ERROR]: ")+e.what()).c_str());
pl->SetItemName(j, std::string("[ERROR]: ")+e.what());
pl->SetEnable(j, false);
}
}

View File

@ -221,7 +221,7 @@ void CScreenPlayerSelect::ReadNameList()
auto players = CPlayerProfile::GetPlayerList();
for (int i = 0; i < static_cast<int>(players.size()); ++i)
{
pl->SetItemName(i, players.at(i).c_str());
pl->SetItemName(i, players.at(i));
}
}

View File

@ -327,7 +327,7 @@ void CScreenSetupControls::UpdateSetupButtons()
auto joysticks = m_app->GetJoystickList();
for (unsigned int i = 0; i < joysticks.size(); i++)
{
pli->SetItemName(1 + i, joysticks[i].name.c_str());
pli->SetItemName(1 + i, joysticks[i].name);
}
pli->SetSelect(m_app->GetJoystickEnabled() ? m_app->GetJoystick().index + 1 : 0);
}

View File

@ -192,7 +192,7 @@ void CScreenSetupDisplay::UpdateDisplayMode()
mode_text.str("");
Math::IntPoint aspect = AspectRatio(mode);
mode_text << mode.x << "x" << mode.y << " [" << aspect.x << ":" << aspect.y << "]";
pl->SetItemName(i++, mode_text.str().c_str());
pl->SetItemName(i++, mode_text.str());
}
pl->SetSelect(m_setupSelMode);