mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Move from a C++ library + QML plugin to a QML plugin only for simplicity, since the homescreen switching architecture will be done from Plasma, and so use of the shell library only needs to be from QML.
49 lines
1.3 KiB
C++
49 lines
1.3 KiB
C++
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include "mobileshellsettings.h"
|
|
#include "qqml.h"
|
|
#include "quicksetting.h"
|
|
#include "savedquicksettingsmodel.h"
|
|
|
|
#include <KPackage/Package>
|
|
#include <KPluginMetaData>
|
|
|
|
#include <QAbstractListModel>
|
|
#include <QQmlListProperty>
|
|
#include <QTimer>
|
|
|
|
/**
|
|
* @short A model that reads quick settings configurations
|
|
* from the config and presents models to display them.
|
|
*
|
|
* @author Devin Lin <devin@kde.org>
|
|
**/
|
|
class SavedQuickSettings : public QObject
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(SavedQuickSettingsModel *enabledModel READ enabledQuickSettingsModel CONSTANT)
|
|
Q_PROPERTY(SavedQuickSettingsModel *disabledModel READ disabledQuickSettingsModel CONSTANT)
|
|
|
|
public:
|
|
SavedQuickSettings(QObject *parent = nullptr);
|
|
|
|
SavedQuickSettingsModel *enabledQuickSettingsModel() const;
|
|
SavedQuickSettingsModel *disabledQuickSettingsModel() const;
|
|
|
|
private:
|
|
void refreshModel();
|
|
void saveModel();
|
|
|
|
MobileShellSettings *m_settings;
|
|
QList<KPluginMetaData *> m_validPackages;
|
|
QList<KPluginMetaData *> m_enabledPackages;
|
|
QList<KPluginMetaData *> m_disabledPackages;
|
|
|
|
SavedQuickSettingsModel *m_enabledQSModel;
|
|
SavedQuickSettingsModel *m_disabledQSModel;
|
|
|
|
QTimer *m_updateTimer;
|
|
};
|