Merge pull request #341 from selmf/library_loading

QRencode: Add fallback for Linux distros that don't provide unversion…
This commit is contained in:
Luis Ángel San Martín 2022-10-23 17:47:06 +02:00 committed by GitHub
commit 6fac77b6f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -13,6 +13,7 @@ Version counting is based on semantic versioning (Major.Feature.Patch)
* Fixed going forward history navigation.
* Continue Reading view that it is shown for the root folder.
* UI gets updated when YACReaderLibrary gets updates from YACReader or YACReader for iOS.
* Linux: Add fallback for dynamically loading libqrencode on distros that don't provide unversioned library symlinks
## 9.9.2

View File

@ -303,6 +303,13 @@ QrEncoder::QrEncoder()
QLibrary encoder(QCoreApplication::applicationDirPath() + "/utils/libqrencode.dylib");
#else
QLibrary encoder("qrencode");
#ifdef Q_OS_UNIX
encoder.load();
// Fallback - this loads libqrencode.4.x.x.so when libqrencode.so is not available
if (!encoder.isLoaded()) {
encoder.setFileNameAndVersion("qrencode", 4);
}
#endif
#endif
QRcode_encodeString8bit = (_QRcode_encodeString8bit)encoder.resolve("QRcode_encodeString8bit");
QRcode_free = (_QRcode_free)encoder.resolve("QRcode_free");