From f05ee883595b910038e49963af6dbaba9081b49f Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Wed, 13 Aug 2025 21:23:48 +0200 Subject: Fluid: Fix relative project paths in GUI mode #1293 Also fixes native "Save as... project file chooser to start with current project path. --- fluid/Project.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'fluid/Project.cxx') diff --git a/fluid/Project.cxx b/fluid/Project.cxx index cc845ef5b..750beccf1 100644 --- a/fluid/Project.cxx +++ b/fluid/Project.cxx @@ -234,13 +234,21 @@ void Project::leave_project_dir() { } } +/** + Alias for set_filename(""). + Instead, change proj_filename into a std::string and add clear_filename(). + */ +void Project::set_filename(std::nullptr_t) { + set_filename(std::string()); +} + /** Set the filename of the current .fl design. \param[in] c the new absolute filename and path */ -void Project::set_filename(const char *c) { +void Project::set_filename(const std::string &c) { if (proj_filename) free((void *)proj_filename); - proj_filename = c ? fl_strdup(c) : nullptr; + proj_filename = c.empty() ? nullptr : fl_strdup(c.c_str()); if (proj_filename && !Fluid.batch_mode) Fluid.history.update(proj_filename); -- cgit v1.2.3