From b5480e4e1b05f03a6ee0d0b4574740a12cb42f5a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 25 Sep 2023 08:54:56 -0400 Subject: [PATCH] must also update CWD when *saving* a file, not only when loading --- tools/lammps-gui/lammpsgui.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/lammps-gui/lammpsgui.cpp b/tools/lammps-gui/lammpsgui.cpp index d8d916910e..0e22adca30 100644 --- a/tools/lammps-gui/lammpsgui.cpp +++ b/tools/lammps-gui/lammpsgui.cpp @@ -530,6 +530,8 @@ void LammpsGui::open_file(const QString &fileName) update_variables(); } +// write file and update CWD to its folder + void LammpsGui::write_file(const QString &fileName) { QFileInfo path(fileName); @@ -542,6 +544,7 @@ void LammpsGui::write_file(const QString &fileName) return; } setWindowTitle(QString("LAMMPS-GUI - " + current_file)); + QDir::setCurrent(current_dir); update_recents(path.absoluteFilePath());