App: reverted commit 8ff4b1b and improved comments in order to fix the MacOS build (#20068)

This commit is contained in:
Thomas Gimpel
2025-03-16 13:11:15 +01:00
committed by Benjamin Nauck
parent e574fa1efc
commit dbfc0b47b6

View File

@@ -1159,8 +1159,8 @@ std::string Application::getUserMacroDir()
std::string Application::getResourceDir()
{
#ifdef RESOURCEDIR
// #6892: Conda may inject null characters => remove them
auto path = std::string(RESOURCEDIR);
// #6892: Conda may inject null characters => remove them using c_str()
std::string path = std::string(RESOURCEDIR).c_str();
path += PATHSEP;
QDir dir(QString::fromStdString(path));
if (dir.isAbsolute())
@@ -1174,8 +1174,8 @@ std::string Application::getResourceDir()
std::string Application::getLibraryDir()
{
#ifdef LIBRARYDIR
// #6892: Conda may inject null characters => remove them
auto path = std::string(LIBRARYDIR);
// #6892: Conda may inject null characters => remove them using c_str()
std::string path = std::string(LIBRARYDIR).c_str();
QDir dir(QString::fromStdString(path));
if (dir.isAbsolute())
return path;
@@ -1188,8 +1188,8 @@ std::string Application::getLibraryDir()
std::string Application::getHelpDir()
{
#ifdef DOCDIR
// #6892: Conda may inject null characters => remove them
auto path = std::string(DOCDIR);
// #6892: Conda may inject null characters => remove them using c_str()
std::string path = std::string(DOCDIR).c_str();
path += PATHSEP;
QDir dir(QString::fromStdString(path));
if (dir.isAbsolute())