Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KInfoCenter
Commits
01318fcf
Commit
01318fcf
authored
Jan 25, 2021
by
Méven Car
Browse files
About-distro: Merge bits with kernel version entry
parent
6a5b7112
Changes
6
Hide whitespace changes
Inline
Side-by-side
Modules/about-distro/src/BitEntry.cpp
deleted
100644 → 0
View file @
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
);
}
Modules/about-distro/src/BitEntry.h
deleted
100644 → 0
View file @
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
*/
#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
Modules/about-distro/src/CMakeLists.txt
View file @
01318fcf
...
...
@@ -8,7 +8,6 @@ set(kcm_SRCS
PlasmaEntry.cpp
KernelEntry.cpp
SectionLabel.cpp
BitEntry.cpp
MemoryEntry.cpp
GraphicsPlatformEntry.cpp
CPUEntry.cpp
...
...
Modules/about-distro/src/KernelEntry.cpp
View file @
01318fcf
...
...
@@ -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
);
}
Modules/about-distro/src/KernelEntry.h
View file @
01318fcf
...
...
@@ -12,7 +12,7 @@ class KernelEntry : public Entry
{
public:
KernelEntry
();
static
QString
kernelVersion
()
;
QString
localizedValue
(
Language
language
=
Language
::
System
)
const
override
;
};
#endif // KERNELENTRY_H
Modules/about-distro/src/Module.cpp
View file @
01318fcf
...
...
@@ -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
()
});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment