File indexing completed on 2024-02-25 05:45:26

0001 /*
0002     SPDX-FileCopyrightText: 2021 Andreas Cord-Landwehr <cordlandwehr@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #include "configurationproxy.h"
0008 
0009 ConfigurationProxy::ConfigurationProxy(QObject *parent)
0010     : QObject(parent)
0011     , mConfiguration(&Configuration::self())
0012 {
0013     connect(mConfiguration, &Configuration::airplaneModeEnabledChanged, this, &ConfigurationProxy::airplaneModeEnabledChanged);
0014     connect(mConfiguration, &Configuration::manageVirtualConnectionsChanged, this, &ConfigurationProxy::manageVirtualConnectionsChanged);
0015 }
0016 
0017 bool ConfigurationProxy::unlockModemOnDetection() const
0018 {
0019     if (!mConfiguration) {
0020         return false;
0021     }
0022     return mConfiguration->unlockModemOnDetection();
0023 }
0024 
0025 void ConfigurationProxy::setUnlockModemOnDetection(bool unlock)
0026 {
0027     if (mConfiguration) {
0028         mConfiguration->setUnlockModemOnDetection(unlock);
0029     }
0030 }
0031 
0032 bool ConfigurationProxy::manageVirtualConnections() const
0033 {
0034     if (!mConfiguration) {
0035         return false;
0036     }
0037     return mConfiguration->manageVirtualConnections();
0038 }
0039 
0040 void ConfigurationProxy::setManageVirtualConnections(bool manage)
0041 {
0042     if (mConfiguration) {
0043         mConfiguration->setManageVirtualConnections(manage);
0044     }
0045 }
0046 
0047 bool ConfigurationProxy::airplaneModeEnabled() const
0048 {
0049     if (!mConfiguration) {
0050         return false;
0051     }
0052     return mConfiguration->airplaneModeEnabled();
0053 }
0054 
0055 void ConfigurationProxy::setAirplaneModeEnabled(bool enabled)
0056 {
0057     if (mConfiguration) {
0058         mConfiguration->setAirplaneModeEnabled(enabled);
0059     }
0060 }
0061 
0062 QString ConfigurationProxy::hotspotName() const
0063 {
0064     return mConfiguration->hotspotName();
0065 }
0066 
0067 void ConfigurationProxy::setHotspotName(const QString &name)
0068 {
0069     if (mConfiguration) {
0070         mConfiguration->setHotspotName(name);
0071     }
0072 }
0073 
0074 QString ConfigurationProxy::hotspotPassword() const
0075 {
0076     return mConfiguration->hotspotPassword();
0077 }
0078 
0079 void ConfigurationProxy::setHotspotPassword(const QString &password)
0080 {
0081     if (mConfiguration) {
0082         mConfiguration->setHotspotPassword(password);
0083     }
0084 }
0085 
0086 QString ConfigurationProxy::hotspotConnectionPath() const
0087 {
0088     return mConfiguration->hotspotConnectionPath();
0089 }
0090 
0091 void ConfigurationProxy::setHotspotConnectionPath(const QString &path)
0092 {
0093     if (mConfiguration) {
0094         mConfiguration->setHotspotConnectionPath(path);
0095     }
0096 }
0097 
0098 bool ConfigurationProxy::showPasswordDialog() const
0099 {
0100     if (!mConfiguration) {
0101         return false;
0102     }
0103     return mConfiguration->showPasswordDialog();
0104 }
0105 
0106 bool ConfigurationProxy::systemConnectionsByDefault() const
0107 {
0108     if (!mConfiguration) {
0109         return false;
0110     }
0111 
0112     return mConfiguration->systemConnectionsByDefault();
0113 }
0114 
0115 #include "moc_configurationproxy.cpp"