Fix YACReader launch on MacOS

This commit is contained in:
Felix Kauselmann 2018-03-30 14:14:43 +02:00
parent 827a76413b
commit d9d94b103a

View File

@ -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;
}
}