@@ -94,8 +94,8 @@ QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget* parent, Qt::WFlags fl, bool emb
9494 mModelProxy ->setSortCaseSensitivity ( Qt::CaseInsensitive );
9595 treeView->setModel ( mModelProxy );
9696
97- connect ( treeView, SIGNAL ( doubleClicked (const QModelIndex&) ), this , SLOT ( on_treeWidget_itemDoubleClicked (const QModelIndex&) ) );
98- connect ( treeView->selectionModel (), SIGNAL ( currentRowChanged ( QModelIndex, QModelIndex) ), this , SLOT ( on_treeWidget_currentRowChanged (const QModelIndex&, const QModelIndex&) ) );
97+ connect ( treeView, SIGNAL ( doubleClicked ( const QModelIndex& ) ), this , SLOT ( on_treeWidget_itemDoubleClicked ( const QModelIndex& ) ) );
98+ connect ( treeView->selectionModel (), SIGNAL ( currentRowChanged ( QModelIndex, QModelIndex ) ), this , SLOT ( on_treeWidget_currentRowChanged ( const QModelIndex&, const QModelIndex& ) ) );
9999}
100100
101101QgsWFSSourceSelect::~QgsWFSSourceSelect ()
@@ -229,7 +229,7 @@ void QgsWFSSourceSelect::capabilitiesReplyFinished()
229229 cachedItem->setCheckState ( Qt::Checked );
230230
231231 typedef QList< QStandardItem* > StandardItemList;
232- mModel ->appendRow ( StandardItemList () << titleItem << nameItem << abstractItem << cachedItem << filterItem);
232+ mModel ->appendRow ( StandardItemList () << titleItem << nameItem << abstractItem << cachedItem << filterItem );
233233
234234 // insert the available CRS into mAvailableCRS
235235 std::list<QString> currentCRSList;
@@ -246,16 +246,16 @@ void QgsWFSSourceSelect::capabilitiesReplyFinished()
246246 treeView->resizeColumnToContents ( 1 );
247247 treeView->resizeColumnToContents ( 2 );
248248 treeView->resizeColumnToContents ( 3 );
249- for ( int i = 0 ; i < 2 ; i++ )
249+ for ( int i = 0 ; i < 2 ; i++ )
250250 {
251- if ( treeView->columnWidth ( i ) > 300 )
252- {
253- treeView->setColumnWidth ( i, 300 );
254- }
251+ if ( treeView->columnWidth ( i ) > 300 )
252+ {
253+ treeView->setColumnWidth ( i, 300 );
254+ }
255255 }
256256 if ( treeView->columnWidth ( 2 ) > 150 )
257257 {
258- treeView->setColumnWidth ( 2 , 150 );
258+ treeView->setColumnWidth ( 2 , 150 );
259259 }
260260 btnChangeSpatialRefSys->setEnabled ( true );
261261 treeView->selectionModel ()->select ( mModel ->index ( 0 , 0 ), QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows );
@@ -311,7 +311,7 @@ void QgsWFSSourceSelect::connectToServer()
311311 btnConnect->setEnabled ( false );
312312 if ( mModel )
313313 {
314- mModel ->removeRows ( 0 , mModel ->rowCount () );
314+ mModel ->removeRows ( 0 , mModel ->rowCount () );
315315 }
316316 if ( mCapabilities )
317317 {
@@ -382,7 +382,7 @@ void QgsWFSSourceSelect::addLayer()
382382 QString layerName = typeName;
383383 if ( cbxUseTitleLayerName->isChecked () && !titleName.isEmpty () )
384384 {
385- layerName = titleName;
385+ layerName = titleName;
386386 }
387387 QgsDebugMsg ( " Layer " + typeName + " Filter is " + filter );
388388 // is "cache features" checked?
@@ -401,44 +401,44 @@ void QgsWFSSourceSelect::addLayer()
401401
402402void QgsWFSSourceSelect::buildQuery ( const QModelIndex& index )
403403{
404- if ( !index.isValid () )
405- {
406- return ;
407- }
408- QModelIndex filterIndex = index.sibling ( index.row (), 4 );
409- QString typeName = index.sibling ( index.row (), 1 ).data ().toString ();
410-
411- // get available fields for wfs layer
412- QgsWFSProvider p ( " " ); // bypasses most provider instantiation logic
413- QgsOWSConnection connection ( " WFS" , cmbConnections->currentText () );
414- QgsWFSCapabilities conn ( connection.uri ().encodedUri () );
415- QString uri = conn.uriDescribeFeatureType ( typeName );
416-
417- QgsFields fields;
418- QString geometryAttribute;
419- QGis::WkbType geomType;
420- if ( p.describeFeatureType ( uri, geometryAttribute, fields, geomType ) != 0 )
421- {
422- return ;
423- }
404+ if ( !index.isValid () )
405+ {
406+ return ;
407+ }
408+ QModelIndex filterIndex = index.sibling ( index.row (), 4 );
409+ QString typeName = index.sibling ( index.row (), 1 ).data ().toString ();
424410
425- // show expression builder
426- QgsExpressionBuilderDialog d ( 0 , filterIndex.data ().toString () );
411+ // get available fields for wfs layer
412+ QgsWFSProvider p ( " " ); // bypasses most provider instantiation logic
413+ QgsOWSConnection connection ( " WFS" , cmbConnections->currentText () );
414+ QgsWFSCapabilities conn ( connection.uri ().encodedUri () );
415+ QString uri = conn.uriDescribeFeatureType ( typeName );
427416
428- // add available attributes to expression builder
429- QgsExpressionBuilderWidget* w = d.expressionBuilder ();
430- if ( !w )
431- {
432- return ;
433- }
417+ QgsFields fields;
418+ QString geometryAttribute;
419+ QGis::WkbType geomType;
420+ if ( p.describeFeatureType ( uri, geometryAttribute, fields, geomType ) != 0 )
421+ {
422+ return ;
423+ }
434424
435- w->loadFieldNames ( fields );
425+ // show expression builder
426+ QgsExpressionBuilderDialog d ( 0 , filterIndex.data ().toString () );
436427
437- if ( d.exec () == QDialog::Accepted )
438- {
439- QgsDebugMsg ( " Expression text = " + w->expressionText () );
440- mModelProxy ->setData ( filterIndex, QVariant ( w->expressionText () ) );
441- }
428+ // add available attributes to expression builder
429+ QgsExpressionBuilderWidget* w = d.expressionBuilder ();
430+ if ( !w )
431+ {
432+ return ;
433+ }
434+
435+ w->loadFieldNames ( fields );
436+
437+ if ( d.exec () == QDialog::Accepted )
438+ {
439+ QgsDebugMsg ( " Expression text = " + w->expressionText () );
440+ mModelProxy ->setData ( filterIndex, QVariant ( w->expressionText () ) );
441+ }
442442}
443443
444444void QgsWFSSourceSelect::changeCRS ()
@@ -452,7 +452,7 @@ void QgsWFSSourceSelect::changeCRS()
452452
453453void QgsWFSSourceSelect::changeCRSFilter ()
454454{
455- QgsDebugMsg (" changeCRSFilter called" );
455+ QgsDebugMsg ( " changeCRSFilter called" );
456456 // evaluate currently selected typename and set the CRS filter in mProjectionSelector
457457 QModelIndex currentIndex = treeView->selectionModel ()->currentIndex ();
458458 if ( currentIndex.isValid () )
@@ -527,7 +527,7 @@ void QgsWFSSourceSelect::on_treeWidget_itemDoubleClicked( const QModelIndex& ind
527527 buildQuery ( index );
528528}
529529
530- void QgsWFSSourceSelect::on_treeWidget_currentRowChanged ( const QModelIndex & current, const QModelIndex & previous)
530+ void QgsWFSSourceSelect::on_treeWidget_currentRowChanged ( const QModelIndex & current, const QModelIndex & previous )
531531{
532532 Q_UNUSED ( previous )
533533 QgsDebugMsg ( " treeWidget_currentRowChanged called" );
@@ -542,7 +542,7 @@ void QgsWFSSourceSelect::on_mBuildQueryButton_clicked()
542542 buildQuery ( treeView->selectionModel ()->currentIndex () );
543543}
544544
545- void QgsWFSSourceSelect::filterChanged (QString text)
545+ void QgsWFSSourceSelect::filterChanged ( QString text )
546546{
547547 QgsDebugMsg ( " WFS FeatureType filter changed to :" + text );
548548 QRegExp::PatternSyntax mySyntax = QRegExp::PatternSyntax ( QRegExp::RegExp );
@@ -552,16 +552,16 @@ void QgsWFSSourceSelect::filterChanged(QString text)
552552 mModelProxy ->sort ( mModelProxy ->sortColumn (), mModelProxy ->sortOrder () );
553553}
554554
555- QSize QgsWFSItemDelegate::sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const
555+ QSize QgsWFSItemDelegate::sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const
556556{
557- QVariant indexData;
558- indexData = index.data (Qt::DisplayRole);
559- if ( indexData.isNull () )
560- {
561- return QSize ();
562- }
563- QString data = indexData.toString ();
564- QSize size = option.fontMetrics .boundingRect (data).size ();
565- size.setHeight (size.height () + 2 );
566- return size;
557+ QVariant indexData;
558+ indexData = index.data ( Qt::DisplayRole );
559+ if ( indexData.isNull () )
560+ {
561+ return QSize ();
562+ }
563+ QString data = indexData.toString ();
564+ QSize size = option.fontMetrics .boundingRect ( data ).size ();
565+ size.setHeight ( size.height () + 2 );
566+ return size;
567567}
0 commit comments