// SPDX-FileCopyrightText: 2021 Jonah BrĂ¼chert // // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include #include #include struct WebApp { QString name; QString icon; QString url; }; class WebAppManager : public QObject { Q_OBJECT public: explicit WebAppManager(QObject *parent = nullptr); static QString desktopFileDirectory(); static QString iconDirectory(); const std::vector &applications() const; void addApp(const QString &name, const QString &url, const QImage &icon); bool exists(const QString &name); bool removeApp(const QString &name); static WebAppManager &instance(); Q_SIGNALS: void applicationsChanged(); private: static QString generateFileName(const QString &name); static QString generateDesktopFileName(const QString &name); static QString webAppCommand(); private: QDir m_desktopFileDirectory; std::vector m_webApps; };