From 03025119c4a7316e83f5336756d3afc9d1ff82b1 Mon Sep 17 00:00:00 2001 From: Leifa <26681464+TrickyLeifa@users.noreply.github.com> Date: Sat, 6 Jul 2024 18:05:48 +0200 Subject: Improve OS detection and add APPIMAGE support to pathing code (#1003) * Added get_app_path, tweaked pathing to adjust itself for Linux, ... * Added get_app_path * This should be used instead of QCoreApplication::applicationDirPath() * Tweaked pathing to adjust itself for Linux * Append separator to base path * Moved headers where they are needed. (Dunno why they were here.) * Proper pathing for AppImage --- src/widgets/aooptionsdialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/aooptionsdialog.cpp b/src/widgets/aooptionsdialog.cpp index a0b7d7c..4d55652 100644 --- a/src/widgets/aooptionsdialog.cpp +++ b/src/widgets/aooptionsdialog.cpp @@ -436,12 +436,12 @@ void AOOptionsDialog::setupUI() FROM_UI(QPushButton, mount_add); connect(ui_mount_add, &QPushButton::clicked, this, [this] { - QString path = QFileDialog::getExistingDirectory(this, tr("Select a base folder"), QApplication::applicationDirPath(), QFileDialog::ShowDirsOnly); + QString path = QFileDialog::getExistingDirectory(this, tr("Select a base folder"), get_app_path(), QFileDialog::ShowDirsOnly); if (path.isEmpty()) { return; } - QDir dir(QApplication::applicationDirPath()); + QDir dir(get_app_path()); QString relative = dir.relativeFilePath(path); if (!relative.contains("../")) { -- cgit