File indexing completed on 2024-12-15 03:45:03
0001 /* 0002 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: MIT 0005 */ 0006 0007 #include "cpuinfosource.h" 0008 0009 #include <QSysInfo> 0010 #include <QThread> 0011 #include <QVariant> 0012 0013 using namespace KUserFeedback; 0014 0015 CpuInfoSource::CpuInfoSource() 0016 : AbstractDataSource(QStringLiteral("cpu"), Provider::DetailedSystemInformation) 0017 { 0018 } 0019 0020 QString CpuInfoSource::description() const 0021 { 0022 return tr("The amount and type of CPUs in the system."); 0023 } 0024 0025 QVariant CpuInfoSource::data() 0026 { 0027 QVariantMap m; 0028 m.insert(QStringLiteral("architecture"), QSysInfo::currentCpuArchitecture()); 0029 m.insert(QStringLiteral("count"), QThread::idealThreadCount()); 0030 return m; 0031 } 0032 0033 QString CpuInfoSource::name() const 0034 { 0035 return tr("CPU information"); 0036 }