<commit_before>#include "CuteHMIQMLPlugin.hpp"

#include <cutehmi/CuteHMI.hpp>
#include <cutehmi/Prompt.hpp>
#include <cutehmi/Notification.hpp>

#include <QtQml>

void CuteHMIQMLPlugin::registerTypes(const char * uri)
{
	Q_ASSERT(uri == QLatin1String("CuteHMI"));

	qmlRegisterType<cutehmi::Prompt>(uri, 1, 0, "Prompt");
	qmlRegisterType<cutehmi::Notification>(uri, 1, 0, "Notification");
	qmlRegisterUncreatableType<cutehmi::PopupBridge>(uri, 1, 0, "PopupBridge", QObject::tr("cutehmi::PopupBridge instances can not be created within QML."));
	qmlRegisterUncreatableType<cutehmi::NotificationManager>(uri, 1, 0, "NotificationManager", QObject::tr("cutehmi::NotificationManager instances can not be created within QML."));
	qmlRegisterUncreatableType<cutehmi::Project>(uri, 1, 0, "Project", QObject::tr("cutehmi::Project instances can not be created within QML."));
	qmlRegisterUncreatableType<cutehmi::ProjectModel>(uri, 1, 0, "ProjectModel", QObject::tr("cutehmi::ProjectModel instances can not be created within QML."));
	qmlRegisterUncreatableType<const cutehmi::ProjectNode>(uri, 1, 0, "ProjectNode", QObject::tr("cutehmi::ProjectNode instances can not be created within QML."));
	qmlRegisterSingletonType<cutehmi::CuteHMI>(uri, 1, 0, "CuteHMI", CuteHMIProvider);
}

QObject * CuteHMIQMLPlugin::CuteHMIProvider(QQmlEngine * engine, QJSEngine * scriptEngine)
{
	Q_UNUSED(scriptEngine)

	cutehmi::CuteHMI * cuteHMI = & cutehmi::CuteHMI::Instance();
	engine->setObjectOwnership(cuteHMI, QQmlEngine::CppOwnership);
	return cuteHMI;<commit_msg>Use macros provided by 'cutehmi.metadata', instead of hard-coded values.<commit_after>#include "CuteHMIQMLPlugin.hpp"

#include <cutehmi/CuteHMI.hpp>
#include <cutehmi/Prompt.hpp>
#include <cutehmi/Notification.hpp>

#include <QtQml>

void CuteHMIQMLPlugin::registerTypes(const char * uri)
{
	Q_ASSERT(uri == QLatin1String("CuteHMI"));

	qmlRegisterType<cutehmi::Prompt>(uri, CUTEHMI_MAJOR, CUTEHMI_1_CURRENT, "Prompt");
	qmlRegisterType<cutehmi::Notification>(uri, CUTEHMI_MAJOR, CUTEHMI_1_CURRENT, "Notification");
	qmlRegisterUncreatableType<cutehmi::PopupBridge>(uri, CUTEHMI_MAJOR, CUTEHMI_1_CURRENT, "PopupBridge", QObject::tr("cutehmi::PopupBridge instances can not be created within QML."));
	qmlRegisterUncreatableType<cutehmi::NotificationManager>(uri, CUTEHMI_MAJOR, CUTEHMI_1_CURRENT, "NotificationManager", QObject::tr("cutehmi::NotificationManager instances can not be created within QML."));
	qmlRegisterUncreatableType<cutehmi::Project>(uri, CUTEHMI_MAJOR, CUTEHMI_1_CURRENT, "Project", QObject::tr("cutehmi::Project instances can not be created within QML."));
	qmlRegisterUncreatableType<cutehmi::ProjectModel>(uri, CUTEHMI_MAJOR, CUTEHMI_1_CURRENT, "ProjectModel", QObject::tr("cutehmi::ProjectModel instances can not be created within QML."));
	qmlRegisterUncreatableType<cutehmi::Plugin>(uri, CUTEHMI_MAJOR, CUTEHMI_1_CURRENT, "Plugin", QObject::tr("cutehmi::Plugin instances can not be created within QML."));
	qmlRegisterUncreatableType<const cutehmi::ProjectNode>(uri, CUTEHMI_MAJOR, CUTEHMI_1_CURRENT, "ProjectNode", QObject::tr("cutehmi::ProjectNode instances can not be created within QML."));
	qmlRegisterSingletonType<cutehmi::CuteHMI>(uri, CUTEHMI_MAJOR, CUTEHMI_1_CURRENT, "CuteHMI", CuteHMIProvider);
}

QObject * CuteHMIQMLPlugin::CuteHMIProvider(QQmlEngine * engine, QJSEngine * scriptEngine)
{
	Q_UNUSED(scriptEngine)

	cutehmi::CuteHMI * cuteHMI = & cutehmi::CuteHMI::Instance();
	engine->setObjectOwnership(cuteHMI, QQmlEngine::CppOwnership);
	return cuteHMI;
{'fraction_non_alphanumeric': 0.1321660547867834, 'fraction_numerical': 0.0076249646992375035, 'mean_word_length': 10.208860759493671, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 30, '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': '6630863', 'n_tokens_mistral': 1323, 'n_tokens_neox': 1299, 'n_words': 225}