macOS drops us into "/" when opening the app bundle without a file. use $HOME instead.

This commit is contained in:
Axel Kohlmeyer
2023-09-01 03:29:45 -04:00
parent 2e0bc524cc
commit 0043e4ccc8
2 changed files with 3 additions and 1 deletions

View File

@ -113,6 +113,8 @@ LammpsGui::LammpsGui(QWidget *parent, const char *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();
QCoreApplication::setOrganizationName("The LAMMPS Developers");
QCoreApplication::setOrganizationDomain("lammps.org");