File indexing completed on 2024-12-15 03:45:03
0001 /* 0002 SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: MIT 0005 */ 0006 0007 #include "applicationversionsource.h" 0008 0009 #include <QCoreApplication> 0010 #include <QVariant> 0011 0012 using namespace KUserFeedback; 0013 0014 ApplicationVersionSource::ApplicationVersionSource() : 0015 AbstractDataSource(QStringLiteral("applicationVersion"), Provider::BasicSystemInformation) 0016 { 0017 } 0018 0019 QString ApplicationVersionSource::description() const 0020 { 0021 return tr("The version of the application."); 0022 } 0023 0024 QVariant ApplicationVersionSource::data() 0025 { 0026 if (QCoreApplication::applicationVersion().isEmpty()) 0027 return QVariant(); 0028 0029 QVariantMap m; 0030 m.insert(QStringLiteral("value"), QCoreApplication::applicationVersion()); 0031 return m; 0032 } 0033 0034 QString ApplicationVersionSource::name() const 0035 { 0036 return tr("Application version"); 0037 }