switch CWD to home if default is "/" or contains "AppData"

This commit is contained in:
Axel Kohlmeyer
2025-03-31 23:24:21 -04:00
parent 43662165f0
commit b97611a919

View File

@ -84,8 +84,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);