mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
Check and use data_dir folder if exists under application path (#6780)
This commit is contained in:
@@ -1908,6 +1908,13 @@ void GUI_App::init_app_config()
|
|||||||
// Mac : "~/Library/Application Support/Slic3r"
|
// Mac : "~/Library/Application Support/Slic3r"
|
||||||
|
|
||||||
if (data_dir().empty()) {
|
if (data_dir().empty()) {
|
||||||
|
// Orca: check if data_dir folder exists in application folder
|
||||||
|
// use it if it exists
|
||||||
|
boost::filesystem::path app_data_dir_path = boost::filesystem::current_path() / "data_dir";
|
||||||
|
if (boost::filesystem::exists(app_data_dir_path)) {
|
||||||
|
set_data_dir(app_data_dir_path.string());
|
||||||
|
}
|
||||||
|
else{
|
||||||
boost::filesystem::path data_dir_path;
|
boost::filesystem::path data_dir_path;
|
||||||
#ifndef __linux__
|
#ifndef __linux__
|
||||||
std::string data_dir = wxStandardPaths::Get().GetUserDataDir().ToUTF8().data();
|
std::string data_dir = wxStandardPaths::Get().GetUserDataDir().ToUTF8().data();
|
||||||
@@ -1926,6 +1933,7 @@ void GUI_App::init_app_config()
|
|||||||
if (!boost::filesystem::exists(data_dir_path)){
|
if (!boost::filesystem::exists(data_dir_path)){
|
||||||
boost::filesystem::create_directory(data_dir_path);
|
boost::filesystem::create_directory(data_dir_path);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Change current dirtory of application
|
// Change current dirtory of application
|
||||||
chdir(encode_path((Slic3r::data_dir() + "/log").c_str()).c_str());
|
chdir(encode_path((Slic3r::data_dir() + "/log").c_str()).c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user