diff options
author | Kai Koehne <kai.koehne@qt.io> | 2019-10-29 10:21:57 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2019-11-01 14:52:49 +0000 |
commit | 93872ad36604e02a93ce310a7c34cfe32d7c76aa (patch) | |
tree | b90c261961a96edaf87cced6422730656e34e350 /services | |
parent | ed70a31ccc2467e66b3db99af6cbc52fd515a8be (diff) |
Move sources into src subdir
This makes it easier to add a CMakeLists.txt for the super-build.
Change-Id: I53566819281245c0d79d6527222d6f3a824e73dc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
Diffstat (limited to 'services')
-rw-r--r-- | services/datasubmitter.cpp | 63 | ||||
-rw-r--r-- | services/datasubmitter.h | 43 |
2 files changed, 0 insertions, 106 deletions
diff --git a/services/datasubmitter.cpp b/services/datasubmitter.cpp deleted file mode 100644 index ea8d2c4..0000000 --- a/services/datasubmitter.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of UsageStatistic plugin for Qt Creator. -** -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** 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-3.0.html. -** -****************************************************************************/ -#include "datasubmitter.h" - -#include <QtCore/QCoreApplication> - -#include "common/utils.h" - -namespace UsageStatistic { -namespace Internal { - -using namespace KUserFeedback; - -DataSubmitter::DataSubmitter() = default; - -static QString makeVersionString() -{ - return qApp ? qApp->applicationName().append("/").append(qApp->applicationVersion()) : ""; -} - -static QByteArray authHeaderName() -{ - return QByteArrayLiteral("Authorization"); -} - -QNetworkRequest DataSubmitter::dataRequest() const -{ - QNetworkRequest request(serverUrl()); - - const auto versionString = makeVersionString(); - if (!versionString.isEmpty()) { - request.setHeader(QNetworkRequest::UserAgentHeader, versionString); - } - - request.setRawHeader(authHeaderName(), QByteArray(Utils::secret())); - - return request; -} - -} // namespace Internal -} // namespace UsageStatistic diff --git a/services/datasubmitter.h b/services/datasubmitter.h deleted file mode 100644 index 1ae66ac..0000000 --- a/services/datasubmitter.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of UsageStatistic plugin for Qt Creator. -** -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** 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-3.0.html. -** -****************************************************************************/ -#pragma once - -#include <KUserFeedback/AbstractJsonDataSubmitter> - -namespace UsageStatistic { -namespace Internal { - -//! Data submitter which also sets authorization and version headers -class DataSubmitter : public KUserFeedback::AbstractJsonDataSubmitter -{ -public: - DataSubmitter(); - -public: // AbstractDataSubmitter interface - QNetworkRequest dataRequest() const override; -}; - -} // namespace Internal -} // namespace UsageStatistic |