File indexing completed on 2025-02-09 06:35:13

0001 /*
0002     SPDX-FileCopyrightText: 2021 Méven Car <meven.car@kdemail.net>
0003     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 */
0005 
0006 #include "GraphicsPlatformEntry.h"
0007 #include <QGuiApplication>
0008 
0009 GraphicsPlatformEntry::GraphicsPlatformEntry()
0010     : Entry(ki18n("Graphics Platform:"), graphicsPlatform())
0011 {
0012 }
0013 
0014 QString GraphicsPlatformEntry::graphicsPlatform()
0015 {
0016     const QString platformName = QGuiApplication::platformName();
0017     if (platformName.startsWith(QLatin1String("xcb"), Qt::CaseInsensitive)) {
0018         return QStringLiteral("X11");
0019     }
0020     if (platformName.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
0021         return QStringLiteral("Wayland");
0022     }
0023     return platformName;
0024 }