mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 02:09:02 +08:00
use boost::nowide::fopen to store avatar
This commit is contained in:
parent
44cf71390b
commit
cb265cdfee
@ -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;
|
||||||
|
@ -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";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user