File indexing completed on 2024-09-15 04:49:26
0001 /** 0002 * SPDX-FileCopyrightText: 2022 Suhaas Joshi <joshiesuhaas0@gmail.com> 0003 * SPDX-FileCopyrightText: 2023 ivan tkachenko <me@ratijas.tk> 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "flatpakreference.h" 0010 0011 #include <KQuickManagedConfigModule> 0012 0013 class KCMFlatpak : public KQuickManagedConfigModule 0014 { 0015 Q_OBJECT 0016 Q_PROPERTY(FlatpakReferencesModel *refsModel MEMBER m_refsModel CONSTANT) 0017 public: 0018 /** 0019 * This KCM manages permissions for Flatpak application. It can open any 0020 * installed application page directly: use @param args in the form of 0021 * ["<ref>"], where <ref> is a FlatpakRef in formatted like "app/org.videolan.VLC/x86_64/stable". 0022 */ 0023 explicit KCMFlatpak(QObject *parent, const KPluginMetaData &data, const QVariantList &args); 0024 0025 Q_INVOKABLE bool isSaveNeeded() const override; 0026 Q_INVOKABLE bool isDefaults() const override; 0027 Q_INVOKABLE int currentIndex() const; 0028 0029 public Q_SLOTS: 0030 void load() override; 0031 void save() override; 0032 void defaults() override; 0033 void setIndex(int index); 0034 0035 private: 0036 FlatpakReferencesModel *m_refsModel; 0037 int m_index = -1; 0038 };