MCPcopy Create free account
hub / github.com/OpenImageDebugger/OpenImageDebugger / default_export_path

Function default_export_path

src/host/ui/export_dialog.cpp:63–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61} // namespace
62
63std::string default_export_path(std::string_view last_export_dir,
64 const char* home_env,
65 const std::string& buffer_name,
66 oid::BufferExporter::OutputType format) {
67 std::string dir;
68 if (!last_export_dir.empty()) {
69 dir = last_export_dir;
70 } else if (home_env != nullptr && home_env[0] != '\0') {
71 dir = std::string(home_env) + "/Desktop";
72 } else {
73 dir = ".";
74 }
75 if (!dir.empty() && dir.back() == '/') {
76 dir.pop_back();
77 }
78 return dir + "/" + buffer_name + std::string(extension_for(format));
79}
80
81void apply_format_extension(ExportDialogState& st) {
82 if (st.user_edited_path) {

Callers 2

open_export_dialogFunction · 0.85
TESTFunction · 0.85

Calls 1

extension_forFunction · 0.85

Tested by 1

TESTFunction · 0.68