mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-05 15:40:41 +08:00
Second try to fix conversion from uri to string path
'file://System/Library/Fonts/Helvetica.ttc#postscript-name=Helvetica' -> '/System/Library/Fonts/Helvetica.ttc'
This commit is contained in:
parent
20c72c527a
commit
650447cf02
@ -55,13 +55,10 @@ static std::string get_file_path(const wxFont& font) {
|
||||
if (url == NULL) return {};
|
||||
wxString file_uri;
|
||||
wxCFTypeRef(url).GetValue(file_uri);
|
||||
std::string file_path(wxURI::Unescape(file_uri).c_str());
|
||||
size_t start = std::string("file://").size();
|
||||
if (file_path.empty() || file_path.size() <= start)
|
||||
return {};
|
||||
// remove prefix file://
|
||||
file_path = file_path.substr(start, file_path.size() - start);
|
||||
return file_path;
|
||||
wxURI uri(file_uri);
|
||||
const wxString &path = uri.GetPath();
|
||||
BOOST_LOG_TRIVIAL(trace) << "input uri(" << file_uri.c_str() << ") convert to path(" << path.c_str() << ").";
|
||||
return std::string(path.c_str());
|
||||
}
|
||||
#endif // __APPLE__
|
||||
} // namespace
|
||||
|
Loading…
x
Reference in New Issue
Block a user