Skip to content
Permalink
Browse files

Show only provider fields as join target candidates (ticket #4136)

  • Loading branch information
mhugent authored and marco committed Aug 15, 2011
1 parent a489b15 commit 39749d06014ce5191e57d03a05a1b6b99d607c1e
Showing with 9 additions and 5 deletions.
  1. +8 −4 src/app/qgsaddjoindialog.cpp
  2. +1 −1 src/app/qgsvectorlayerproperties.cpp
@@ -52,11 +52,15 @@ QgsAddJoinDialog::QgsAddJoinDialog( QgsVectorLayer* layer, QWidget * parent, Qt:
on_mJoinLayerComboBox_currentIndexChanged( mJoinLayerComboBox->currentIndex() );

//insert possible target fields
const QgsFieldMap& layerFieldMap = mLayer->pendingFields();
QgsFieldMap::const_iterator fieldIt = layerFieldMap.constBegin();
for ( ; fieldIt != layerFieldMap.constEnd(); ++fieldIt )
QgsVectorDataProvider* provider = mLayer->dataProvider();
if ( provider )
{
mTargetFieldComboBox->addItem( fieldIt.value().name(), fieldIt.key() );
const QgsFieldMap& layerFieldMap = provider->fields();
QgsFieldMap::const_iterator fieldIt = layerFieldMap.constBegin();
for ( ; fieldIt != layerFieldMap.constEnd(); ++fieldIt )
{
mTargetFieldComboBox->addItem( fieldIt.value().name(), fieldIt.key() );
}
}

mCacheInMemoryCheckBox->setChecked( true );
@@ -1291,7 +1291,7 @@ void QgsVectorLayerProperties::on_mButtonAddJoin_clicked()
info.memoryCache = d.cacheInMemory();
if ( layer )
{
//create attribute index if possible. Todo: ask user if this should be done (e.g. in QgsAddJoinDialog)
//create attribute index if possible
if ( d.createAttributeIndex() )
{
QgsVectorLayer* joinLayer = qobject_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( info.joinLayerId ) );

0 comments on commit 39749d0

Please sign in to comment.
You can’t perform that action at this time.