mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-22 22:24:01 -06:00
Fixed an issue that if Orca was invoke by associated files, local data_dir was not used (#7049)
# Description fixed #6987 # Screenshots/Recordings/Graphs <!-- > Please attach relevant screenshots to showcase the UI changes. > Please attach images that can help explain the changes. --> ## Tests <!-- > Please describe the tests that you have conducted to verify the changes made in this PR. -->
This commit is contained in:
commit
fb032cd85f
1 changed files with 12 additions and 3 deletions
|
@ -1908,9 +1908,18 @@ void GUI_App::init_app_config()
|
|||
// Mac : "~/Library/Application Support/Slic3r"
|
||||
|
||||
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";
|
||||
// Orca: check if data_dir folder exists in application folder use it if it exists
|
||||
// Note:wxStandardPaths::Get().GetExecutablePath() return following paths
|
||||
// Unix: /usr/local/bin/exename
|
||||
// Windows: "C:\Programs\AppFolder\exename.exe"
|
||||
// Mac: /Applications/exename.app/Contents/MacOS/exename
|
||||
// TODO: have no idea what to do with Linux bundles
|
||||
auto _app_folder = boost::filesystem::path(wxStandardPaths::Get().GetExecutablePath().ToUTF8().data()).parent_path();
|
||||
#ifdef __APPLE__
|
||||
// On macOS, the executable is inside the .app bundle.
|
||||
_app_folder = _app_folder.parent_path().parent_path().parent_path();
|
||||
#endif
|
||||
boost::filesystem::path app_data_dir_path = _app_folder / "data_dir";
|
||||
if (boost::filesystem::exists(app_data_dir_path)) {
|
||||
set_data_dir(app_data_dir_path.string());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue