Redundant c_str()

This commit is contained in:
bofdahof
2025-03-03 19:21:04 -06:00
committed by Chris Hennes
parent 31825c28aa
commit 8ff4b1b018
+4 -4
View File
@@ -1163,7 +1163,7 @@ std::string Application::getResourceDir()
{ {
#ifdef RESOURCEDIR #ifdef RESOURCEDIR
// #6892: Conda may inject null characters => remove them // #6892: Conda may inject null characters => remove them
std::string path = std::string(RESOURCEDIR).c_str(); auto path = std::string(RESOURCEDIR);
path += PATHSEP; path += PATHSEP;
QDir dir(QString::fromStdString(path)); QDir dir(QString::fromStdString(path));
if (dir.isAbsolute()) if (dir.isAbsolute())
@@ -1178,7 +1178,7 @@ std::string Application::getLibraryDir()
{ {
#ifdef LIBRARYDIR #ifdef LIBRARYDIR
// #6892: Conda may inject null characters => remove them // #6892: Conda may inject null characters => remove them
std::string path = std::string(LIBRARYDIR).c_str(); auto path = std::string(LIBRARYDIR);
QDir dir(QString::fromStdString(path)); QDir dir(QString::fromStdString(path));
if (dir.isAbsolute()) if (dir.isAbsolute())
return path; return path;
@@ -1192,7 +1192,7 @@ std::string Application::getHelpDir()
{ {
#ifdef DOCDIR #ifdef DOCDIR
// #6892: Conda may inject null characters => remove them // #6892: Conda may inject null characters => remove them
std::string path = std::string(DOCDIR).c_str(); auto path = std::string(DOCDIR);
path += PATHSEP; path += PATHSEP;
QDir dir(QString::fromStdString(path)); QDir dir(QString::fromStdString(path));
if (dir.isAbsolute()) if (dir.isAbsolute())
@@ -1311,7 +1311,7 @@ Base::Reference<ParameterGrp> Application::GetParameterGroupByPath(const char*
cName.erase(0,pos+1); cName.erase(0,pos+1);
// test if name is valid // test if name is valid
auto It = mpcPramManager.find(cTemp.c_str()); auto It = mpcPramManager.find(cTemp);
if (It == mpcPramManager.end()) if (It == mpcPramManager.end())
throw Base::ValueError("Application::GetParameterGroupByPath() unknown parameter set name specified"); throw Base::ValueError("Application::GetParameterGroupByPath() unknown parameter set name specified");