From 0043e4ccc82ac58f16d55279bca0a8308ce425dd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 1 Sep 2023 03:29:45 -0400 Subject: [PATCH] macOS drops us into "/" when opening the app bundle without a file. use $HOME instead. --- tools/lammps-gui/CMakeLists.txt | 2 +- tools/lammps-gui/lammpsgui.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/lammps-gui/CMakeLists.txt b/tools/lammps-gui/CMakeLists.txt index 37fe455d39..656a9b02f2 100644 --- a/tools/lammps-gui/CMakeLists.txt +++ b/tools/lammps-gui/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.16) -project(lammps-gui VERSION 1.5.0 LANGUAGES CXX) +project(lammps-gui VERSION 1.5.1 LANGUAGES CXX) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) diff --git a/tools/lammps-gui/lammpsgui.cpp b/tools/lammps-gui/lammpsgui.cpp index 98fe81a048..45ddc5071a 100644 --- a/tools/lammps-gui/lammpsgui.cpp +++ b/tools/lammps-gui/lammpsgui.cpp @@ -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");