Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed an issue that if Orca was invoke by associated files, local data_dir was not used #7049

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/slic3r/GUI/GUI_App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down