| 1 | // SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. |
| 2 | // |
| 3 | // SPDX-License-Identifier: LGPL-3.0-or-later |
| 4 | |
| 5 | #include "global.h" |
| 6 | |
| 7 | #include "dwaylandintegration.h" |
| 8 | |
| 9 | #include <qpa/qplatformintegrationplugin.h> |
| 10 | |
| 11 | DPP_USE_NAMESPACE |
| 12 | |
| 13 | QT_BEGIN_NAMESPACE |
| 14 | |
| 15 | class DWaylandIntegrationPlugin : public QPlatformIntegrationPlugin |
| 16 | { |
| 17 | Q_OBJECT |
| 18 | Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "dwayland.json") |
| 19 | public: |
| 20 | QPlatformIntegration *create(const QString&, const QStringList&) override; |
| 21 | }; |
| 22 | |
| 23 | QPlatformIntegration* DWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) |
| 24 | { |
| 25 | #ifdef Q_OS_LINUX |
| 26 | Q_UNUSED(system); |
| 27 | Q_UNUSED(paramList); |
| 28 | auto *integration = DWaylandIntegration::instance(); |
| 29 | |
| 30 | if (integration->hasFailed()) { |
| 31 | delete integration; |
| 32 | integration = nullptr; |
| 33 | } |
| 34 | |
| 35 | return integration; |
| 36 | #endif |
| 37 | |
| 38 | return nullptr; |
| 39 | } |
| 40 | |
| 41 | QT_END_NAMESPACE |
| 42 | |
| 43 | #include "main.moc" |