/* SPDX-FileCopyrightText: 2017 Volker Krause SPDX-License-Identifier: MIT */ #include "qmlproviderextension.h" using namespace KUserFeedback; QmlProviderExtension::QmlProviderExtension(QObject* parent) : QObject(parent) { } QmlProviderExtension::~QmlProviderExtension() { } void QmlProviderExtension::sourceAppend(QQmlListProperty *prop, QmlAbstractDataSource *value) { static_cast(prop->object)->m_sourceWrappers.push_back(value); static_cast(prop->object->parent())->addDataSource(value->source()); } QmlProviderExtension::sizetype QmlProviderExtension::sourceCount(QQmlListProperty *prop) { return static_cast(prop->object)->m_sourceWrappers.size(); } QmlAbstractDataSource* QmlProviderExtension::sourceAt(QQmlListProperty *prop, QmlProviderExtension::sizetype index) { return static_cast(prop->object)->m_sourceWrappers.at(index); } void QmlProviderExtension::sourceClear(QQmlListProperty *prop) { static_cast(prop->object)->m_sourceWrappers.clear(); } QQmlListProperty QmlProviderExtension::sources() { return QQmlListProperty(this, nullptr, QmlProviderExtension::sourceAppend, QmlProviderExtension::sourceCount, QmlProviderExtension::sourceAt, QmlProviderExtension::sourceClear); } #include "moc_qmlproviderextension.cpp"