<commit_before>#include "DeclarativeSettings.hpp"

#include <QLoggingCategory>

namespace Telegram {

namespace Client {

DeclarativeRsaKey::DeclarativeRsaKey(QObject *parent)
    : QObject(parent)
{
}

bool DeclarativeRsaKey::isValid() const
{
    return m_key.isValid();
}

bool DeclarativeRsaKey::loadDefault() const
{
    return m_loadDefaultKey;
}

void DeclarativeRsaKey::setFileName(const QString &fileName)
{
    qDebug() << Q_FUNC_INFO << fileName;
    if (m_fileName == fileName) {
        return;
    }
    m_fileName = fileName;
    if (!fileName.isEmpty()) {
        setKey(RsaKey::fromFile(QUrl::fromUserInput(fileName).toLocalFile()));
    }
    emit fileNameChanged(fileName);
}

void DeclarativeRsaKey::setLoadDefault(bool loadDefault)
{
    if (m_loadDefaultKey == loadDefault) {
        return;
    }
    m_loadDefaultKey = loadDefault;
    if (loadDefault) {
        setKey(RsaKey::defaultKey());
    }
    emit loadDefaultChanged(loadDefault);
}

void DeclarativeRsaKey::setKey(const RsaKey &key)
{
    RsaKey oldKey = m_key;
    m_key = key;
    if (oldKey.isValid() != key.isValid()) {
        emit validChanged(key.isValid());
    }
}

DeclarativeProxySettings::DeclarativeProxySettings(QObject *parent) :
    QObject(parent)
{
}

void DeclarativeProxySettings::setPort(quint16 port)
{
    m_port = port;
}

void DeclarativeProxySettings::setAddress(const QString &address)
{
    m_address = address;
}

DeclarativeSettings::DeclarativeSettings(QObject *parent) :
    Settings(parent)
{
    m_proxySettings = new DeclarativeProxySettings(this);<commit_msg>Declarative: Fix signals emission in ProxySettings<commit_after>#include "DeclarativeSettings.hpp"

#include <QLoggingCategory>

namespace Telegram {

namespace Client {

DeclarativeRsaKey::DeclarativeRsaKey(QObject *parent)
    : QObject(parent)
{
}

bool DeclarativeRsaKey::isValid() const
{
    return m_key.isValid();
}

bool DeclarativeRsaKey::loadDefault() const
{
    return m_loadDefaultKey;
}

void DeclarativeRsaKey::setFileName(const QString &fileName)
{
    qDebug() << Q_FUNC_INFO << fileName;
    if (m_fileName == fileName) {
        return;
    }
    m_fileName = fileName;
    if (!fileName.isEmpty()) {
        setKey(RsaKey::fromFile(QUrl::fromUserInput(fileName).toLocalFile()));
    }
    emit fileNameChanged(fileName);
}

void DeclarativeRsaKey::setLoadDefault(bool loadDefault)
{
    if (m_loadDefaultKey == loadDefault) {
        return;
    }
    m_loadDefaultKey = loadDefault;
    if (loadDefault) {
        setKey(RsaKey::defaultKey());
    }
    emit loadDefaultChanged(loadDefault);
}

void DeclarativeRsaKey::setKey(const RsaKey &key)
{
    RsaKey oldKey = m_key;
    m_key = key;
    if (oldKey.isValid() != key.isValid()) {
        emit validChanged(key.isValid());
    }
}

DeclarativeProxySettings::DeclarativeProxySettings(QObject *parent) :
    QObject(parent)
{
}

void DeclarativeProxySettings::setPort(quint16 port)
{
    if (m_port == port) {
        return;
    }
    m_port = port;
    emit portChanged(port);
}

void DeclarativeProxySettings::setAddress(const QString &address)
{
    if (m_address == address) {
        return;
    }
    m_address = address;
    emit addressChanged(address);
}

DeclarativeSettings::DeclarativeSettings(QObject *parent) :
    Settings(parent)
{
    m_proxySettings = new DeclarativeProxySettings(this);
{'fraction_non_alphanumeric': 0.11633442427848854, 'fraction_numerical': 0.0011901219875037191, 'mean_word_length': 4.188271604938271, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7382429', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1136, 'n_words': 190}