Extract 7z loading to it's own function

This will unify 7z loading in all scenarios and it also fixes the search path in Linux, now the apps will always try to load 7z.so from LIBDIR/yacreader/7z.so, if it fails they'll try 7zip/7z.so
This commit is contained in:
Luis Ángel San Martín
2024-09-15 15:50:09 +02:00
parent bb36368ad2
commit 63fcde8035
5 changed files with 26 additions and 24 deletions

View File

@ -141,12 +141,7 @@ void LibraryCreator::run()
stopRunning = false;
canceled = false;
#if !defined use_unarr && !defined use_libarchive
// check for 7z lib
#if defined Q_OS_UNIX && !defined Q_OS_MACOS
QLibrary *sevenzLib = new QLibrary(QString(LIBDIR) + "/7zip/7z.so");
#else
QLibrary *sevenzLib = new QLibrary(QCoreApplication::applicationDirPath() + "/utils/7z");
#endif
auto sevenzLib = YACReader::load7zLibrary();
if (!sevenzLib->load()) {
QLOG_ERROR() << "Loading 7z.dll : " + sevenzLib->errorString() << Qt::endl;