Load 7z.so from LIBDIR in non macos unix systems

This commit is contained in:
Luis Ángel San Martín 2023-07-18 15:07:17 +02:00
parent f57fb9f08e
commit 5f35fdcaef

View File

@ -175,7 +175,16 @@ bool CompressedArchive::loadFunctions()
{
// LOAD library
if (sevenzLib == 0) {
#if defined Q_OS_UNIX && !defined Q_OS_MACOS
QFileInfo sevenzlibrary(QString(LIBDIR) + "/yacreader/7z.so");
if (sevenzlibrary.exists()) {
sevenzLib = new QLibrary(sevenzlibrary.absoluteFilePath());
} else {
sevenzLib = new QLibrary(QString(LIBDIR) + "/7zip/7z.so");
}
#else
sevenzLib = new QLibrary(QCoreApplication::applicationDirPath() + "/utils/7z");
#endif
}
if (!sevenzLib->load()) {
qDebug() << "Error Loading 7z.dll : " + sevenzLib->errorString() << Qt::endl;