Solid

fakeprocessor.cpp
1/*
2 SPDX-FileCopyrightText: 2006 Michaƫl Larouche <michael.larouche@kdemail.net>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#include "fakeprocessor.h"
8
9#include <QStringList>
10#include <QVariant>
11
12using namespace Solid::Backends::Fake;
13
14FakeProcessor::FakeProcessor(FakeDevice *device)
15 : FakeDeviceInterface(device)
16{
17}
18
19FakeProcessor::~FakeProcessor()
20{
21}
22
23int FakeProcessor::number() const
24{
25 return fakeDevice()->property(QStringLiteral("number")).toInt();
26}
27
28int FakeProcessor::maxSpeed() const
29{
30 return fakeDevice()->property(QStringLiteral("maxSpeed")).toInt();
31}
32
33bool FakeProcessor::canChangeFrequency() const
34{
35 return fakeDevice()->property(QStringLiteral("canChangeFrequency")).toBool();
36}
37
38Solid::Processor::InstructionSets FakeProcessor::instructionSets() const
39{
41
42 const QStringList extension_list = fakeDevice()->property(QStringLiteral("instructionSets")).toString().split(QLatin1Char(','));
43 for (const QString &extension_str : extension_list) {
44 if (extension_str == QLatin1String("mmx")) {
45 result |= Solid::Processor::IntelMmx;
46 } else if (extension_str == QLatin1String("sse")) {
47 result |= Solid::Processor::IntelSse;
48 } else if (extension_str == QLatin1String("sse2")) {
49 result |= Solid::Processor::IntelSse2;
50 } else if (extension_str == QLatin1String("sse3")) {
51 result |= Solid::Processor::IntelSse3;
52 } else if (extension_str == QLatin1String("sse4")) {
53 result |= Solid::Processor::IntelSse4;
54 } else if (extension_str == QLatin1String("3dnow")) {
55 result |= Solid::Processor::Amd3DNow;
56 } else if (extension_str == QLatin1String("altivec")) {
57 result |= Solid::Processor::AltiVec;
58 }
59 }
60
61 return result;
62}
63
64#include "moc_fakeprocessor.cpp"
QStringList split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const const
bool toBool() const const
int toInt(bool *ok) const const
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:23 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.