Changeset View
Changeset View
Standalone View
Standalone View
src/systeminformation.cpp
Show All 31 Lines | |||||
32 | #include <KProcess> | 32 | #include <KProcess> | ||
33 | #include "drkonqi_debug.h" | 33 | #include "drkonqi_debug.h" | ||
34 | #include <KConfig> | 34 | #include <KConfig> | ||
35 | #include <KConfigGroup> | 35 | #include <KConfigGroup> | ||
36 | #include <KSharedConfig> | 36 | #include <KSharedConfig> | ||
37 | #include <kcoreaddons_version.h> | 37 | #include <kcoreaddons_version.h> | ||
38 | #include <KCoreAddons> | 38 | #include <KCoreAddons> | ||
39 | #include <KOSRelease> | 39 | #include <KOSRelease> | ||
40 | #include <KWindowSystem> | ||||
40 | #include <QStandardPaths> | 41 | #include <QStandardPaths> | ||
41 | 42 | | |||
42 | static const QString OS_UNSPECIFIED = QStringLiteral("unspecified"); | 43 | static const QString OS_UNSPECIFIED = QStringLiteral("unspecified"); | ||
43 | static const QString PLATFORM_UNSPECIFIED = QStringLiteral("unspecified"); | 44 | static const QString PLATFORM_UNSPECIFIED = QStringLiteral("unspecified"); | ||
44 | 45 | | |||
45 | // This function maps the operating system to an OS value that is | 46 | // This function maps the operating system to an OS value that is | ||
46 | // accepted by bugs.kde.org. If the values change on the server | 47 | // accepted by bugs.kde.org. If the values change on the server | ||
47 | // side, they need to be updated here as well. | 48 | // side, they need to be updated here as well. | ||
▲ Show 20 Lines • Show All 236 Lines • ▼ Show 20 Line(s) | |||||
284 | { | 285 | { | ||
285 | return KCoreAddons::versionString(); | 286 | return KCoreAddons::versionString(); | ||
286 | } | 287 | } | ||
287 | 288 | | |||
288 | bool SystemInformation::complete() const | 289 | bool SystemInformation::complete() const | ||
289 | { | 290 | { | ||
290 | return m_complete; | 291 | return m_complete; | ||
291 | } | 292 | } | ||
293 | | ||||
294 | QString SystemInformation::windowSystem() const | ||||
295 | { | ||||
296 | switch (KWindowSystem::platform()) { | ||||
297 | case KWindowSystem::Platform::Unknown: | ||||
298 | return QStringLiteral("Unknown"); | ||||
299 | case KWindowSystem::Platform::X11: | ||||
300 | return QStringLiteral("X11"); | ||||
301 | case KWindowSystem::Platform::Wayland: | ||||
302 | return QStringLiteral("Wayland"); | ||||
303 | } | ||||
304 | Q_UNREACHABLE(); | ||||
305 | } | ||||
sitter: You should probably just return QStringLiteral("Unknown") instead. The unreachable is fairly… |
You should probably just return QStringLiteral("Unknown") instead. The unreachable is fairly dangerous here. If the enum gets extended but not immediately updated in drkonqi this will lead to undefined behavior.