diff --git a/resources/function_help/Field b/resources/function_help/Field
index 1628b63d022..a17d6aa2697 100644
--- a/resources/function_help/Field
+++ b/resources/function_help/Field
@@ -2,3 +2,8 @@
Double click to add field name to expression string.
Right-Click on field name to open context menu sample value loading options.
+
+
Note:
+Loading field values from WFS layers isn't supported, before the layer is
+actually inserted, ie. when building queries.
+
diff --git a/resources/function_help/Fields and Values b/resources/function_help/Fields and Values
index 3e08a83a350..6c20107f463 100644
--- a/resources/function_help/Fields and Values
+++ b/resources/function_help/Fields and Values
@@ -3,3 +3,7 @@ Contains a list of fields from the layer. Sample values can also be accessed vi
Select the field name from the list then right-click to access context menu with options to load sample values from the selected field.
+Note:
+Loading field values from WFS layers isn't supported, before the layer is
+actually inserted, ie. when building queries.
+
diff --git a/src/app/qgsattributetabledialog.cpp b/src/app/qgsattributetabledialog.cpp
index 45a471ea8d0..c811730bc18 100644
--- a/src/app/qgsattributetabledialog.cpp
+++ b/src/app/qgsattributetabledialog.cpp
@@ -119,8 +119,6 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
// info from table to application
connect( this, SIGNAL( saveEdits( QgsMapLayer * ) ), QgisApp::instance(), SLOT( saveEdits( QgsMapLayer * ) ) );
- connect( mMainView, SIGNAL( currentChanged( int ) ), mMainViewButtonGroup, SLOT( currentChanged( int ) ) );
-
bool myDockFlag = settings.value( "/qgis/dockAttributeTable", false ).toBool();
if ( myDockFlag )
{
diff --git a/src/gui/qgsexpressionbuilderdialog.cpp b/src/gui/qgsexpressionbuilderdialog.cpp
index 49ad254d080..31e32035dde 100644
--- a/src/gui/qgsexpressionbuilderdialog.cpp
+++ b/src/gui/qgsexpressionbuilderdialog.cpp
@@ -21,8 +21,8 @@ QgsExpressionBuilderDialog::QgsExpressionBuilderDialog( QgsVectorLayer* layer, Q
{
setupUi( this );
- QPushButton* okButuon = buttonBox->button( QDialogButtonBox::Ok );
- connect( builder, SIGNAL( expressionParsed( bool ) ), okButuon, SLOT( setEnabled( bool ) ) );
+ QPushButton* okButton = buttonBox->button( QDialogButtonBox::Ok );
+ connect( builder, SIGNAL( expressionParsed( bool ) ), okButton, SLOT( setEnabled( bool ) ) );
builder->setLayer( layer );
builder->setExpressionText( startText );
diff --git a/src/gui/qgsexpressionbuilderwidget.cpp b/src/gui/qgsexpressionbuilderwidget.cpp
index fb27c746741..abaa60296d8 100644
--- a/src/gui/qgsexpressionbuilderwidget.cpp
+++ b/src/gui/qgsexpressionbuilderwidget.cpp
@@ -125,7 +125,7 @@ void QgsExpressionBuilderWidget::currentChanged( const QModelIndex &index, const
// Get the item
QModelIndex idx = mProxyModel->mapToSource( index );
QgsExpressionItem* item = dynamic_cast( mModel->itemFromIndex( idx ) );
- if ( item == 0 )
+ if ( !item )
return;
if ( item->getItemType() != QgsExpressionItem::Field )
@@ -133,9 +133,9 @@ void QgsExpressionBuilderWidget::currentChanged( const QModelIndex &index, const
mValueListWidget->clear();
}
- btnLoadAll->setVisible( item->getItemType() == QgsExpressionItem::Field );
- btnLoadSample->setVisible( item->getItemType() == QgsExpressionItem::Field );
- mValueGroupBox->setVisible( item->getItemType() == QgsExpressionItem::Field );
+ btnLoadAll->setVisible( item->getItemType() == QgsExpressionItem::Field && mLayer );
+ btnLoadSample->setVisible( item->getItemType() == QgsExpressionItem::Field && mLayer );
+ mValueGroupBox->setVisible( item->getItemType() == QgsExpressionItem::Field && mLayer );
// Show the help for the current item.
QString help = loadFunctionHelp( item );
@@ -369,7 +369,7 @@ void QgsExpressionBuilderWidget::showContextMenu( const QPoint & pt )
if ( !item )
return;
- if ( item->getItemType() == QgsExpressionItem::Field )
+ if ( item->getItemType() == QgsExpressionItem::Field && mLayer )
{
QMenu* menu = new QMenu( this );
menu->addAction( tr( "Load top 10 unique values" ), this, SLOT( loadSampleValues() ) );
diff --git a/src/providers/wfs/qgswfssourceselect.cpp b/src/providers/wfs/qgswfssourceselect.cpp
index b28b38c22c9..f5fa81829f7 100644
--- a/src/providers/wfs/qgswfssourceselect.cpp
+++ b/src/providers/wfs/qgswfssourceselect.cpp
@@ -61,7 +61,7 @@ QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget* parent, Qt::WFlags fl, bool emb
connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addLayer() ) );
buttonBox->addButton( mBuildQueryButton, QDialogButtonBox::ActionRole );
- connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( on_mBuildQueryButton_clicked() ) );
+ connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( buildQueryButtonClicked() ) );
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
connect( btnNew, SIGNAL( clicked() ), this, SLOT( addEntryToServerList() ) );
@@ -94,8 +94,8 @@ QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget* parent, Qt::WFlags fl, bool emb
mModelProxy->setSortCaseSensitivity( Qt::CaseInsensitive );
treeView->setModel( mModelProxy );
- connect( treeView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( on_treeWidget_itemDoubleClicked( const QModelIndex& ) ) );
- connect( treeView->selectionModel(), SIGNAL( currentRowChanged( QModelIndex, QModelIndex ) ), this, SLOT( on_treeWidget_currentRowChanged( const QModelIndex&, const QModelIndex& ) ) );
+ connect( treeView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( treeWidgetItemDoubleClicked( const QModelIndex& ) ) );
+ connect( treeView->selectionModel(), SIGNAL( currentRowChanged( QModelIndex, QModelIndex ) ), this, SLOT( treeWidgetCurrentRowChanged( const QModelIndex&, const QModelIndex& ) ) );
}
QgsWFSSourceSelect::~QgsWFSSourceSelect()
@@ -519,13 +519,13 @@ void QgsWFSSourceSelect::on_btnLoad_clicked()
emit connectionsChanged();
}
-void QgsWFSSourceSelect::on_treeWidget_itemDoubleClicked( const QModelIndex& index )
+void QgsWFSSourceSelect::treeWidgetItemDoubleClicked( const QModelIndex& index )
{
QgsDebugMsg( "double click called" );
buildQuery( index );
}
-void QgsWFSSourceSelect::on_treeWidget_currentRowChanged( const QModelIndex & current, const QModelIndex & previous )
+void QgsWFSSourceSelect::treeWidgetCurrentRowChanged( const QModelIndex & current, const QModelIndex & previous )
{
Q_UNUSED( previous )
QgsDebugMsg( "treeWidget_currentRowChanged called" );
@@ -534,7 +534,7 @@ void QgsWFSSourceSelect::on_treeWidget_currentRowChanged( const QModelIndex & cu
mAddButton->setEnabled( current.isValid() );
}
-void QgsWFSSourceSelect::on_mBuildQueryButton_clicked()
+void QgsWFSSourceSelect::buildQueryButtonClicked()
{
QgsDebugMsg( "mBuildQueryButton click called" );
buildQuery( treeView->selectionModel()->currentIndex() );
diff --git a/src/providers/wfs/qgswfssourceselect.h b/src/providers/wfs/qgswfssourceselect.h
index 34cdb79cf1e..6d38ab2fadb 100644
--- a/src/providers/wfs/qgswfssourceselect.h
+++ b/src/providers/wfs/qgswfssourceselect.h
@@ -91,9 +91,9 @@ class QgsWFSSourceSelect: public QDialog, private Ui::QgsWFSSourceSelectBase
void capabilitiesReplyFinished();
void on_btnSave_clicked();
void on_btnLoad_clicked();
- void on_treeWidget_itemDoubleClicked( const QModelIndex & index );
- void on_treeWidget_currentRowChanged( const QModelIndex & current, const QModelIndex & previous );
- void on_mBuildQueryButton_clicked();
+ void treeWidgetItemDoubleClicked( const QModelIndex & index );
+ void treeWidgetCurrentRowChanged( const QModelIndex & current, const QModelIndex & previous );
+ void buildQueryButtonClicked();
void filterChanged( QString text );
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }