diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 9efd29e297..ef5b4c610c 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -1140,7 +1140,7 @@ std::string Application::getResourceDir() #ifdef RESOURCEDIR // #6892: Conda may inject null characters => remove them std::string path = std::string(RESOURCEDIR).c_str(); - path.append("/"); + path += PATHSEP; QDir dir(QString::fromStdString(path)); if (dir.isAbsolute()) return path; @@ -1169,7 +1169,7 @@ std::string Application::getHelpDir() #ifdef DOCDIR // #6892: Conda may inject null characters => remove them std::string path = std::string(DOCDIR).c_str(); - path.append("/"); + path += PATHSEP; QDir dir(QString::fromStdString(path)); if (dir.isAbsolute()) return path; @@ -2635,7 +2635,7 @@ void Application::initConfig(int argc, char ** argv) std::string tmpPath = _pcUserParamMngr->GetGroup("BaseApp/Preferences/General")->GetASCII("TempPath"); Base::FileInfo di(tmpPath); if (di.exists() && di.isDir()) { - mConfig["AppTempPath"] = tmpPath + "/"; + mConfig["AppTempPath"] = tmpPath + PATHSEP; } @@ -3397,12 +3397,6 @@ std::string Application::FindHomePath(const char* sCall) pos = homePath.find_last_of(PATHSEP); homePath.assign(homePath,0,pos+1); - // switch to posix style - for (std::wstring::iterator it = homePath.begin(); it != homePath.end(); ++it) { - if (*it == '\\') - *it = '/'; - } - // fixes #0001638 to avoid to load DLLs from Windows' system directories before FreeCAD's bin folder std::wstring binPath = homePath; binPath += L"bin"; diff --git a/src/App/ApplicationPy.cpp b/src/App/ApplicationPy.cpp index 49b7cc28ca..9e5371fc32 100644 --- a/src/App/ApplicationPy.cpp +++ b/src/App/ApplicationPy.cpp @@ -697,7 +697,8 @@ PyObject* Application::sGetUserMacroPath(PyObject * /*self*/, PyObject *args) if (Base::asBoolean(actual)) { macroDir = App::GetApplication(). GetParameterGroupByPath("User parameter:BaseApp/Preferences/Macro") - ->GetASCII("MacroPath",macroDir.c_str()); + ->GetASCII("MacroPath", macroDir.c_str()); + std::replace(macroDir.begin(), macroDir.end(), '/', PATHSEP); } Py::String user_macro_dir(macroDir,"utf-8");