From b4bdd72fa3a9069ea097632f39e6d8370bbe3737 Mon Sep 17 00:00:00 2001 From: Nikolaos Ftylitakis Date: Sun, 8 Aug 2021 13:01:20 +0300 Subject: [PATCH] support SailfishOS (fixes #200) --- src/QZXing-components.pri | 42 ++++++++++++++++----------------------- src/QZXingFilter.cpp | 2 +- 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/src/QZXing-components.pri b/src/QZXing-components.pri index 9559aa3..a7fec1a 100644 --- a/src/QZXing-components.pri +++ b/src/QZXing-components.pri @@ -430,20 +430,7 @@ qzxing_qml { $$PWD/QZXingImageProvider.cpp } -symbian { - TARGET.UID3 = 0xE618743C - TARGET.EPOCALLOWDLLDATA = 1 - - #TARGET.CAPABILITY = All -TCB -AllFiles -DRM - TARGET.CAPABILITY += NetworkServices \ - ReadUserData \ - WriteUserData \ - LocalServices \ - UserEnvironment \ - Location -} - -!symbian { +unix { isEmpty(PREFIX) { maemo5 { PREFIX = /opt/usr @@ -454,19 +441,24 @@ symbian { DEFINES += NOFMAXL - # Installation - headers.files = $$PWD/QZXing.h $$PWD/QZXing_global.h - headers.path = $$PREFIX/include - target.path = $$PREFIX/lib - INSTALLS += headers target + contains( CONFIG, sailfishapp) { + DEFINES += Q_OS_SAILFISH + } else { + # Installation + headers.files = $$PWD/QZXing.h $$PWD/QZXing_global.h + headers.path = $$PREFIX/include + target.path = $$PREFIX/lib + INSTALLS += headers target + } - # pkg-config support - CONFIG += create_pc create_prl no_install_prl - QMAKE_PKGCONFIG_DESTDIR = pkgconfig - QMAKE_PKGCONFIG_LIBDIR = ${prefix}/lib - QMAKE_PKGCONFIG_INCDIR = ${prefix}/include - unix:QMAKE_CLEAN += -r pkgconfig lib$${TARGET}.prl + # pkg-config support + CONFIG += create_pc create_prl no_install_prl + QMAKE_PKGCONFIG_DESTDIR = pkgconfig + QMAKE_PKGCONFIG_LIBDIR = ${prefix}/lib + QMAKE_PKGCONFIG_INCDIR = ${prefix}/include + + unix:QMAKE_CLEAN += -r pkgconfig lib$${TARGET}.prl } win32-msvc*{ diff --git a/src/QZXingFilter.cpp b/src/QZXingFilter.cpp index b218037..19bb8b6 100644 --- a/src/QZXingFilter.cpp +++ b/src/QZXingFilter.cpp @@ -180,7 +180,7 @@ static QImage* rgbDataToGrayscale(const uchar* data, const CaptureRect& captureR for (int y = 1; y <= captureRect.targetHeight; ++y) { //Quick fix for iOS & macOS devices. Will be handled better in the future -#if defined(Q_OS_IOS) || defined (Q_OS_MAC) +#if defined(Q_OS_IOS) || defined (Q_OS_MAC) || defined(Q_OS_SAILFISH) uchar* pixel = pixelInit + (y - 1) * captureRect.targetWidth; #else uchar* pixel = pixelInit + (captureRect.targetHeight - y) * captureRect.targetWidth;