From e577528099ac1c2445a9431a2be5ac0414a489f9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 31 Mar 2025 23:24:21 -0400 Subject: [PATCH] switch CWD to home if default is "/" or contains "AppData" --- tools/lammps-gui/lammpsgui.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/lammps-gui/lammpsgui.cpp b/tools/lammps-gui/lammpsgui.cpp index 602ae58900..79a7d0b908 100644 --- a/tools/lammps-gui/lammpsgui.cpp +++ b/tools/lammps-gui/lammpsgui.cpp @@ -83,8 +83,11 @@ LammpsGui::LammpsGui(QWidget *parent, const QString &filename) : capturer = new StdCapture; current_file.clear(); current_dir = QDir(".").absolutePath(); - // use $HOME if we get dropped to "/" like on macOS - if (current_dir == "/") current_dir = QDir::homePath(); + // use $HOME if we get dropped to "/" like on macOS or the installation folder like on Windows + if ((current_dir == "/") || (current_dir.path().contains("AppData"))) + current_dir = QDir::homePath(); + QDir::setCurrent(current_dir); + inspectList.clear(); setAutoFillBackground(true);