diff --git a/src/app/qgsvectorlayerproperties.cpp b/src/app/qgsvectorlayerproperties.cpp
index 3b1665e0ff0..3cff78155d2 100644
--- a/src/app/qgsvectorlayerproperties.cpp
+++ b/src/app/qgsvectorlayerproperties.cpp
@@ -1039,6 +1039,7 @@ void QgsVectorLayerProperties::on_mButtonAddJoin_clicked()
info.joinLayerId = d.joinedLayerId();
info.joinFieldName = d.joinFieldName();
info.memoryCache = d.cacheInMemory();
+
if ( d.hasJoinFieldsSubset() )
info.setJoinFieldNamesSubset( new QStringList( d.joinFieldsSubset() ) );
if ( layer )
@@ -1080,21 +1081,45 @@ void QgsVectorLayerProperties::addJoinToTreeWidget( const QgsVectorJoinInfo& joi
joinItem->setData( 0, Qt::UserRole, join.joinLayerId );
if ( join.joinFieldName.isEmpty() && join.joinFieldIndex >= 0 && join.joinFieldIndex < joinLayer->pendingFields().count() )
+ {
joinItem->setText( 1, joinLayer->pendingFields().field( join.joinFieldIndex ).name() ); //for compatibility with 1.x
+ }
else
+ {
joinItem->setText( 1, join.joinFieldName );
+ }
if ( join.targetFieldName.isEmpty() && join.targetFieldIndex >= 0 && join.targetFieldIndex < layer->pendingFields().count() )
+ {
joinItem->setText( 2, layer->pendingFields().field( join.targetFieldIndex ).name() ); //for compatibility with 1.x
+ }
else
+ {
joinItem->setText( 2, join.targetFieldName );
+ }
if ( join.memoryCache )
+ {
joinItem->setText( 3, QChar( 0x2714 ) );
+ }
+
+ joinItem->setText( 4, join.prefix );
+
+ const QStringList* list = join.joinFieldNamesSubset();
+ if ( list )
+ {
+ joinItem->setText( 5, QString( "%1" ).arg( list->count() ) );
+ }
+ else
+ {
+ joinItem->setText( 5, tr( "all" ) );
+ }
mJoinTreeWidget->addTopLevelItem( joinItem );
- for ( int c = 0; c < 3; c++ )
+ for ( int c = 0; c < 5; c++ )
+ {
mJoinTreeWidget->resizeColumnToContents( c );
+ }
}
void QgsVectorLayerProperties::on_mButtonRemoveJoin_clicked()
diff --git a/src/ui/qgsvectorlayerpropertiesbase.ui b/src/ui/qgsvectorlayerpropertiesbase.ui
index d8db3d48950..f989afd0113 100644
--- a/src/ui/qgsvectorlayerpropertiesbase.ui
+++ b/src/ui/qgsvectorlayerpropertiesbase.ui
@@ -46,7 +46,16 @@
QFrame::Raised
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -234,7 +243,16 @@
QFrame::Raised
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -246,11 +264,20 @@
- 0
+ 8
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -271,7 +298,16 @@
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -293,7 +329,16 @@
-
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
@@ -528,7 +573,16 @@
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -544,12 +598,21 @@
0
0
- 730
- 537
+ 100
+ 30
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -579,7 +642,16 @@
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -602,7 +674,16 @@
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -618,12 +699,21 @@
0
0
- 730
- 537
+ 123
+ 38
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -666,7 +756,16 @@
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -682,12 +781,21 @@
0
0
- 730
- 537
+ 100
+ 30
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -708,7 +816,16 @@
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -724,8 +841,8 @@
0
0
- 730
- 537
+ 721
+ 171
@@ -851,7 +968,16 @@
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
-
@@ -867,12 +993,21 @@
0
0
- 730
- 537
+ 487
+ 182
-
+
+ 0
+
+
+ 0
+
+
+ 0
+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