/*!
    \internal
*/
void QDeclarativeSearchModelBase::initializePlugin(QDeclarativeGeoServiceProvider *plugin)
{
    beginResetModel();
    if (plugin != m_plugin) {
        if (m_plugin)
            disconnect(m_plugin, SIGNAL(nameChanged(QString)), this, SLOT(pluginNameChanged()));
        if (plugin)
            connect(plugin, SIGNAL(nameChanged(QString)), this, SLOT(pluginNameChanged()));
        m_plugin = plugin;
    }

    if (m_plugin) {
        QGeoServiceProvider *serviceProvider = m_plugin->sharedGeoServiceProvider();
        if (serviceProvider) {
            QPlaceManager *placeManager = serviceProvider->placeManager();
            if (placeManager) {
                if (placeManager->childCategoryIds().isEmpty()) {
                    QPlaceReply *reply = placeManager->initializeCategories();
                    connect(reply, SIGNAL(finished()), reply, SLOT(deleteLater()));
                }
            }
        }
    }

    endResetModel();
}
void ConfigCategory::setPluginName(const QString &name)
{
    if (m_pluginName == name) {
        return;
    }

    m_pluginName = name;
    emit pluginNameChanged();
}
Example #3
0
bool OutputPatch::set(QLCIOPlugin* plugin, quint32 output)
{
    if (m_plugin != NULL && m_pluginLine != QLCIOPlugin::invalidLine())
        m_plugin->closeOutput(m_pluginLine, m_universe);

    m_plugin = plugin;
    m_pluginLine = output;

    if (m_plugin != NULL)
    {
        emit pluginNameChanged();
        if (m_pluginLine != QLCIOPlugin::invalidLine())
            emit outputNameChanged();
    }

    if (m_plugin != NULL && m_pluginLine != QLCIOPlugin::invalidLine())
        return m_plugin->openOutput(m_pluginLine, m_universe);

    return false;
}
Example #4
0
bool InputPatch::set(QLCIOPlugin* plugin, quint32 input, QLCInputProfile* profile)
{
    bool result = false;

    if (m_plugin != NULL && m_pluginLine != QLCIOPlugin::invalidLine())
    {
        disconnect(m_plugin, SIGNAL(valueChanged(quint32,quint32,quint32,uchar,QString)),
                   this, SLOT(slotValueChanged(quint32,quint32,quint32,uchar,QString)));
        m_plugin->closeInput(m_pluginLine, m_universe);
    }

    m_plugin = plugin;
    m_pluginLine = input;
    m_profile = profile;

    if (m_plugin != NULL)
    {
        emit pluginNameChanged();
        if (m_pluginLine != QLCIOPlugin::invalidLine())
            emit inputNameChanged();
        if (m_profile != NULL)
            emit profileNameChanged();
    }

    /* Open the assigned plugin input */
    if (m_plugin != NULL && m_pluginLine != QLCIOPlugin::invalidLine())
    {
        connect(m_plugin, SIGNAL(valueChanged(quint32,quint32,quint32,uchar,QString)),
                this, SLOT(slotValueChanged(quint32,quint32,quint32,uchar,QString)));
        result = m_plugin->openInput(m_pluginLine, m_universe);

        if (m_profile != NULL)
            setProfilePageControls();
    }
    return result;
}