Commit 01318fcf authored by Méven Car's avatar Méven Car
Browse files

About-distro: Merge bits with kernel version entry

parent 6a5b7112
/*
SPDX-FileCopyrightText: 2012-2020 Harald Sitter <sitter@kde.org>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
#include "BitEntry.h"
BitEntry::BitEntry()
: Entry(ki18n("OS Type:"), QString())
{
}
QString BitEntry::localizedValue(Entry::Language language) const
{
const int bits = QT_POINTER_SIZE == 8 ? 64 : 32;
return localize(ki18nc("@label %1 is the CPU bit width (e.g. 32 or 64)",
"%1-bit").subs(QString::number(bits)),
language);
}
/*
SPDX-FileCopyrightText: 2012-2020 Harald Sitter <sitter@kde.org>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
#ifndef BITENTRY_H
#define BITENTRY_H
#include "Entry.h"
#include <QString>
class BitEntry : public Entry
{
public:
BitEntry();
QString localizedValue(Language language = Language::System) const final;
};
#endif // BITENTRY_H
......@@ -8,7 +8,6 @@ set(kcm_SRCS
PlasmaEntry.cpp
KernelEntry.cpp
SectionLabel.cpp
BitEntry.cpp
MemoryEntry.cpp
GraphicsPlatformEntry.cpp
CPUEntry.cpp
......
......@@ -8,15 +8,18 @@
#include <sys/utsname.h>
KernelEntry::KernelEntry()
: Entry(ki18n("Kernel Version:"), kernelVersion())
: Entry(ki18n("Kernel Version:"), QString())
{
}
QString KernelEntry::kernelVersion()
QString KernelEntry::localizedValue(Language language) const
{
struct utsname utsName;
if (uname(&utsName) == 0) {
return QString::fromLatin1(utsName.release);
if (uname(&utsName) != 0) {
return QString();
}
return QString();
const int bits = QT_POINTER_SIZE == 8 ? 64 : 32;
return localize(ki18nc("@label %1 is the kernel version, %2 CPU bit width (e.g. 32 or 64)",
"%1 (%2-bit)").subs(utsName.release).subs(QString::number(bits)),
language);
}
......@@ -12,7 +12,7 @@ class KernelEntry : public Entry
{
public:
KernelEntry();
static QString kernelVersion();
QString localizedValue(Language language = Language::System) const override;
};
#endif // KERNELENTRY_H
......@@ -19,7 +19,6 @@
#include <KSharedConfig>
#include "CPUEntry.h"
#include "BitEntry.h"
#include "GraphicsPlatformEntry.h"
#include "GPUEntry.h"
#include "KernelEntry.h"
......@@ -184,7 +183,6 @@ void Module::loadEntries()
new Entry(ki18n("KDE Frameworks Version:"), KCoreAddons::versionString()),
new Entry(ki18n("Qt Version:"), QString::fromLatin1(qVersion())),
new KernelEntry(),
new BitEntry(),
new GraphicsPlatformEntry()
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment