/* SPDX-FileCopyrightText: 2020 David Redondo SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL */ #pragma once #include #include "basemodel.h" class QDBusError; class KConfigBase; class KGlobalAccelInterface; class KGlobalShortcutInfo; class FilteredShortcutsModel; class GlobalAccelModel : public BaseModel { Q_OBJECT public: GlobalAccelModel(KGlobalAccelInterface *interface, QObject *parent = nullptr); QVariant data(const QModelIndex &index, int role) const override; void addApplication(const QString &desktopFileName, const QString &displayName); void exportToConfig(KConfigBase &config) override; void importConfig(const KConfigBase &config) override; void load() override; void save() override; Q_SIGNALS: void errorOccured(const QString &); void applicationAdded(const Component &); private: Component loadComponent(const QList &info); void removeComponent(const Component &component); void genericErrorOccured(const QString &description, const QDBusError &error); QList m_pendingComponents; KGlobalAccelInterface *m_globalAccelInterface; };