78 int nPendingFields = pendingFields.
count();
79 for (
int i = 0; i < subset.count(); ++i )
81 int attrIndex = subset[i];
82 if ( attrIndex < 0 || attrIndex >= nPendingFields )
continue;
399 for ( QgsAttributeList::const_iterator attIt = fetchAttributes.constBegin(); attIt != fetchAttributes.constEnd(); ++attIt )
401 if ( !fields.
exists( *attIt ) )
407 int sourceLayerIndex;
409 Q_ASSERT( joinInfo );
412 Q_ASSERT( joinLayer );
435 if ( !fetchAttributes.contains( info.
targetField ) )
442 mFetchJoinInfo[ joinLayer ].attributes.push_back( sourceLayerIndex );
456 QMap<QgsVectorLayer*, FetchJoinInfo>::const_iterator joinIt =
mFetchJoinInfo.constBegin();
460 Q_ASSERT( joinIt.key() );
463 if ( !targetFieldValue.isValid() )
467 if ( memoryCache.isEmpty() )
512 QHash<QString, QgsAttributes>::const_iterator it = memoryCache.find( joinValue.toString() );
513 if ( it == memoryCache.constEnd() )
519 for (
int i = 0; i < featureAttributes.count(); ++i )
534 QString subsetString = joinLayer->dataProvider()->subsetString();
535 QString bkSubsetString = subsetString;
536 if ( !subsetString.isEmpty() )
538 subsetString.prepend(
"(" ).append(
") AND " );
541 QString joinFieldName;
542 if ( joinInfo->joinFieldName.isEmpty() && joinInfo->joinFieldIndex >= 0 && joinInfo->joinFieldIndex < joinLayer->pendingFields().count() )
543 joinFieldName = joinLayer->pendingFields().field( joinInfo->joinFieldIndex ).name();
545 joinFieldName = joinInfo->joinFieldName;
547 subsetString.append( QString(
"\"%1\"" ).arg( joinFieldName ) );
549 if ( joinValue.isNull() )
551 subsetString +=
" IS NULL";
555 QString v = joinValue.toString();
556 switch ( joinValue.type() )
559 case QVariant::LongLong:
560 case QVariant::Double:
564 case QVariant::String:
565 v.replace(
"'",
"''" );
566 v.prepend(
"'" ).append(
"'" );
569 subsetString +=
"=" + v;
572 joinLayer->dataProvider()->setSubsetString( subsetString,
false );
584 int index = indexOffset;
586 for (
int i = 0; i < attr.count(); ++i )
588 if ( i == joinField )
599 joinLayer->dataProvider()->setSubsetString( bkSubsetString,
false );
623 if ( iter->id() == featureId )
662 for ( QgsAttributeMap::const_iterator it = map.begin(); it != map.end(); ++it )
663 attrs[it.key()] = it.value();