diff --git a/src/app/qgsattributetabledialog.cpp b/src/app/qgsattributetabledialog.cpp index 196ee15ee0d..21b56b6af22 100644 --- a/src/app/qgsattributetabledialog.cpp +++ b/src/app/qgsattributetabledialog.cpp @@ -287,7 +287,11 @@ void QgsAttributeTableDialog::columnBoxInit() foreach ( const QgsField field, fields ) { - if ( mLayer->editorWidgetV2( mLayer->fieldNameIndex( field.name() ) ) != "Hidden" ) + int idx = mLayer->fieldNameIndex( field.name() ); + if ( idx < 0 ) + continue; + + if ( mLayer->editorWidgetV2( idx ) != "Hidden" ) { QIcon icon = QgsApplication::getThemeIcon( "/mActionNewAttribute.png" ); QString text = field.name(); @@ -650,6 +654,9 @@ void QgsAttributeTableDialog::filterQueryChanged( const QString& query ) const QgsFields& flds = mLayer->pendingFields(); int fldIndex = mLayer->fieldNameIndex( fieldName ); + if ( fldIndex < 0 ) + return; + QVariant::Type fldType = flds[fldIndex].type(); bool numeric = ( fldType == QVariant::Int || fldType == QVariant::Double ); diff --git a/src/app/qgsfieldsproperties.cpp b/src/app/qgsfieldsproperties.cpp index 3a8f20f2ee6..57348d51bfa 100644 --- a/src/app/qgsfieldsproperties.cpp +++ b/src/app/qgsfieldsproperties.cpp @@ -550,6 +550,9 @@ void QgsFieldsProperties::on_mDeleteAttributeButton_clicked() if ( item->column() == 0 ) { int idx = mIndexedWidgets.indexOf( item ); + if ( idx < 0 ) + continue; + if ( mLayer->pendingFields().fieldOrigin( idx ) == QgsFields::OriginExpression ) expressionFields << idx; else diff --git a/src/app/qgsmaptoolmovelabel.cpp b/src/app/qgsmaptoolmovelabel.cpp index 7d12e7ec89d..a3d456c1f49 100644 --- a/src/app/qgsmaptoolmovelabel.cpp +++ b/src/app/qgsmaptoolmovelabel.cpp @@ -24,6 +24,8 @@ QgsMapToolMoveLabel::QgsMapToolMoveLabel( QgsMapCanvas* canvas ) : QgsMapToolLabel( canvas ) + , mClickOffsetX( 0 ) + , mClickOffsetY( 0 ) { mToolName = tr( "Move label" ); } diff --git a/src/app/qgsmergeattributesdialog.cpp b/src/app/qgsmergeattributesdialog.cpp index f1fd4621571..15066b530b7 100644 --- a/src/app/qgsmergeattributesdialog.cpp +++ b/src/app/qgsmergeattributesdialog.cpp @@ -194,6 +194,9 @@ void QgsMergeAttributesDialog::comboValueChanged( const QString &text ) return; } int column = findComboColumn( senderComboBox ); + if ( column < 0 ) + return; + refreshMergedValue( column ); } diff --git a/src/core/layertree/qgslayertreemodellegendnode.cpp b/src/core/layertree/qgslayertreemodellegendnode.cpp index 1ac1ead304c..c1352a19dce 100644 --- a/src/core/layertree/qgslayertreemodellegendnode.cpp +++ b/src/core/layertree/qgslayertreemodellegendnode.cpp @@ -476,7 +476,7 @@ QSizeF QgsRasterSymbolLegendNode::drawSymbol( const QgsLegendSettings& settings, if ( QgsRasterLayer* rasterLayer = dynamic_cast( layerNode()->layer() ) ) { if ( QgsRasterRenderer* rasterRenderer = rasterLayer->renderer() ) - itemColor.setAlpha( rasterRenderer ? rasterRenderer->opacity() * 255.0 : 255 ); + itemColor.setAlpha( rasterRenderer->opacity() * 255.0 ); } ctx->painter->setBrush( itemColor ); diff --git a/src/core/qgscoordinatetransform.cpp b/src/core/qgscoordinatetransform.cpp index 019fb1e8137..ce0515c6b2a 100644 --- a/src/core/qgscoordinatetransform.cpp +++ b/src/core/qgscoordinatetransform.cpp @@ -39,6 +39,7 @@ extern "C" QgsCoordinateTransform::QgsCoordinateTransform() : QObject() + , mShortCircuit( false ) , mInitialisedFlag( false ) , mSourceProjection( 0 ) , mDestinationProjection( 0 ) @@ -50,6 +51,7 @@ QgsCoordinateTransform::QgsCoordinateTransform() QgsCoordinateTransform::QgsCoordinateTransform( const QgsCoordinateReferenceSystem& source, const QgsCoordinateReferenceSystem& dest ) : QObject() + , mShortCircuit( false ) , mInitialisedFlag( false ) , mSourceProjection( 0 ) , mDestinationProjection( 0 ) diff --git a/src/core/qgscoordinatetransform.h b/src/core/qgscoordinatetransform.h index 7b65007b6f0..ca30c2f942d 100644 --- a/src/core/qgscoordinatetransform.h +++ b/src/core/qgscoordinatetransform.h @@ -200,12 +200,12 @@ class CORE_EXPORT QgsCoordinateTransform : public QObject * Flag to indicate whether the coordinate systems have been initialised * @return true if initialised, otherwise false */ - bool isInitialised() const {return mInitialisedFlag;}; + bool isInitialised() const {return mInitialisedFlag;} /*! See if the transform short circuits because src and dest are equivalent * @return bool True if it short circuits */ - bool isShortCircuited() {return mShortCircuit;}; + bool isShortCircuited() {return mShortCircuit;} /*! Change the destination coordinate system by passing it a qgis srsid * A QGIS srsid is a unique key value to an entry on the tbl_srs in the diff --git a/src/core/qgsfeaturerequest.cpp b/src/core/qgsfeaturerequest.cpp index bf2986abe86..412a1228c7f 100644 --- a/src/core/qgsfeaturerequest.cpp +++ b/src/core/qgsfeaturerequest.cpp @@ -24,6 +24,7 @@ const QString QgsFeatureRequest::AllAttributes = QString( "#!allattributes!#" ); QgsFeatureRequest::QgsFeatureRequest() : mFilter( FilterNone ) + , mFilterFid( -1 ) , mFilterExpression( 0 ) , mFlags( 0 ) { diff --git a/src/core/qgsfield.cpp b/src/core/qgsfield.cpp index ffd10951134..7f13f509b43 100644 --- a/src/core/qgsfield.cpp +++ b/src/core/qgsfield.cpp @@ -185,6 +185,9 @@ bool QgsFields::appendExpressionField( const QgsField& field, int originIndex ) void QgsFields::remove( int fieldIdx ) { + if ( !exists( fieldIdx ) ) + return; + mNameToIndex.remove( mFields[fieldIdx].field.name() ); mFields.remove( fieldIdx ); } @@ -197,6 +200,14 @@ void QgsFields::extend( const QgsFields& other ) } } +QgsFields::FieldOrigin QgsFields::fieldOrigin( int fieldIdx ) const +{ + if ( !exists( fieldIdx ) ) + return OriginUnknown; + + return mFields[fieldIdx].origin; +} + QList QgsFields::toList() const { QList lst; diff --git a/src/core/qgsfield.h b/src/core/qgsfield.h index 19c89131443..0fab69c20ef 100644 --- a/src/core/qgsfield.h +++ b/src/core/qgsfield.h @@ -231,7 +231,7 @@ class CORE_EXPORT QgsFields const QgsField& field( const QString& name ) const { return mFields[ indexFromName( name )].field; } //! Get field's origin (value from an enumeration) - FieldOrigin fieldOrigin( int fieldIdx ) const { return mFields[fieldIdx].origin; } + FieldOrigin fieldOrigin( int fieldIdx ) const; //! Get field's origin index (its meaning is specific to each type of origin) int fieldOriginIndex( int fieldIdx ) const { return mFields[fieldIdx].originIndex; } @@ -261,6 +261,7 @@ class CORE_EXPORT QgsFields //! map for quick resolution of name to index QHash mNameToIndex; + }; diff --git a/src/core/qgsmaprenderer.cpp b/src/core/qgsmaprenderer.cpp index 4d75d27a6ca..2222d993c0a 100644 --- a/src/core/qgsmaprenderer.cpp +++ b/src/core/qgsmaprenderer.cpp @@ -175,7 +175,7 @@ void QgsMapRenderer::adjustExtentToSize() if ( !myWidth || !myHeight ) { mScale = 1.0; - newCoordXForm.setParameters( 0, 0, 0, 0 ); + newCoordXForm.setParameters( 1, 0, 0, 0 ); return; } diff --git a/src/core/qgsmessageoutput.cpp b/src/core/qgsmessageoutput.cpp index 0c0766b9c15..4870504088e 100644 --- a/src/core/qgsmessageoutput.cpp +++ b/src/core/qgsmessageoutput.cpp @@ -47,6 +47,7 @@ QgsMessageOutput::~QgsMessageOutput() QgsMessageOutputConsole::QgsMessageOutputConsole() : mMessage( "" ) + , mMsgType( MessageText ) { } diff --git a/src/core/qgsvectorlayer.cpp b/src/core/qgsvectorlayer.cpp index 8d9ae0485f4..5d67a1d228c 100644 --- a/src/core/qgsvectorlayer.cpp +++ b/src/core/qgsvectorlayer.cpp @@ -2091,6 +2091,9 @@ void QgsVectorLayer::addAttributeEditorWidget( QgsAttributeEditorElement* data ) const QString QgsVectorLayer::editorWidgetV2( int fieldIdx ) const { + if ( fieldIdx < 0 || fieldIdx >= mUpdatedFields.count() ) + return "TextEdit"; + return mEditorWidgetV2Types.value( mUpdatedFields[fieldIdx].name(), "TextEdit" ); } diff --git a/src/core/raster/qgshuesaturationfilter.cpp b/src/core/raster/qgshuesaturationfilter.cpp index 836c7625e49..06148d20ee1 100644 --- a/src/core/raster/qgshuesaturationfilter.cpp +++ b/src/core/raster/qgshuesaturationfilter.cpp @@ -25,9 +25,12 @@ QgsHueSaturationFilter::QgsHueSaturationFilter( QgsRasterInterface* input ) : QgsRasterInterface( input ), mSaturation( 0 ), + mSaturationScale( 1 ), mGrayscaleMode( QgsHueSaturationFilter::GrayscaleOff ), mColorizeOn( false ), mColorizeColor( QColor::fromRgb( 255, 128, 128 ) ), + mColorizeH( 0 ), + mColorizeS( 50 ), mColorizeStrength( 100 ) { } diff --git a/src/core/raster/qgsrasterblock.cpp b/src/core/raster/qgsrasterblock.cpp index ea1afb48561..8c34c3d1d6f 100644 --- a/src/core/raster/qgsrasterblock.cpp +++ b/src/core/raster/qgsrasterblock.cpp @@ -261,6 +261,7 @@ QGis::DataType QgsRasterBlock::typeWithNoDataValue( QGis::DataType dataType, dou case QGis::Float64: *noDataValue = std::numeric_limits::max() * -1.0; newDataType = QGis::Float64; + break; default: QgsDebugMsg( QString( "Unknow data type %1" ).arg( dataType ) ); return QGis::UnknownDataType; diff --git a/src/core/symbology-ng/qgscptcityarchive.cpp b/src/core/symbology-ng/qgscptcityarchive.cpp index b9d8c26a3a8..8e4eac4e07d 100644 --- a/src/core/symbology-ng/qgscptcityarchive.cpp +++ b/src/core/symbology-ng/qgscptcityarchive.cpp @@ -984,7 +984,7 @@ QMap< QString, QStringList > QgsCptCityDirectoryItem::rampsMap() curName = schemeName; curVariant = ""; - // stupid code to find if name ends with 1-3 digit number - should use regexp + // find if name ends with 1-3 digit number // TODO need to detect if ends with b/c also if ( schemeName.length() > 1 && schemeName.endsWith( "a" ) && ! listVariant.isEmpty() && (( prevName + listVariant.last() + "a" ) == curName ) ) @@ -994,32 +994,15 @@ QMap< QString, QStringList > QgsCptCityDirectoryItem::rampsMap() } else { - num = schemeName.right( 3 ).toInt( &ok ); - Q_UNUSED( num ); - if ( ok ) + QRegExp rxVariant( "^(.*[^\\d])(\\d{1,3})$" ); + int pos = rxVariant.indexIn( schemeName ); + if ( pos > -1 ) { - curName = schemeName.left( schemeName.size() - 3 ); - curVariant = schemeName.right( 3 ); - } - else - { - num = schemeName.right( 2 ).toInt( &ok ); - if ( ok ) - { - curName = schemeName.left( schemeName.size() - 2 ); - curVariant = schemeName.right( 2 ); - } - else - { - num = schemeName.right( 1 ).toInt( &ok ); - if ( ok ) - { - curName = schemeName.left( schemeName.size() - 1 ); - curVariant = schemeName.right( 1 ); - } - } + curName = rxVariant.cap( 1 ); + curVariant = rxVariant.cap( 2 ); } } + curSep = curName.right( 1 ); if ( curSep == "-" || curSep == "_" ) { diff --git a/src/core/symbology-ng/qgsfillsymbollayerv2.cpp b/src/core/symbology-ng/qgsfillsymbollayerv2.cpp index 1f002fab074..903b1197c01 100644 --- a/src/core/symbology-ng/qgsfillsymbollayerv2.cpp +++ b/src/core/symbology-ng/qgsfillsymbollayerv2.cpp @@ -1437,7 +1437,14 @@ void QgsShapeburstFillSymbolLayerV2::dtArrayToQImage( double * array, QImage *im squaredVal = array[idx]; //scale result to fit in the range [0, 1] - pixVal = squaredVal > 0 ? qMin(( sqrt( squaredVal ) / maxDistanceValue ), 1.0 ) : 0; + if ( maxDistanceValue > 0 ) + { + pixVal = squaredVal > 0 ? qMin(( sqrt( squaredVal ) / maxDistanceValue ), 1.0 ) : 0; + } + else + { + pixVal = 1.0; + } //convert value to color from ramp pixColor = ramp->color( pixVal ); diff --git a/src/core/symbology-ng/qgsheatmaprenderer.cpp b/src/core/symbology-ng/qgsheatmaprenderer.cpp index a213f76fd37..156b940553a 100644 --- a/src/core/symbology-ng/qgsheatmaprenderer.cpp +++ b/src/core/symbology-ng/qgsheatmaprenderer.cpp @@ -31,12 +31,17 @@ QgsHeatmapRenderer::QgsHeatmapRenderer( ) : QgsFeatureRendererV2( "heatmapRenderer" ) + , mCalculatedMaxValue( 0 ) , mRadius( 10 ) + , mRadiusPixels( 0 ) + , mRadiusSquared( 0 ) , mRadiusUnit( QgsSymbolV2::MM ) + , mWeightAttrNum( -1 ) , mGradientRamp( 0 ) , mInvertRamp( false ) , mExplicitMax( 0.0 ) , mRenderQuality( 1 ) + , mFeaturesRendered( 0 ) { mGradientRamp = new QgsVectorGradientColorRampV2( QColor( 255, 255, 255 ), QColor( 0, 0, 0 ) ); diff --git a/src/gui/attributetable/qgsdualview.cpp b/src/gui/attributetable/qgsdualview.cpp index 16e41a5e233..960287dea2f 100644 --- a/src/gui/attributetable/qgsdualview.cpp +++ b/src/gui/attributetable/qgsdualview.cpp @@ -154,7 +154,11 @@ void QgsDualView::columnBoxInit() Q_FOREACH ( const QgsField& field, fields ) { - if ( mLayerCache->layer()->editorWidgetV2( mLayerCache->layer()->fieldNameIndex( field.name() ) ) != "Hidden" ) + int fieldIndex = mLayerCache->layer()->fieldNameIndex( field.name() ); + if ( fieldIndex == -1 ) + continue; + + if ( mLayerCache->layer()->editorWidgetV2( fieldIndex ) != "Hidden" ) { QIcon icon = QgsApplication::getThemeIcon( "/mActionNewAttribute.png" ); QString text = field.name(); diff --git a/src/gui/qgsattributeform.cpp b/src/gui/qgsattributeform.cpp index 73ac159d5f8..66c2d791de1 100644 --- a/src/gui/qgsattributeform.cpp +++ b/src/gui/qgsattributeform.cpp @@ -421,6 +421,9 @@ void QgsAttributeForm::init() Q_FOREACH ( const QgsField& field, mLayer->pendingFields().toList() ) { int idx = mLayer->fieldNameIndex( field.name() ); + if ( idx < 0 ) + continue; + //show attribute alias if available QString fieldName = mLayer->attributeDisplayName( idx ); diff --git a/src/gui/qgscomposerruler.cpp b/src/gui/qgscomposerruler.cpp index db6814c5874..1f32746e6a3 100644 --- a/src/gui/qgscomposerruler.cpp +++ b/src/gui/qgscomposerruler.cpp @@ -234,6 +234,9 @@ void QgsComposerRuler::drawRotatedText( QPainter *painter, QPointF pos, const QS void QgsComposerRuler::drawSmallDivisions( QPainter *painter, double startPos, int numDivisions, double rulerScale, double maxPos ) { + if ( numDivisions == 0 ) + return; + //draw small divisions starting at startPos (in mm) double smallMarkerPos = startPos; double smallDivisionSpacing = rulerScale / numDivisions; diff --git a/src/gui/qgscomposerview.cpp b/src/gui/qgscomposerview.cpp index 1e48ad2074c..6e4cef2f9fc 100644 --- a/src/gui/qgscomposerview.cpp +++ b/src/gui/qgscomposerview.cpp @@ -49,6 +49,8 @@ QgsComposerView::QgsComposerView( QWidget* parent, const char* name, Qt::WindowFlags f ) : QGraphicsView( parent ) + , mCurrentTool( Select ) + , mPreviousTool( Select ) , mRubberBandItem( 0 ) , mRubberBandLineItem( 0 ) , mMoveContentItem( 0 ) diff --git a/src/gui/qgsexpressionbuilderwidget.cpp b/src/gui/qgsexpressionbuilderwidget.cpp index 685176a2556..65ea8abb1a3 100644 --- a/src/gui/qgsexpressionbuilderwidget.cpp +++ b/src/gui/qgsexpressionbuilderwidget.cpp @@ -274,6 +274,10 @@ void QgsExpressionBuilderWidget::fillFieldValues( int fieldIndex, int countLimit // TODO We should thread this so that we don't hold the user up if the layer is massive. mValueListWidget->clear(); + + if ( fieldIndex < 0 ) + return; + mValueListWidget->setUpdatesEnabled( false ); mValueListWidget->blockSignals( true ); @@ -566,6 +570,7 @@ void QgsExpressionBuilderWidget::loadSampleValues() mValueGroupBox->show(); int fieldIndex = mLayer->fieldNameIndex( item->text() ); + fillFieldValues( fieldIndex, 10 ); } diff --git a/src/gui/qgsidentifymenu.h b/src/gui/qgsidentifymenu.h index a3327d486d9..4a5a63aed8c 100644 --- a/src/gui/qgsidentifymenu.h +++ b/src/gui/qgsidentifymenu.h @@ -48,6 +48,7 @@ class GUI_EXPORT QgsIdentifyMenu : public QMenu , mAllResults( false ) , mIsExternalAction( false ) , mLayer( NULL ) + , mFeatureId( 0 ) , mLevel( LayerLevel ) , mMapLayerAction( NULL ) {} @@ -57,6 +58,7 @@ class GUI_EXPORT QgsIdentifyMenu : public QMenu , mAllResults( layer == 0 ) , mIsExternalAction( mapLayerAction != 0 ) , mLayer( layer ) + , mFeatureId( 0 ) , mLevel( LayerLevel ) , mMapLayerAction( mapLayerAction ) {} diff --git a/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp b/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp index 42db841b910..dffadba4767 100644 --- a/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp +++ b/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp @@ -581,8 +581,10 @@ QgsRendererRulePropsDialog::QgsRendererRulePropsDialog( QgsRuleBasedRendererV2:: { groupScale->setChecked( true ); // caution: rule uses scale denom, scale widget uses true scales - mScaleRangeWidget->setMaximumScale( 1.0 / rule->scaleMinDenom() ); - mScaleRangeWidget->setMinimumScale( 1.0 / rule->scaleMaxDenom() ); + if ( rule->scaleMinDenom() > 0 ) + mScaleRangeWidget->setMaximumScale( 1.0 / rule->scaleMinDenom() ); + if ( rule->scaleMaxDenom() > 0 ) + mScaleRangeWidget->setMinimumScale( 1.0 / rule->scaleMaxDenom() ); } if ( mRule->symbol() ) diff --git a/src/plugins/heatmap/heatmap.cpp b/src/plugins/heatmap/heatmap.cpp index 77447f56424..f9ae7c2aca8 100644 --- a/src/plugins/heatmap/heatmap.cpp +++ b/src/plugins/heatmap/heatmap.cpp @@ -444,7 +444,7 @@ double Heatmap::quarticKernel( const double distance, const int bandwidth, const case Heatmap::Scaled: { // Normalizing constant - double k = outputType == Heatmap::Scaled ? 116. / ( 5. * M_PI * pow(( double )bandwidth, 2 ) ) : 1.0; + double k = 116. / ( 5. * M_PI * pow(( double )bandwidth, 2 ) ); // Derived from Wand and Jones (1995), p. 175 return k * ( 15. / 16. ) * pow( 1. - pow( distance / ( double )bandwidth, 2 ), 2 ); @@ -461,7 +461,7 @@ double Heatmap::triweightKernel( const double distance, const int bandwidth, con case Heatmap::Scaled: { // Normalizing constant - double k = outputType == Heatmap::Scaled ? 128. / ( 35. * M_PI * pow(( double )bandwidth, 2 ) ) : 1.0; + double k = 128. / ( 35. * M_PI * pow(( double )bandwidth, 2 ) ); // Derived from Wand and Jones (1995), p. 175 return k * ( 35. / 32. ) * pow( 1. - pow( distance / ( double )bandwidth, 2 ), 3 ); @@ -478,7 +478,7 @@ double Heatmap::epanechnikovKernel( const double distance, const int bandwidth, case Heatmap::Scaled: { // Normalizing constant - double k = outputType == Heatmap::Scaled ? 8. / ( 3. * M_PI * pow(( double )bandwidth, 2 ) ) : 1.0; + double k = 8. / ( 3. * M_PI * pow(( double )bandwidth, 2 ) ); // Derived from Wand and Jones (1995), p. 175 return k * ( 3. / 4. ) * ( 1. - pow( distance / ( double )bandwidth, 2 ) ); diff --git a/src/plugins/roadgraph/shortestpathwidget.cpp b/src/plugins/roadgraph/shortestpathwidget.cpp index 4c95bb9daa2..62cf0b98636 100644 --- a/src/plugins/roadgraph/shortestpathwidget.cpp +++ b/src/plugins/roadgraph/shortestpathwidget.cpp @@ -281,6 +281,18 @@ QgsGraph* RgShortestPathWidget::getPath( QgsPoint& p1, QgsPoint& p2 ) QgsGraph *graph = builder.graph(); int startVertexIdx = graph->findVertex( p1 ); + if ( startVertexIdx < 0 ) + { + mPlugin->iface()->messageBar()->pushMessage( + tr( "Cannot calculate path" ), + tr( "Could not find start vertex. Please check your input data." ), + QgsMessageBar::WARNING, + mPlugin->iface()->messageTimeout() + ); + + delete graph; + return NULL; + } int criterionNum = 0; if ( mCriterionName->currentIndex() > 0 ) @@ -328,6 +340,9 @@ void RgShortestPathWidget::findingPath() QList< QgsPoint > p; while ( startVertexIdx != stopVertexIdx ) { + if ( stopVertexIdx < 0 ) + break; + QgsGraphArcIdList l = path->vertex( stopVertexIdx ).inArc(); if ( l.empty() ) break; @@ -399,6 +414,9 @@ void RgShortestPathWidget::exportPath() QgsPolyline p; while ( startVertexIdx != stopVertexIdx ) { + if ( stopVertexIdx < 0 ) + break; + QgsGraphArcIdList l = path->vertex( stopVertexIdx ).inArc(); if ( l.empty() ) break; diff --git a/src/providers/mssql/qgsmssqldataitems.h b/src/providers/mssql/qgsmssqldataitems.h index de1ff5ce9f7..cc3fcd31268 100644 --- a/src/providers/mssql/qgsmssqldataitems.h +++ b/src/providers/mssql/qgsmssqldataitems.h @@ -62,7 +62,7 @@ class QgsMssqlConnectionItem : public QgsDataCollectionItem virtual bool handleDrop( const QMimeData * data, Qt::DropAction action ) override; void refresh() override; - QString connInfo() const { return mConnInfo; }; + QString connInfo() const { return mConnInfo; } signals: void addGeometryColumn( QgsMssqlLayerProperty ); @@ -98,7 +98,7 @@ class QgsMssqlSchemaItem : public QgsDataCollectionItem QVector createChildren() override; QgsMssqlLayerItem* addLayer( QgsMssqlLayerProperty layerProperty, bool refresh ); - void refresh() override {}; // do not refresh directly + void refresh() override {} // do not refresh directly void addLayers( QgsDataItem* newLayers ); }; @@ -113,7 +113,6 @@ class QgsMssqlLayerItem : public QgsLayerItem QString createUri(); QgsMssqlLayerItem* createClone(); - bool Used; private: QgsMssqlLayerProperty mLayerProperty; diff --git a/src/providers/spatialite/qgsspatialiteprovider.cpp b/src/providers/spatialite/qgsspatialiteprovider.cpp index 1e73bda5530..c3189449d66 100644 --- a/src/providers/spatialite/qgsspatialiteprovider.cpp +++ b/src/providers/spatialite/qgsspatialiteprovider.cpp @@ -5341,13 +5341,11 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS return false; } - bool saved = ( SQLITE_OK == ret ) ? true : false; - if ( NULL != errMsg ) sqlite3_free( errMsg ); QgsSqliteHandle::closeDb( handle ); - return saved; + return true; } diff --git a/src/providers/wcs/qgswcscapabilities.cpp b/src/providers/wcs/qgswcscapabilities.cpp index 79108630d19..dd8e4f88de4 100644 --- a/src/providers/wcs/qgswcscapabilities.cpp +++ b/src/providers/wcs/qgswcscapabilities.cpp @@ -79,6 +79,7 @@ QgsWcsCapabilities::QgsWcsCapabilities() : mCapabilities() , mCapabilitiesReply( NULL ) , mCoverageCount( 0 ) + , mCacheLoadControl( QNetworkRequest::PreferNetwork ) { } diff --git a/src/server/qgsremoteowsbuilder.cpp b/src/server/qgsremoteowsbuilder.cpp index 6cfd39906f6..838a2996cce 100644 --- a/src/server/qgsremoteowsbuilder.cpp +++ b/src/server/qgsremoteowsbuilder.cpp @@ -213,7 +213,7 @@ QgsRasterLayer* QgsRemoteOWSBuilder::wmsLayerFromUrl( const QString& url, const uri.setParam( "crs", crs ); uri.setParam( "layers", layerList ); uri.setParam( "styles", styleList ); - result = new QgsRasterLayer( uri.encodedUri(), "", "wms" ); + result = new QgsRasterLayer( uri.encodedUri(), "", QString( "wms" ) ); if ( !result->isValid() ) { return 0;