diff options
author | Sean Harmer <sean.harmer.qnx@kdab.com> | 2012-05-24 11:03:43 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-25 14:46:04 +0200 |
commit | 49b12d82360ac9602190ff6be93ef0d7b2949055 (patch) | |
tree | 3c40effb04cc587d97be7e586c228d60c88d2527 /src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp | |
parent | df1fc82e23b0f4fec0141dcb8cecd1874dd1655c (diff) |
QNX: Rationalise the usage of qDebug() to remove lots of #ifdef's
Change-Id: I097e4af86a6a0941f4fd7e122970f88ba536ab38
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Reviewed-by: Andriy Golovnya <andriy.golovnya@googlemail.com>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp | 50 |
1 files changed, 15 insertions, 35 deletions
diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp index 3f0e5b2713..64ce4b029f 100644 --- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp +++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp @@ -47,6 +47,12 @@ #include <bps/locale.h> #include <bps/virtualkeyboard.h> +#ifdef QQNXVIRTUALKEYBOARD_DEBUG +#define qVirtualKeyboardDebug qDebug +#else +#define qVirtualKeyboardDebug QT_NO_QDEBUG_MACRO +#endif + QT_BEGIN_NAMESPACE QQnxVirtualKeyboardBps::QQnxVirtualKeyboardBps(QObject *parent) @@ -79,20 +85,14 @@ bool QQnxVirtualKeyboardBps::handleEvent(bps_event_t *event) bool QQnxVirtualKeyboardBps::showKeyboard() { -#if defined(QQNXVIRTUALKEYBOARD_DEBUG) - qDebug() << Q_FUNC_INFO << "current visibility=" << isVisible(); -#endif - + qVirtualKeyboardDebug() << Q_FUNC_INFO << "current visibility=" << isVisible(); virtualkeyboard_show(); return true; } bool QQnxVirtualKeyboardBps::hideKeyboard() { -#if defined(QQNXVIRTUALKEYBOARD_DEBUG) - qDebug() << Q_FUNC_INFO << "current visibility=" << isVisible(); -#endif - + qVirtualKeyboardDebug() << Q_FUNC_INFO << "current visibility=" << isVisible(); virtualkeyboard_hide(); return true; } @@ -136,9 +136,7 @@ void QQnxVirtualKeyboardBps::applyKeyboardMode(KeyboardMode mode) break; } -#if defined(QQNXVIRTUALKEYBOARD_DEBUG) - qDebug() << Q_FUNC_INFO << "mode=" << mode; -#endif + qVirtualKeyboardDebug() << Q_FUNC_INFO << "mode=" << mode; virtualkeyboard_change_options(layout, VIRTUALKEYBOARD_ENTER_DEFAULT); } @@ -148,19 +146,14 @@ bool QQnxVirtualKeyboardBps::handleLocaleEvent(bps_event_t *event) if (bps_event_get_code(event) == LOCALE_INFO) { const QString language = QString::fromAscii(locale_event_get_language(event)); const QString country = QString::fromAscii(locale_event_get_country(event)); - const QLocale newLocale(language + QLatin1Char('_') + country); -#if defined(QQNXVIRTUALKEYBOARD_DEBUG) - qDebug() << Q_FUNC_INFO << "current locale" << locale() << "new locale=" << newLocale; -#endif + qVirtualKeyboardDebug() << Q_FUNC_INFO << "current locale" << locale() << "new locale=" << newLocale; setLocale(newLocale); return true; } -#if defined(QQNXVIRTUALKEYBOARD_DEBUG) - qDebug() << "QQNX: Unhandled locale event. code=" << bps_event_get_code(event); -#endif + qVirtualKeyboardDebug() << Q_FUNC_INFO << "Unhandled locale event. code=" << bps_event_get_code(event); return false; } @@ -169,37 +162,24 @@ bool QQnxVirtualKeyboardBps::handleVirtualKeyboardEvent(bps_event_t *event) { switch (bps_event_get_code(event)) { case VIRTUALKEYBOARD_EVENT_VISIBLE: - #if defined(QQNXVIRTUALKEYBOARD_DEBUG) - qDebug() << Q_FUNC_INFO << "EVENT VISIBLE: current visibility=" << isVisible(); - #endif - + qVirtualKeyboardDebug() << Q_FUNC_INFO << "EVENT VISIBLE: current visibility=" << isVisible(); setVisible(true); break; case VIRTUALKEYBOARD_EVENT_HIDDEN: - #if defined(QQNXVIRTUALKEYBOARD_DEBUG) - qDebug() << Q_FUNC_INFO << "EVENT HIDDEN: current visibility=" << isVisible(); - #endif - + qVirtualKeyboardDebug() << Q_FUNC_INFO << "EVENT HIDDEN: current visibility=" << isVisible(); setVisible(false); break; case VIRTUALKEYBOARD_EVENT_INFO: { const int newHeight = virtualkeyboard_event_get_height(event); - - #if defined(QQNXVIRTUALKEYBOARD_DEBUG) - qDebug() << Q_FUNC_INFO << "EVENT INFO: current height=" << height() << "new height=" << newHeight; - #endif - + qVirtualKeyboardDebug() << Q_FUNC_INFO << "EVENT INFO: current height=" << height() << "new height=" << newHeight; setHeight(newHeight); break; } default: - #if defined(QQNXVIRTUALKEYBOARD_DEBUG) - qDebug() << "QQNX: Unhandled virtual keyboard event. code=" << bps_event_get_code(event); - #endif - + qVirtualKeyboardDebug() << Q_FUNC_INFO << "Unhandled virtual keyboard event. code=" << bps_event_get_code(event); return false; } |