Пример #1
0
void Soprano::Util::ReadOnlyModel::setParentModel( Model* model )
{
    if ( model != d->parent ) {
        if ( d->parent ) {
            d->parent->disconnect( this );
        }
        d->parent = model;
        if ( d->parent ) {
            connect( d->parent, SIGNAL(statementsAdded()), this, SIGNAL(statementsAdded()) );
            connect( d->parent, SIGNAL(statementsRemoved()), this, SIGNAL(statementsRemoved()) );
            connect( d->parent, SIGNAL(statementAdded(Soprano::Statement)), this, SIGNAL(statementAdded(Soprano::Statement)) );
            connect( d->parent, SIGNAL(statementRemoved(Soprano::Statement)), this, SIGNAL(statementRemoved(Soprano::Statement)) );
        }
    }
}
Пример #2
0
Soprano::Client::DBusModel::DBusModel( const QString& serviceName, const QString& dbusObject, const Backend* backend )
    : StorageModel( backend ),
      d( new Private() )
{
    qDBusRegisterMetaType<Soprano::Node>();
    qDBusRegisterMetaType<Soprano::Statement>();
    qDBusRegisterMetaType<Soprano::BindingSet>();

    d->interface = new DBusModelInterface( serviceName, dbusObject, QDBusConnection::sessionBus(), this );
    d->callMode = QDBus::Block;
    connect( d->interface, SIGNAL(statementsAdded()),
             this, SIGNAL(statementsAdded()) );
    connect( d->interface, SIGNAL(statementsRemoved()),
             this, SIGNAL(statementsRemoved()) );
    connect( d->interface, SIGNAL(statementAdded(Soprano::Statement)),
             this, SIGNAL(statementAdded(Soprano::Statement)) );
    connect( d->interface, SIGNAL(statementRemoved(Soprano::Statement)),
             this, SIGNAL(statementRemoved(Soprano::Statement)) );
}
Пример #3
0
void Nepomuk::TagCloud::setAutoUpdate( bool enable )
{
    if ( enable != d->autoUpdate ) {
        if( !enable ) {
            disconnect( ResourceManager::instance()->mainModel(), SIGNAL(statementsAdded()),
                        this, SLOT(updateTags()) );
            disconnect( ResourceManager::instance()->mainModel(), SIGNAL(statementsRemoved()),
                        this, SLOT(updateTags()) );
        }
        else {
            connect( ResourceManager::instance()->mainModel(), SIGNAL(statementsAdded()),
                     this, SLOT(updateTags()) );
            connect( ResourceManager::instance()->mainModel(), SIGNAL(statementsRemoved()),
                     this, SLOT(updateTags()) );
        }

        d->autoUpdate = enable;
    }
}