diff options
Diffstat (limited to 'src/platformsupport/input/shared')
-rw-r--r-- | src/platformsupport/input/shared/devicehandlerlist_p.h | 41 | ||||
-rw-r--r-- | src/platformsupport/input/shared/qevdevutil.cpp | 50 | ||||
-rw-r--r-- | src/platformsupport/input/shared/qevdevutil_p.h | 41 | ||||
-rw-r--r-- | src/platformsupport/input/shared/qoutputmapping.cpp | 44 | ||||
-rw-r--r-- | src/platformsupport/input/shared/qoutputmapping_p.h | 41 | ||||
-rw-r--r-- | src/platformsupport/input/shared/shared.pri | 8 |
6 files changed, 22 insertions, 203 deletions
diff --git a/src/platformsupport/input/shared/devicehandlerlist_p.h b/src/platformsupport/input/shared/devicehandlerlist_p.h index 97794d4d7d..facd1946a5 100644 --- a/src/platformsupport/input/shared/devicehandlerlist_p.h +++ b/src/platformsupport/input/shared/devicehandlerlist_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com> -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui module 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) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com> +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QTINPUTSUPPORT_DEVICEHANDLERLIST_P_H #define QTINPUTSUPPORT_DEVICEHANDLERLIST_P_H @@ -52,6 +16,7 @@ // #include <QString> +#include <private/qglobal_p.h> #include <vector> #include <memory> diff --git a/src/platformsupport/input/shared/qevdevutil.cpp b/src/platformsupport/input/shared/qevdevutil.cpp index 4cecb27a64..c1ebb9ada0 100644 --- a/src/platformsupport/input/shared/qevdevutil.cpp +++ b/src/platformsupport/input/shared/qevdevutil.cpp @@ -1,61 +1,27 @@ -/**************************************************************************** -** -** Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com> -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins module 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) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com> +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qevdevutil_p.h" QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + namespace QEvdevUtil { ParsedSpecification parseSpecification(const QString &specification) { ParsedSpecification result; - result.args = QStringView{specification}.split(QLatin1Char(':')); + result.args = QStringView{specification}.split(u':'); - for (const auto &arg : qAsConst(result.args)) { - if (arg.startsWith(QLatin1String("/dev/"))) { + for (const auto &arg : std::as_const(result.args)) { + if (arg.startsWith("/dev/"_L1)) { // if device is specified try to use it result.devices.append(arg.toString()); } else { // build new specification without /dev/ elements - result.spec += arg + QLatin1Char(':'); + result.spec += arg + u':'; } } diff --git a/src/platformsupport/input/shared/qevdevutil_p.h b/src/platformsupport/input/shared/qevdevutil_p.h index 7b5b0f52d1..8533b93783 100644 --- a/src/platformsupport/input/shared/qevdevutil_p.h +++ b/src/platformsupport/input/shared/qevdevutil_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com> -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins module 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) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com> +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QEVDEVUTIL_P_H #define QEVDEVUTIL_P_H @@ -55,6 +19,7 @@ #include <QString> #include <QStringList> #include <QStringView> +#include <private/qglobal_p.h> QT_BEGIN_NAMESPACE diff --git a/src/platformsupport/input/shared/qoutputmapping.cpp b/src/platformsupport/input/shared/qoutputmapping.cpp index b1c428dee2..c8683958d3 100644 --- a/src/platformsupport/input/shared/qoutputmapping.cpp +++ b/src/platformsupport/input/shared/qoutputmapping.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins module 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) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qoutputmapping_p.h" #include <QFile> @@ -47,6 +11,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + static QOutputMapping *s_outputMapping = nullptr; QOutputMapping *QOutputMapping::get() @@ -104,7 +70,7 @@ bool QDefaultOutputMapping::load() // What we are interested is the virtualIndex and touchDevice properties for // each element in the outputs array. - const QJsonArray outputs = doc.object().value(QLatin1String("outputs")).toArray(); + const QJsonArray outputs = doc.object().value("outputs"_L1).toArray(); for (int i = 0; i < outputs.size(); ++i) { const QVariantMap output = outputs.at(i).toObject().toVariantMap(); if (!output.contains(QStringLiteral("touchDevice"))) diff --git a/src/platformsupport/input/shared/qoutputmapping_p.h b/src/platformsupport/input/shared/qoutputmapping_p.h index 5376672eff..b11364188d 100644 --- a/src/platformsupport/input/shared/qoutputmapping_p.h +++ b/src/platformsupport/input/shared/qoutputmapping_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins module 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) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QOUTPUTMAPPING_P_H #define QOUTPUTMAPPING_P_H @@ -53,6 +17,7 @@ #include <QString> #include <QHash> +#include <private/qglobal_p.h> QT_BEGIN_NAMESPACE diff --git a/src/platformsupport/input/shared/shared.pri b/src/platformsupport/input/shared/shared.pri deleted file mode 100644 index 73eb38c9da..0000000000 --- a/src/platformsupport/input/shared/shared.pri +++ /dev/null @@ -1,8 +0,0 @@ -HEADERS += \ - $$PWD/devicehandlerlist_p.h \ - $$PWD/qevdevutil_p.h \ - $$PWD/qoutputmapping_p.h - -SOURCES += \ - $$PWD/qevdevutil.cpp \ - $$PWD/qoutputmapping.cpp |