<commit_before>#include "networkbrief.h"
#include "networkbusinesslogic.h"
#include "dcpwidgettypes.h"

#include <QDebug>

NetworkBrief::NetworkBrief() :
        DcpBrief(),
        logic(NULL),
        networkText(QString("")),
        networkToggle(false),
        networkToggleIcon(QString(""))
{

    logic = new NetworkBusinessLogic();    

    connect(logic, SIGNAL(networkStateChanged(bool)), this, SLOT(updateToggle(bool)));
    connect(logic, SIGNAL(networkOperatorChanged(QString)), this, SLOT(updateOperatorLabel(QString)));
    connect(logic, SIGNAL(networkIconChanged(QString)), this, SLOT(updateToggleIcon(QString)));

    updateToggle(logic->networkEnabled());
    updateToggleIcon(logic->networkIcon());
    updateOperatorLabel(logic->currentOperator());
}

NetworkBrief::~NetworkBrief()
{   
    delete logic;
    logic = NULL; 
}

QString NetworkBrief::valueText() const
{
    return networkText;
}

bool NetworkBrief::toggle() const
{
    return networkToggle;
}

QString NetworkBrief::toggleIconId() const
{
    return networkToggleIcon;
}

int NetworkBrief::widgetTypeID() const
{    
    return DCPLABELBUTTON;
}


void NetworkBrief::updateOperatorLabel(const QString &text)
{
    networkText = text;
    emit valuesChanged();
}

void NetworkBrief::updateToggle(bool toggle)
{    
    networkToggle = toggle;
    emit valuesChanged();
}

void NetworkBrief::updateToggleIcon(const QString &icon)
{<commit_msg>Workaround for duicontrolpanel bug NB#150644 - "Settings widget with ID DCPLABELBUTTON crashes" until the INC51 demo is done.<commit_after>#include "networkbrief.h"
#include "networkbusinesslogic.h"
#include "dcpwidgettypes.h"

#include <QDebug>

NetworkBrief::NetworkBrief() :
        DcpBrief(),
        logic(NULL),
        networkText(QString("")),
        networkToggle(false),
        networkToggleIcon(QString(""))
{

    logic = new NetworkBusinessLogic();    

    connect(logic, SIGNAL(networkStateChanged(bool)), this, SLOT(updateToggle(bool)));
    connect(logic, SIGNAL(networkOperatorChanged(QString)), this, SLOT(updateOperatorLabel(QString)));
    connect(logic, SIGNAL(networkIconChanged(QString)), this, SLOT(updateToggleIcon(QString)));

    updateToggle(logic->networkEnabled());
    updateToggleIcon(logic->networkIcon());
    updateOperatorLabel(logic->currentOperator());
}

NetworkBrief::~NetworkBrief()
{   
    delete logic;
    logic = NULL; 
}

QString NetworkBrief::valueText() const
{
    return networkText;
}

bool NetworkBrief::toggle() const
{
    return networkToggle;
}

QString NetworkBrief::toggleIconId() const
{
    return networkToggleIcon;
}

int NetworkBrief::widgetTypeID() const
{    
    return DCPLABELBUTTON + 100;
}

void NetworkBrief::updateOperatorLabel(const QString &text)
{
    networkText = text;
    emit valuesChanged();
}

void NetworkBrief::updateToggle(bool toggle)
{    
    networkToggle = toggle;
    emit valuesChanged();
}

void NetworkBrief::updateToggleIcon(const QString &icon)
{
{'fraction_non_alphanumeric': 0.12361437688948607, 'fraction_numerical': 0.003694994961370507, 'mean_word_length': 4.920477137176938, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '3720588', 'n_tokens_mistral': 924, 'n_tokens_neox': 888, 'n_words': 169}