51 int nPendingFields = pendingFields.
count();
52 for (
int i = 0; i < subset.count(); ++i )
54 int attrIndex = subset[i];
55 if ( attrIndex < 0 || attrIndex >= nPendingFields )
continue;
298 for ( QgsAttributeList::const_iterator attIt = fetchAttributes.constBegin(); attIt != fetchAttributes.constEnd(); ++attIt )
303 int sourceLayerIndex;
305 Q_ASSERT( joinInfo );
308 Q_ASSERT( joinLayer );
331 if ( !fetchAttributes.contains( info.
targetField ) )
338 mFetchJoinInfo[ joinLayer ].attributes.push_back( sourceLayerIndex );
352 QMap<QgsVectorLayer*, FetchJoinInfo>::const_iterator joinIt =
mFetchJoinInfo.constBegin();
356 Q_ASSERT( joinIt.key() );
359 if ( !targetFieldValue.isValid() )
363 if ( memoryCache.isEmpty() )
375 QHash<QString, QgsAttributes>::const_iterator it = memoryCache.find( joinValue.toString() );
376 if ( it == memoryCache.constEnd() )
382 for (
int i = 0; i < featureAttributes.count(); ++i )
397 QString subsetString = joinLayer->dataProvider()->subsetString();
398 QString bkSubsetString = subsetString;
399 if ( !subsetString.isEmpty() )
401 subsetString.prepend(
"(" ).append(
") AND " );
404 QString joinFieldName;
405 if ( joinInfo->joinFieldName.isEmpty() && joinInfo->joinFieldIndex >= 0 && joinInfo->joinFieldIndex < joinLayer->pendingFields().count() )
406 joinFieldName = joinLayer->pendingFields().field( joinInfo->joinFieldIndex ).name();
408 joinFieldName = joinInfo->joinFieldName;
410 subsetString.append( QString(
"\"%1\"" ).arg( joinFieldName ) );
412 if ( joinValue.isNull() )
414 subsetString +=
" IS NULL";
418 QString v = joinValue.toString();
419 switch ( joinValue.type() )
422 case QVariant::LongLong:
423 case QVariant::Double:
427 case QVariant::String:
428 v.replace(
"'",
"''" );
429 v.prepend(
"'" ).append(
"'" );
432 subsetString +=
"=" + v;
435 joinLayer->dataProvider()->setSubsetString( subsetString,
false );
447 int index = indexOffset;
449 for (
int i = 0; i < attr.count(); ++i )
451 if ( i == joinField )
462 joinLayer->dataProvider()->setSubsetString( bkSubsetString,
false );
486 if ( iter->id() == featureId )
525 for ( QgsAttributeMap::const_iterator it = map.begin(); it != map.end(); it++ )
526 attrs[it.key()] = it.value();