diff options
| author | Matthias Melcher <github@matthiasm.com> | 2025-08-13 21:23:48 +0200 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2025-08-13 21:23:48 +0200 |
| commit | f05ee883595b910038e49963af6dbaba9081b49f (patch) | |
| tree | 929b093a8c9286dacbd4f9a4ed15431ca0baa6cf /fluid/Project.cxx | |
| parent | 679f89bb7aa60701704a74525e5bb4f4fe5a9ef6 (diff) | |
Fluid: Fix relative project paths in GUI mode #1293
Also fixes native "Save as... project file chooser to start
with current project path.
Diffstat (limited to 'fluid/Project.cxx')
| -rw-r--r-- | fluid/Project.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fluid/Project.cxx b/fluid/Project.cxx index cc845ef5b..750beccf1 100644 --- a/fluid/Project.cxx +++ b/fluid/Project.cxx @@ -235,12 +235,20 @@ 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); |
