settings directory is now taken from a "configuration" directory if next to the "resources" one.

Allow of a "portable version" without the --datadir needed.
supermerill/SuperSlicer#1212
This commit is contained in:
supermerill 2021-08-09 03:32:39 +02:00
parent 5265c85c82
commit de3ba3c794

View File

@ -744,6 +744,10 @@ void GUI_App::init_app_config()
// Mac : "~/Library/Application Support/Slic3r"
if (data_dir().empty()) {
//check if there is a "configuration" directory next to the resources
if (boost::filesystem::exists(boost::filesystem::path{ resources_dir() } / ".." / "configuration")) {
set_data_dir((boost::filesystem::path{ resources_dir() } / ".." / "configuration").string());
} else {
#ifndef __linux__
set_data_dir(wxStandardPaths::Get().GetUserDataDir().ToUTF8().data());
#else
@ -755,6 +759,7 @@ void GUI_App::init_app_config()
set_data_dir((dir + "/" + GetAppName()).ToUTF8().data());
#endif
}
}
if (!app_config)
app_config = new AppConfig(is_editor() ? AppConfig::EAppMode::Editor : AppConfig::EAppMode::GCodeViewer);