summaryrefslogtreecommitdiffstats
path: root/src/plugins/platformthemes/xdgdesktopportal/main.cpp
blob: efbc16b3d2ebce50dbb7f5013faac262545c3e0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (C) 2017-2018 Red Hat, Inc
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#include <qpa/qplatformthemeplugin.h>
#include "qxdgdesktopportaltheme.h"

QT_BEGIN_NAMESPACE

using namespace Qt::StringLiterals;

class QXdgDesktopPortalThemePlugin : public QPlatformThemePlugin
{
   Q_OBJECT
   Q_PLUGIN_METADATA(IID QPlatformThemeFactoryInterface_iid FILE "xdgdesktopportal.json")

public:
    QPlatformTheme *create(const QString &key, const QStringList &params) override;
};

QPlatformTheme *QXdgDesktopPortalThemePlugin::create(const QString &key, const QStringList &params)
{
    Q_UNUSED(params);
    if (!key.compare("xdgdesktopportal"_L1, Qt::CaseInsensitive) ||
        !key.compare("flatpak"_L1, Qt::CaseInsensitive) ||
        !key.compare("snap"_L1, Qt::CaseInsensitive))
        return new QXdgDesktopPortalTheme;

    return nullptr;
}

QT_END_NAMESPACE

#include "main.moc"