diff options
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxnavigatorpps.cpp')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxnavigatorpps.cpp | 67 |
1 files changed, 13 insertions, 54 deletions
diff --git a/src/plugins/platforms/qnx/qqnxnavigatorpps.cpp b/src/plugins/platforms/qnx/qqnxnavigatorpps.cpp index d5234ca92f..3a2fee0afb 100644 --- a/src/plugins/platforms/qnx/qqnxnavigatorpps.cpp +++ b/src/plugins/platforms/qnx/qqnxnavigatorpps.cpp @@ -1,58 +1,18 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2012 Research In Motion +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qqnxnavigatorpps.h" #include <QDebug> +#include <QHash> +#include <QByteArray> #include <private/qcore_unix_p.h> -#if defined(QQNXNAVIGATOR_DEBUG) -#define qNavigatorDebug qDebug -#else -#define qNavigatorDebug QT_NO_QDEBUG_MACRO -#endif - -static const char *navigatorControlPath = "/pps/services/navigator/control"; -static const int ppsBufferSize = 4096; - QT_BEGIN_NAMESPACE +const char *QQnxNavigatorPps::navigatorControlPath = "/pps/services/navigator/control"; +const size_t QQnxNavigatorPps::ppsBufferSize = 4096; + QQnxNavigatorPps::QQnxNavigatorPps(QObject *parent) : QQnxAbstractNavigator(parent) , m_fd(-1) @@ -79,7 +39,7 @@ bool QQnxNavigatorPps::openPpsConnection() return false; } - qNavigatorDebug("successfully connected to Navigator. fd=%d", m_fd); + qCDebug(lcQpaQnxNavigator) << "successfully connected to Navigator. fd=" << m_fd; return true; } @@ -101,7 +61,7 @@ bool QQnxNavigatorPps::sendPpsMessage(const QByteArray &message, const QByteArra ppsMessage += "\n"; - qNavigatorDebug() << "sending PPS message:\n" << ppsMessage; + qCDebug(lcQpaQnxNavigator) << "sending PPS message:\n" << ppsMessage; // send pps message to navigator errno = 0; @@ -123,7 +83,7 @@ bool QQnxNavigatorPps::sendPpsMessage(const QByteArray &message, const QByteArra // ensure data is null terminated buffer[bytes] = '\0'; - qNavigatorDebug() << "received PPS message:\n" << buffer; + qCDebug(lcQpaQnxNavigator) << "received PPS message:\n" << buffer; // process received message QByteArray ppsData(buffer); @@ -142,7 +102,7 @@ bool QQnxNavigatorPps::sendPpsMessage(const QByteArray &message, const QByteArra void QQnxNavigatorPps::parsePPS(const QByteArray &ppsData, QHash<QByteArray, QByteArray> &messageFields) { - qNavigatorDebug() << "data=" << ppsData; + qCDebug(lcQpaQnxNavigator) << "data=" << ppsData; // tokenize pps data into lines QList<QByteArray> lines = ppsData.split('\n'); @@ -157,7 +117,7 @@ void QQnxNavigatorPps::parsePPS(const QByteArray &ppsData, QHash<QByteArray, QBy // tokenize current attribute const QByteArray &attr = lines.at(i); - qNavigatorDebug() << "attr=" << attr; + qCDebug(lcQpaQnxNavigator) << "attr=" << attr; int firstColon = attr.indexOf(':'); if (firstColon == -1) { @@ -174,8 +134,7 @@ void QQnxNavigatorPps::parsePPS(const QByteArray &ppsData, QHash<QByteArray, QBy QByteArray key = attr.left(firstColon); QByteArray value = attr.mid(secondColon + 1); - qNavigatorDebug() << "key=" << key; - qNavigatorDebug() << "val=" << value; + qCDebug(lcQpaQnxNavigator) << "key=" << key << "value=" << value; messageFields[key] = value; } } |