From d9d94b103acc95ac2956ac87373497f476bab1e4 Mon Sep 17 00:00:00 2001 From: Felix Kauselmann <2039670+selmf@users.noreply.github.com> Date: Fri, 30 Mar 2018 14:14:43 +0200 Subject: [PATCH] Fix YACReader launch on MacOS --- YACReaderLibrary/library_window.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index e41c55fe..77a4bed6 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -1782,11 +1782,9 @@ void LibraryWindow::openComic() quint64 libraryId = libraries.getId(selectedLibrary->currentText()); bool yacreaderFound = false; -#ifdef Q_OS_MAC - QStringList possiblePaths{ - QDir::cleanPath(QCoreApplication::applicationDirPath()+"/../../../"), - QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation) - }; +#ifdef Q_OS_MACOS + QStringList possiblePaths {QDir::cleanPath(QCoreApplication::applicationDirPath()+"/../../../")}; + possiblePaths += QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation); for (auto && ypath: possiblePaths) { @@ -1794,8 +1792,8 @@ void LibraryWindow::openComic() if (QFileInfo(yacreaderPath).exists()) { yacreaderFound = true; - QStringList parameters{"-n", yacreaderPath, currentPath(), QString("--comicId=%1").arg(comic.id), QString("--libraryId=%1").arg(libraryId)}; - QProcess::startDetached(QStringLiteral("open"), parameters); + QStringList parameters {"-n", yacreaderPath, "--args", currentPath(), QString("--comicId=%1").arg(comic.id), QString("--libraryId=%1").arg(libraryId)}; + QProcess::startDetached("open", parameters); break; } }