FIX:fixed send print will crash when resources path is chinese path

Change-Id: Ie4a5161f853dca691bd69e5695720d99148a0134
This commit is contained in:
tao wang 2023-01-29 18:00:33 +08:00 committed by Lane.Wei
parent 5666f8fce9
commit 625978355a
2 changed files with 7 additions and 2 deletions

View file

@ -33,6 +33,13 @@ SendJob::SendJob(std::shared_ptr<ProgressIndicator> pri, Plater* plater, std::st
void SendJob::prepare() void SendJob::prepare()
{ {
m_plater->get_print_job_data(&job_data); m_plater->get_print_job_data(&job_data);
if (&job_data) {
std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt";
auto check_access_code_path = temp_file.c_str();
BOOST_LOG_TRIVIAL(trace) << "sned_job: check_access_code_path = " << check_access_code_path;
job_data._temp_path = fs::path(check_access_code_path);
}
} }
void SendJob::on_exception(const std::exception_ptr &eptr) void SendJob::on_exception(const std::exception_ptr &eptr)

View file

@ -6558,8 +6558,6 @@ void Plater::get_print_job_data(PrintPrepareData* data)
data->plate_idx = p->m_print_job_data.plate_idx; data->plate_idx = p->m_print_job_data.plate_idx;
data->_3mf_path = p->m_print_job_data._3mf_path; data->_3mf_path = p->m_print_job_data._3mf_path;
data->_3mf_config_path = p->m_print_job_data._3mf_config_path; data->_3mf_config_path = p->m_print_job_data._3mf_config_path;
std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt";
data->_temp_path = encode_path(temp_file.c_str());
} }
} }