| 1 | // Copyright (C) 2017-2018 Red Hat, Inc |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #include <qpa/qplatformthemeplugin.h> |
| 5 | #include "qxdgdesktopportaltheme.h" |
| 6 | |
| 7 | QT_BEGIN_NAMESPACE |
| 8 | |
| 9 | using namespace Qt::StringLiterals; |
| 10 | |
| 11 | class QXdgDesktopPortalThemePlugin : public QPlatformThemePlugin |
| 12 | { |
| 13 | Q_OBJECT |
| 14 | Q_PLUGIN_METADATA(IID QPlatformThemeFactoryInterface_iid FILE "xdgdesktopportal.json") |
| 15 | |
| 16 | public: |
| 17 | QPlatformTheme *create(const QString &key, const QStringList ¶ms) override; |
| 18 | }; |
| 19 | |
| 20 | QPlatformTheme *QXdgDesktopPortalThemePlugin::create(const QString &key, const QStringList ¶ms) |
| 21 | { |
| 22 | Q_UNUSED(params); |
| 23 | if (!key.compare(other: "xdgdesktopportal"_L1, cs: Qt::CaseInsensitive) || |
| 24 | !key.compare(other: "flatpak"_L1, cs: Qt::CaseInsensitive) || |
| 25 | !key.compare(other: "snap"_L1, cs: Qt::CaseInsensitive)) |
| 26 | return new QXdgDesktopPortalTheme; |
| 27 | |
| 28 | return nullptr; |
| 29 | } |
| 30 | |
| 31 | QT_END_NAMESPACE |
| 32 | |
| 33 | #include "main.moc" |
| 34 |
