Commit 6a5b7112 authored by Méven Car's avatar Méven Car
Browse files

About-distro: display Graphics Platform (X11 or Wayland)

Also include it in the copy to clipboard output.

BUG: 428382
parent 245bb3e6
......@@ -10,6 +10,7 @@ set(kcm_SRCS
SectionLabel.cpp
BitEntry.cpp
MemoryEntry.cpp
GraphicsPlatformEntry.cpp
CPUEntry.cpp
GPUEntry.cpp
FancyString.cpp
......
/*
SPDX-FileCopyrightText: 2021 Méven Car <meven.car@kdemail.net>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
#include "GraphicsPlatformEntry.h"
#include <QGuiApplication>
GraphicsPlatformEntry::GraphicsPlatformEntry()
: Entry(ki18n("Graphics Platform:"), graphicsPlatform())
{
}
QString GraphicsPlatformEntry::graphicsPlatform()
{
const QString platformName = QGuiApplication::platformName();
if (platformName.startsWith(QLatin1String("xcb"), Qt::CaseInsensitive)) {
return QStringLiteral("X11");
}
if (platformName.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
return QStringLiteral("Wayland");
}
return platformName;
}
/*
SPDX-FileCopyrightText: 2021 Méven Car <meven.car@kdemail.net>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
#ifndef GRAPHICSPLATFORMENTRY_H
#define GRAPHICSPLATFORMENTRY_H
#include "Entry.h"
class GraphicsPlatformEntry : public Entry
{
public:
GraphicsPlatformEntry();
static QString graphicsPlatform();
};
#endif // GRAPHICSPLATFORMENTRY_H
......@@ -20,6 +20,7 @@
#include "CPUEntry.h"
#include "BitEntry.h"
#include "GraphicsPlatformEntry.h"
#include "GPUEntry.h"
#include "KernelEntry.h"
#include "MemoryEntry.h"
......@@ -183,7 +184,8 @@ void Module::loadEntries()
new Entry(ki18n("KDE Frameworks Version:"), KCoreAddons::versionString()),
new Entry(ki18n("Qt Version:"), QString::fromLatin1(qVersion())),
new KernelEntry(),
new BitEntry()
new BitEntry(),
new GraphicsPlatformEntry()
});
// hardware
......
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