diff --git a/Linphone/core/setting/SettingsCore.cpp b/Linphone/core/setting/SettingsCore.cpp index 8f90f5bd2..fb8f07dd2 100644 --- a/Linphone/core/setting/SettingsCore.cpp +++ b/Linphone/core/setting/SettingsCore.cpp @@ -61,6 +61,9 @@ SettingsCore::SettingsCore(QObject *parent) : QObject(parent) { mRingtoneFolder = mRingtonePath.left(mRingtonePath.lastIndexOf(QDir::separator())); } + // Network + mIpv6Enabled = settingsModel->getIpv6Enabled(); + // Audio mCaptureDevices = settingsModel->getCaptureDevices(); mPlaybackDevices = settingsModel->getPlaybackDevices(); @@ -162,6 +165,9 @@ SettingsCore::SettingsCore(const SettingsCore &settingsCore) { mAutoDownloadReceivedFiles = settingsCore.mAutoDownloadReceivedFiles; mAutomaticallyRecordCallsEnabled = settingsCore.mAutomaticallyRecordCallsEnabled; + // Network + mIpv6Enabled = settingsCore.mIpv6Enabled; + // Audio mCaptureDevices = settingsCore.mCaptureDevices; mPlaybackDevices = settingsCore.mPlaybackDevices; @@ -260,6 +266,11 @@ void SettingsCore::setSelf(QSharedPointer me) { mSettingsModelConnection->invokeToCore([this, enabled]() { setEchoCancellationEnabled(enabled); }); }); + // IP V6 + mSettingsModelConnection->makeConnectToModel(&SettingsModel::ipv6EnabledChanged, [this](const bool enabled) { + mSettingsModelConnection->invokeToCore([this, enabled]() { setIpv6Enabled(enabled); }); + }); + // Auto download incoming files mSettingsModelConnection->makeConnectToModel( &SettingsModel::autoDownloadReceivedFilesChanged, [this](const bool enabled) { @@ -508,6 +519,9 @@ void SettingsCore::reset(const SettingsCore &settingsCore) { setEchoCancellationEnabled(settingsCore.mEchoCancellationEnabled); setAutomaticallyRecordCallsEnabled(settingsCore.mAutomaticallyRecordCallsEnabled); + // Network + setIpv6Enabled(settingsCore.mIpv6Enabled); + setAutoDownloadReceivedFiles(settingsCore.mAutoDownloadReceivedFiles); // Audio setCaptureDevices(settingsCore.mCaptureDevices); @@ -624,6 +638,14 @@ void SettingsCore::setEchoCancellationEnabled(bool enabled) { } } +void SettingsCore::setIpv6Enabled(bool enabled) { + if (mIpv6Enabled != enabled) { + mIpv6Enabled = enabled; + emit ipv6EnabledChanged(); + setIsSaved(false); + } +} + void SettingsCore::setAutoDownloadReceivedFiles(bool enabled) { if (mAutoDownloadReceivedFiles != enabled) { mAutoDownloadReceivedFiles = enabled; @@ -1067,6 +1089,9 @@ void SettingsCore::writeIntoModel(std::shared_ptr model) const { model->setEchoCancellationEnabled(mEchoCancellationEnabled); model->setAutomaticallyRecordCallsEnabled(mAutomaticallyRecordCallsEnabled); + // Network + model->setIpv6Enabled(mIpv6Enabled); + // Chat model->setAutoDownloadReceivedFiles(mAutoDownloadReceivedFiles); @@ -1138,6 +1163,9 @@ void SettingsCore::writeFromModel(const std::shared_ptr &model) { mRingtoneFileName = ringtone.exists() ? ringtone.fileName() : mRingtonePath.right(mRingtonePath.lastIndexOf(QDir::separator())); + // Network + mIpv6Enabled = model->getIpv6Enabled(); + // Chat mAutoDownloadReceivedFiles = model->getAutoDownloadReceivedFiles(); diff --git a/Linphone/core/setting/SettingsCore.hpp b/Linphone/core/setting/SettingsCore.hpp index b7f8d1a82..c60ba228d 100644 --- a/Linphone/core/setting/SettingsCore.hpp +++ b/Linphone/core/setting/SettingsCore.hpp @@ -62,6 +62,9 @@ public: Q_PROPERTY(QVariantMap playbackDevice READ getPlaybackDevice WRITE setPlaybackDevice NOTIFY playbackDeviceChanged) Q_PROPERTY(QVariantMap ringerDevice READ getRingerDevice WRITE setRingerDevice NOTIFY ringerDeviceChanged) + // Network + Q_PROPERTY(bool ipv6Enabled READ getIpv6Enabled WRITE setIpv6Enabled NOTIFY ipv6EnabledChanged) + Q_PROPERTY( QVariantMap conferenceLayout READ getConferenceLayout WRITE setConferenceLayout NOTIFY conferenceLayoutChanged) Q_PROPERTY( @@ -195,6 +198,13 @@ public: Q_INVOKABLE void closeCallSettings(); Q_INVOKABLE void updateMicVolume() const; + // Network. -------------------------------------------------------------------- + + bool getIpv6Enabled() { + return mIpv6Enabled; + } + void setIpv6Enabled(bool enabled); + bool getLogsEnabled() const; void setLogsEnabled(bool enabled); @@ -245,7 +255,6 @@ public: DECLARE_CORE_GETSET(bool, autoStart, AutoStart) DECLARE_CORE_GETSET(bool, exitOnClose, ExitOnClose) DECLARE_CORE_GETSET(bool, syncLdapContacts, SyncLdapContacts) - DECLARE_CORE_GETSET_MEMBER(bool, ipv6Enabled, Ipv6Enabled) DECLARE_CORE_GETSET(QString, configLocale, ConfigLocale) DECLARE_CORE_GETSET(QString, downloadFolder, DownloadFolder) // Read-only @@ -285,6 +294,10 @@ signals: void captureDevicesChanged(const QVariantList &devices); void playbackDevicesChanged(const QVariantList &devices); void ringerDevicesChanged(const QVariantList &devices); + + // Network + void ipv6EnabledChanged(); + void conferenceLayoutsChanged(const QVariantList &layouts); void mediaEncryptionsChanged(const QVariantList &encryptions); @@ -383,6 +396,9 @@ private: float mPlaybackGain; int mEchoCancellationCalibration; + // Network + bool mIpv6Enabled; + // Debug logs bool mLogsEnabled; bool mFullLogsEnabled;