KUserFeedback

usagetimesource.cpp
1/*
2 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: MIT
5*/
6
7#include "usagetimesource.h"
8#include "abstractdatasource_p.h"
9#include "provider_p.h"
10
11#include <QVariant>
12
13using namespace KUserFeedback;
14
15namespace KUserFeedback {
16class UsageTimeSourcePrivate : public AbstractDataSourcePrivate
17{
18public:
19 UsageTimeSourcePrivate() : provider(nullptr) {}
20 ProviderPrivate *provider;
21};
22}
23
25 AbstractDataSource(QStringLiteral("usageTime"), Provider::BasicUsageStatistics, new UsageTimeSourcePrivate)
26{
27}
28
30{
31 return tr("The total amount of time the application has been used.");
32}
33
35{
37 Q_ASSERT(d->provider);
38
39 QVariantMap m;
40 m.insert(QStringLiteral("value"), d->provider->currentApplicationTime());
41 return m;
42}
43
45{
46 return tr("Usage time");
47}
48
49void UsageTimeSource::setProvider(ProviderPrivate* p)
50{
52 d->provider = p;
53}
Base class for data sources for telemetry data.
The central object managing data sources and transmitting feedback to the server.
Definition provider.h:32
Data source reporting the total usage time of the application.
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.
UsageTimeSource()
Create a new usage time data source.
Classes for integrating telemetry collection, survey targeting, and contribution encouragenemt and co...
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.