Skip to content

Commit

Permalink
Fix saving assemblies when opened with a relative path on the command
Browse files Browse the repository at this point in the history
... line on Linux.

An extra `Expand` for "filename" is needed on Linux when the file was
opened with a relative path on the command line because dialog->RunModal()
in SolveSpaceUI::GetFilenameAndSave will convert the file name to full path
on Windows but not on GTK.
  • Loading branch information
ruevs committed Sep 20, 2024
1 parent a31a89a commit e5afcdd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,12 @@ bool SolveSpaceUI::SaveToFile(const Platform::Path &filename) {
for(Group &g : SK.group) {
if(g.type != Group::Type::LINKED) continue;

if(g.linkFile.Expand(/*fromCurrentDirectory=*/true).RelativeTo(filename).IsEmpty()) {
// Expand for "filename" below is needed on Linux when the file was opened with a relative
// path on the command line. dialog->RunModal() in SolveSpaceUI::GetFilenameAndSave will
// convert the file name to full path on Windows but not on GTK.
if(g.linkFile.Expand(/*fromCurrentDirectory=*/true)
.RelativeTo(filename.Expand(/*fromCurrentDirectory=*/true))
.IsEmpty()) {
Error("This sketch links the sketch '%s'; it can only be saved "
"on the same volume.", g.linkFile.raw.c_str());
return false;
Expand Down

0 comments on commit e5afcdd

Please sign in to comment.