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()); quint64 libraryId = libraries.getId(selectedLibrary->currentText());
bool yacreaderFound = false; bool yacreaderFound = false;
#ifdef Q_OS_MAC #ifdef Q_OS_MACOS
QStringList possiblePaths{ QStringList possiblePaths {QDir::cleanPath(QCoreApplication::applicationDirPath()+"/../../../")};
QDir::cleanPath(QCoreApplication::applicationDirPath()+"/../../../"), possiblePaths += QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation);
QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation)
};
for (auto && ypath: possiblePaths) for (auto && ypath: possiblePaths)
{ {
@ -1794,8 +1792,8 @@ void LibraryWindow::openComic()
if (QFileInfo(yacreaderPath).exists()) if (QFileInfo(yacreaderPath).exists())
{ {
yacreaderFound = true; yacreaderFound = true;
QStringList parameters{"-n", yacreaderPath, currentPath(), QString("--comicId=%1").arg(comic.id), QString("--libraryId=%1").arg(libraryId)}; QStringList parameters {"-n", yacreaderPath, "--args", currentPath(), QString("--comicId=%1").arg(comic.id), QString("--libraryId=%1").arg(libraryId)};
QProcess::startDetached(QStringLiteral("open"), parameters); QProcess::startDetached("open", parameters);
break; break;
} }
} }