44 if ( L->editBuffer()->addedFeatures().contains( request.filterFid() ) )
45 mAddedFeatures.insert( request.filterFid(), L->editBuffer()->addedFeatures()[ request.filterFid()] );
47 if ( L->editBuffer()->changedGeometries().contains( request.filterFid() ) )
48 mChangedGeometries.insert( request.filterFid(), L->editBuffer()->changedGeometries()[ request.filterFid()] );
50 if ( L->editBuffer()->deletedFeatureIds().contains( request.filterFid() ) )
53 if ( L->editBuffer()->changedAttributeValues().contains( request.filterFid() ) )
54 mChangedAttributeValues.insert( request.filterFid(), L->editBuffer()->changedAttributeValues()[ request.filterFid()] );
56 if ( L->editBuffer()->changedAttributeValues().contains( request.filterFid() ) )
57 mChangedFeaturesRequest.setFilterFids(
QgsFeatureIds() << request.filterFid() );
90 , mFetchedFid( false )
91 , mEditGeometrySimplifier( 0 )
111 for (
int i = 0; i < subset.count(); ++i )
113 int attrIndex = subset[i];
114 if ( attrIndex < 0 || attrIndex >= nPendingFields )
continue;
154 delete mEditGeometrySimplifier;
155 mEditGeometrySimplifier = NULL;
307 if ( mEditGeometrySimplifier )
391 if ( mEditGeometrySimplifier )
442 for ( QgsAttributeList::const_iterator attIt = fetchAttributes.constBegin(); attIt != fetchAttributes.constEnd(); ++attIt )
450 int sourceLayerIndex;
452 Q_ASSERT( joinInfo );
455 Q_ASSERT( joinLayer );
475 if ( !fetchAttributes.contains( info.
targetField ) )
482 mFetchJoinInfo[ joinInfo ].attributes.push_back( sourceLayerIndex );
529 QMap<const QgsVectorJoinInfo*, FetchJoinInfo>::const_iterator joinIt =
mFetchJoinInfo.constBegin();
533 Q_ASSERT( joinIt.key() );
536 if ( !targetFieldValue.isValid() )
540 if ( memoryCache.isEmpty() )
571 delete mEditGeometrySimplifier;
572 mEditGeometrySimplifier = NULL;
578 return mEditGeometrySimplifier != NULL;
585 Q_UNUSED( methodType );
611 QHash<QString, QgsAttributes>::const_iterator it = memoryCache.find( joinValue.toString() );
612 if ( it == memoryCache.constEnd() )
618 for (
int i = 0; i < featureAttributes.count(); ++i )
629 QString subsetString = joinLayer->dataProvider()->subsetString();
630 QString bkSubsetString = subsetString;
631 if ( !subsetString.isEmpty() )
633 subsetString.prepend(
"(" ).append(
") AND " );
636 QString joinFieldName;
637 if ( joinInfo->joinFieldName.isEmpty() && joinInfo->joinFieldIndex >= 0 && joinInfo->joinFieldIndex < joinLayer->pendingFields().count() )
638 joinFieldName = joinLayer->pendingFields().field( joinInfo->joinFieldIndex ).name();
640 joinFieldName = joinInfo->joinFieldName;
642 subsetString.append( QString(
"\"%1\"" ).arg( joinFieldName ) );
644 if ( joinValue.isNull() )
646 subsetString +=
" IS NULL";
650 QString v = joinValue.toString();
651 switch ( joinValue.type() )
654 case QVariant::LongLong:
655 case QVariant::Double:
659 case QVariant::String:
660 v.replace(
"'",
"''" );
661 v.prepend(
"'" ).append(
"'" );
664 subsetString +=
"=" + v;
667 joinLayer->dataProvider()->setSubsetString( subsetString,
false );
671 bool hasSubset = joinInfo->joinFieldNamesSubset();
672 QVector<int> subsetIndices;
686 int index = indexOffset;
690 for (
int i = 0; i < subsetIndices.count(); ++i )
696 for (
int i = 0; i < attr.count(); ++i )
698 if ( i == joinField )
710 joinLayer->dataProvider()->setSubsetString( bkSubsetString,
false );
734 if ( iter->id() == featureId )
774 for ( QgsAttributeMap::const_iterator it = map.begin(); it != map.end(); ++it )
775 attrs[it.key()] = it.value();