File indexing completed on 2024-09-01 11:44:03
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 <KQuickAddons/ManagedConfigModule> 0012 0013 class KCMFlatpak : public KQuickAddons::ManagedConfigModule 0014 { 0015 Q_OBJECT 0016 Q_PROPERTY(FlatpakReferencesModel *refsModel MEMBER m_refsModel CONSTANT) 0017 public: 0018 explicit KCMFlatpak(QObject *parent, const KPluginMetaData &data, const QVariantList &args); 0019 0020 Q_INVOKABLE bool isSaveNeeded() const override; 0021 Q_INVOKABLE bool isDefaults() const override; 0022 Q_INVOKABLE int currentIndex() const; 0023 0024 public Q_SLOTS: 0025 void load() override; 0026 void save() override; 0027 void defaults() override; 0028 void setIndex(int index); 0029 0030 private: 0031 FlatpakReferencesModel *m_refsModel; 0032 int m_index = -1; 0033 };