From 56ee007b3f44eb3276b244a630f55482c2b02228 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 18 Aug 2016 22:25:08 +0200 Subject: Rework privateFeature privateFeature would add QT_NO_FEATURE to the DEFINES in the private .pri file, which was somewhat inelegant. Additionally, it would add the feature to the _public_ QT_CONFIG variable, which was plain wrong. Replace the implementation with the one just introduced for publicFeature, with the difference that the features are written to the private files instead. As this entirely disposes of the old system, all usages in the project files need to be replaced atomically as well. Change-Id: I506b5d41054410659ea503bc6901736cd5edec6e Reviewed-by: Lars Knoll Reviewed-by: Oswald Buddenhagen --- .../input/evdevtouch/qevdevtouchhandler.cpp | 14 +++++++------- .../input/evdevtouch/qevdevtouchhandler_p.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/platformsupport/input') diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp index f9e81e840f..32ec9d5452 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp @@ -50,7 +50,7 @@ #include #include -#if !defined(QT_NO_MTDEV) +#if QT_CONFIG(mtdev) extern "C" { #include } @@ -150,7 +150,7 @@ QEvdevTouchScreenData::QEvdevTouchScreenData(QEvdevTouchScreenHandler *q_ptr, co #define LONG_BITS (sizeof(long) << 3) #define NUM_LONGS(bits) (((bits) + LONG_BITS - 1) / LONG_BITS) -#if defined(QT_NO_MTDEV) +#if !QT_CONFIG(mtdev) static inline bool testBit(long bit, const long *array) { return (array[bit / LONG_BITS] >> bit % LONG_BITS) & 1; @@ -159,7 +159,7 @@ static inline bool testBit(long bit, const long *array) QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const QString &spec, QObject *parent) : QObject(parent), m_notify(Q_NULLPTR), m_fd(-1), d(Q_NULLPTR), m_device(Q_NULLPTR) -#if !defined(QT_NO_MTDEV) +#if QT_CONFIG(mtdev) , m_mtdev(Q_NULLPTR) #endif { @@ -203,7 +203,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const return; } -#if !defined(QT_NO_MTDEV) +#if QT_CONFIG(mtdev) m_mtdev = static_cast(calloc(1, sizeof(mtdev))); int mtdeverr = mtdev_open(m_mtdev, m_fd); if (mtdeverr) { @@ -215,7 +215,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const d = new QEvdevTouchScreenData(this, args); -#if !defined(QT_NO_MTDEV) +#if QT_CONFIG(mtdev) const char *mtdevStr = "(mtdev)"; d->m_typeB = true; #else @@ -312,7 +312,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const QEvdevTouchScreenHandler::~QEvdevTouchScreenHandler() { -#if !defined(QT_NO_MTDEV) +#if QT_CONFIG(mtdev) if (m_mtdev) { mtdev_close(m_mtdev); free(m_mtdev); @@ -337,7 +337,7 @@ void QEvdevTouchScreenHandler::readData() ::input_event buffer[32]; int events = 0; -#if !defined(QT_NO_MTDEV) +#if QT_CONFIG(mtdev) forever { do { events = mtdev_get(m_mtdev, m_fd, buffer, sizeof(buffer) / sizeof(::input_event)); diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h index a423bbd2ef..b29aa3a793 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h @@ -58,7 +58,7 @@ #include #include -#if !defined(QT_NO_MTDEV) +#if QT_CONFIG(mtdev) struct mtdev; #endif @@ -88,7 +88,7 @@ private: int m_fd; QEvdevTouchScreenData *d; QTouchDevice *m_device; -#if !defined(QT_NO_MTDEV) +#if QT_CONFIG(mtdev) mtdev *m_mtdev; #endif }; -- cgit v1.2.3