use boost::nowide::fopen to store avatar

This commit is contained in:
David Kocik 2024-05-07 09:29:57 +02:00
parent 44cf71390b
commit cb265cdfee
2 changed files with 2 additions and 2 deletions

View File

@ -963,7 +963,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
this->q->Bind(EVT_UA_AVATAR_SUCCESS, [this](UserAccountSuccessEvent& evt) { this->q->Bind(EVT_UA_AVATAR_SUCCESS, [this](UserAccountSuccessEvent& evt) {
boost::filesystem::path path = user_account->get_avatar_path(true); boost::filesystem::path path = user_account->get_avatar_path(true);
FILE* file; FILE* file;
file = fopen(path.string().c_str(), "wb"); file = boost::nowide::fopen(path.generic_string().c_str(), "wb");
if (file == NULL) { if (file == NULL) {
BOOST_LOG_TRIVIAL(error) << "Failed to create file to store avatar picture at: " << path; BOOST_LOG_TRIVIAL(error) << "Failed to create file to store avatar picture at: " << path;
return; return;

View File

@ -79,7 +79,7 @@ boost::filesystem::path UserAccount::get_avatar_path(bool logged) const
{ {
if (logged) { if (logged) {
const std::string filename = "prusaslicer-avatar-" + m_instance_hash + m_avatar_extension; const std::string filename = "prusaslicer-avatar-" + m_instance_hash + m_avatar_extension;
return GUI::into_path(wxStandardPaths::Get().GetTempDir()) / filename; return into_path(wxStandardPaths::Get().GetTempDir()) / filename;
} else { } else {
return boost::filesystem::path(resources_dir()) / "icons" / "user.svg"; return boost::filesystem::path(resources_dir()) / "icons" / "user.svg";
} }