File indexing completed on 2024-05-12 05:36:09

0001 /*
0002  *   SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez <aleixpol@kde.org>
0003  *
0004  *   SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #include "quicksetting.h"
0008 
0009 QuickSetting::QuickSetting(QObject *parent)
0010     : QObject(parent)
0011 {
0012 }
0013 
0014 void QuickSetting::setEnabled(bool enabled)
0015 {
0016     if (m_enabled == enabled)
0017         return;
0018 
0019     m_enabled = enabled;
0020     Q_EMIT enabledChanged(enabled);
0021 }
0022 
0023 void QuickSetting::setAvailable(bool available)
0024 {
0025     if (m_available == available)
0026         return;
0027 
0028     m_available = available;
0029     Q_EMIT availableChanged(available);
0030 }
0031 
0032 void QuickSetting::setSettingsCommand(const QString &settingsCommand)
0033 {
0034     if (m_settingsCommand == settingsCommand)
0035         return;
0036 
0037     m_settingsCommand = settingsCommand;
0038     Q_EMIT settingsCommandChanged(settingsCommand);
0039 }
0040 
0041 void QuickSetting::setIconName(const QString &iconName)
0042 {
0043     if (m_iconName == iconName)
0044         return;
0045 
0046     m_iconName = iconName;
0047     Q_EMIT iconNameChanged(iconName);
0048 }
0049 
0050 void QuickSetting::setText(const QString &text)
0051 {
0052     if (m_text == text)
0053         return;
0054 
0055     m_text = text;
0056     Q_EMIT textChanged(text);
0057 }
0058 
0059 void QuickSetting::setStatus(const QString &status)
0060 {
0061     if (m_status == status)
0062         return;
0063 
0064     m_status = status;
0065     Q_EMIT statusChanged(status);
0066 }
0067 
0068 QQmlListProperty<QObject> QuickSetting::children()
0069 {
0070     return QQmlListProperty<QObject>(this, &m_children);
0071 }