<commit_before>/*
 * This file is part of the UnTech Editor Suite.
 * Copyright (c) 2016 - 2018, <NAME> <<EMAIL>>.
 * Distributed under The MIT License: https://opensource.org/licenses/MIT
 */

#include "propertylistmanager.h"
#include "propertylistmodel.h"

using namespace UnTech::GuiQt;

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

const QString& PropertyListManager::propertyTitle(int id)
{
    static const QString nullString;

    for (const Property& p : _properties) {
        if (p.id == id) {
            return p.title;
        }
    }

    return nullString;
}

void PropertyListManager::addProperty(const QString& title, int id, PropertyType type,
                                      const QVariant& param1, const QVariant& param2)
{
    if (id < 0) {
        qWarning("PropertyListManager::addProperty: id must be >= 0");
    }

    _properties.append(Property(title, id, type, param1, param2));

    emit propertyListChanged();
}

void PropertyListManager::addPropertyGroup(const QString& title)
{<commit_msg>Fix missing initializer in PropertyListManager<commit_after>/*
 * This file is part of the UnTech Editor Suite.
 * Copyright (c) 2016 - 2018, <NAME> <<EMAIL>>.
 * Distributed under The MIT License: https://opensource.org/licenses/MIT
 */

#include "propertylistmanager.h"
#include "propertylistmodel.h"

using namespace UnTech::GuiQt;

PropertyListManager::PropertyListManager(QObject* parent)
    : QObject(parent)
    , _enabled(false)
{
}

const QString& PropertyListManager::propertyTitle(int id)
{
    static const QString nullString;

    for (const Property& p : _properties) {
        if (p.id == id) {
            return p.title;
        }
    }

    return nullString;
}

void PropertyListManager::addProperty(const QString& title, int id, PropertyType type,
                                      const QVariant& param1, const QVariant& param2)
{
    if (id < 0) {
        qWarning("PropertyListManager::addProperty: id must be >= 0");
    }

    _properties.append(Property(title, id, type, param1, param2));

    emit propertyListChanged();
}

void PropertyListManager::addPropertyGroup(const QString& title)
{
{'fraction_non_alphanumeric': 0.11192325262677022, 'fraction_numerical': 0.012791228871630882, 'mean_word_length': 3.353876739562624, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '821941', 'n_tokens_mistral': 666, 'n_tokens_neox': 627, 'n_words': 175}