KUserFeedback

compilerinfosource.cpp
1/*
2 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: MIT
5*/
6
7#include "compilerinfosource.h"
8
9#include <QVariant>
10
11using namespace KUserFeedback;
12
13CompilerInfoSource::CompilerInfoSource()
14 : AbstractDataSource(QStringLiteral("compiler"), Provider::BasicSystemInformation)
15{
16}
17
19{
20 return tr("The compiler used to build this application.");
21}
22
23#define STRINGIFY(x) #x
24#define INT2STR(x) STRINGIFY(x)
25
27{
28 QVariantMap m;
29
30#ifdef Q_CC_GNU
31 m.insert(QStringLiteral("type"), QStringLiteral("GCC"));
32 m.insert(QStringLiteral("version"), QString::fromLatin1( "" INT2STR(__GNUC__) "." INT2STR(__GNUC_MINOR__)));
33#endif
34
35#ifdef Q_CC_CLANG
36 m.insert(QStringLiteral("type"), QStringLiteral("Clang"));
37 m.insert(QStringLiteral("version"), QString::fromLatin1( "" INT2STR(__clang_major__) "." INT2STR(__clang_minor__)));
38#endif
39
40#ifdef Q_CC_MSVC
41 m.insert(QStringLiteral("type"), QStringLiteral("MSVC"));
42 m.insert(QStringLiteral("version"), QString::fromLatin1( "" INT2STR(_MSC_VER)));
43#endif
44
45 if (m.isEmpty())
46 m.insert(QStringLiteral("type"), QStringLiteral("unknown"));
47
48 return m;
49}
50
52{
53 return tr("Compiler information");
54}
55
56#undef STRINGIFY
57#undef INT2STR
Base class for data sources for telemetry data.
QString description() const override
Returns a human-readable, translated description of what this source provides.
QVariant data() override
Returns the data gathered by this source.
QString name() const override
Returns a short name of this data source.
The central object managing data sources and transmitting feedback to the server.
Definition provider.h:32
Classes for integrating telemetry collection, survey targeting, and contribution encouragenemt and co...
QString fromLatin1(QByteArrayView str)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:12:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.