Changeset View
Changeset View
Standalone View
Standalone View
Modules/about-distro/src/KernelEntry.cpp
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | SPDX-FileCopyrightText: 2012-2020 Harald Sitter <sitter@kde.org> | ||||
3 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL | ||||
4 | */ | ||||
5 | | ||||
6 | #include "KernelEntry.h" | ||||
7 | | ||||
8 | #include <sys/utsname.h> | ||||
9 | | ||||
10 | KernelEntry::KernelEntry() | ||||
11 | : Entry(ki18n("Kernel Version:"), kernelVersion()) | ||||
12 | { | ||||
13 | } | ||||
14 | | ||||
15 | QString KernelEntry::kernelVersion() | ||||
16 | { | ||||
17 | struct utsname utsName; | ||||
18 | if (uname(&utsName) == 0) { | ||||
19 | return QString::fromLatin1(utsName.release); | ||||
20 | } | ||||
21 | return QString(); | ||||
22 | } |