More coverity fixes

This commit is contained in:
Nyall Dawson 2015-02-10 17:37:17 +11:00
parent dc156c8d79
commit a7f774037a
31 changed files with 114 additions and 44 deletions

View File

@ -287,7 +287,11 @@ void QgsAttributeTableDialog::columnBoxInit()
foreach ( const QgsField field, fields ) 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" ); QIcon icon = QgsApplication::getThemeIcon( "/mActionNewAttribute.png" );
QString text = field.name(); QString text = field.name();
@ -650,6 +654,9 @@ void QgsAttributeTableDialog::filterQueryChanged( const QString& query )
const QgsFields& flds = mLayer->pendingFields(); const QgsFields& flds = mLayer->pendingFields();
int fldIndex = mLayer->fieldNameIndex( fieldName ); int fldIndex = mLayer->fieldNameIndex( fieldName );
if ( fldIndex < 0 )
return;
QVariant::Type fldType = flds[fldIndex].type(); QVariant::Type fldType = flds[fldIndex].type();
bool numeric = ( fldType == QVariant::Int || fldType == QVariant::Double ); bool numeric = ( fldType == QVariant::Int || fldType == QVariant::Double );

View File

@ -550,6 +550,9 @@ void QgsFieldsProperties::on_mDeleteAttributeButton_clicked()
if ( item->column() == 0 ) if ( item->column() == 0 )
{ {
int idx = mIndexedWidgets.indexOf( item ); int idx = mIndexedWidgets.indexOf( item );
if ( idx < 0 )
continue;
if ( mLayer->pendingFields().fieldOrigin( idx ) == QgsFields::OriginExpression ) if ( mLayer->pendingFields().fieldOrigin( idx ) == QgsFields::OriginExpression )
expressionFields << idx; expressionFields << idx;
else else

View File

@ -24,6 +24,8 @@
QgsMapToolMoveLabel::QgsMapToolMoveLabel( QgsMapCanvas* canvas ) QgsMapToolMoveLabel::QgsMapToolMoveLabel( QgsMapCanvas* canvas )
: QgsMapToolLabel( canvas ) : QgsMapToolLabel( canvas )
, mClickOffsetX( 0 )
, mClickOffsetY( 0 )
{ {
mToolName = tr( "Move label" ); mToolName = tr( "Move label" );
} }

View File

@ -194,6 +194,9 @@ void QgsMergeAttributesDialog::comboValueChanged( const QString &text )
return; return;
} }
int column = findComboColumn( senderComboBox ); int column = findComboColumn( senderComboBox );
if ( column < 0 )
return;
refreshMergedValue( column ); refreshMergedValue( column );
} }

View File

@ -476,7 +476,7 @@ QSizeF QgsRasterSymbolLegendNode::drawSymbol( const QgsLegendSettings& settings,
if ( QgsRasterLayer* rasterLayer = dynamic_cast<QgsRasterLayer*>( layerNode()->layer() ) ) if ( QgsRasterLayer* rasterLayer = dynamic_cast<QgsRasterLayer*>( layerNode()->layer() ) )
{ {
if ( QgsRasterRenderer* rasterRenderer = rasterLayer->renderer() ) if ( QgsRasterRenderer* rasterRenderer = rasterLayer->renderer() )
itemColor.setAlpha( rasterRenderer ? rasterRenderer->opacity() * 255.0 : 255 ); itemColor.setAlpha( rasterRenderer->opacity() * 255.0 );
} }
ctx->painter->setBrush( itemColor ); ctx->painter->setBrush( itemColor );

View File

@ -39,6 +39,7 @@ extern "C"
QgsCoordinateTransform::QgsCoordinateTransform() QgsCoordinateTransform::QgsCoordinateTransform()
: QObject() : QObject()
, mShortCircuit( false )
, mInitialisedFlag( false ) , mInitialisedFlag( false )
, mSourceProjection( 0 ) , mSourceProjection( 0 )
, mDestinationProjection( 0 ) , mDestinationProjection( 0 )
@ -50,6 +51,7 @@ QgsCoordinateTransform::QgsCoordinateTransform()
QgsCoordinateTransform::QgsCoordinateTransform( const QgsCoordinateReferenceSystem& source, const QgsCoordinateReferenceSystem& dest ) QgsCoordinateTransform::QgsCoordinateTransform( const QgsCoordinateReferenceSystem& source, const QgsCoordinateReferenceSystem& dest )
: QObject() : QObject()
, mShortCircuit( false )
, mInitialisedFlag( false ) , mInitialisedFlag( false )
, mSourceProjection( 0 ) , mSourceProjection( 0 )
, mDestinationProjection( 0 ) , mDestinationProjection( 0 )

View File

@ -200,12 +200,12 @@ class CORE_EXPORT QgsCoordinateTransform : public QObject
* Flag to indicate whether the coordinate systems have been initialised * Flag to indicate whether the coordinate systems have been initialised
* @return true if initialised, otherwise false * @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 /*! See if the transform short circuits because src and dest are equivalent
* @return bool True if it short circuits * @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 /*! 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 * A QGIS srsid is a unique key value to an entry on the tbl_srs in the

View File

@ -24,6 +24,7 @@ const QString QgsFeatureRequest::AllAttributes = QString( "#!allattributes!#" );
QgsFeatureRequest::QgsFeatureRequest() QgsFeatureRequest::QgsFeatureRequest()
: mFilter( FilterNone ) : mFilter( FilterNone )
, mFilterFid( -1 )
, mFilterExpression( 0 ) , mFilterExpression( 0 )
, mFlags( 0 ) , mFlags( 0 )
{ {

View File

@ -185,6 +185,9 @@ bool QgsFields::appendExpressionField( const QgsField& field, int originIndex )
void QgsFields::remove( int fieldIdx ) void QgsFields::remove( int fieldIdx )
{ {
if ( !exists( fieldIdx ) )
return;
mNameToIndex.remove( mFields[fieldIdx].field.name() ); mNameToIndex.remove( mFields[fieldIdx].field.name() );
mFields.remove( fieldIdx ); 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<QgsField> QgsFields::toList() const QList<QgsField> QgsFields::toList() const
{ {
QList<QgsField> lst; QList<QgsField> lst;

View File

@ -231,7 +231,7 @@ class CORE_EXPORT QgsFields
const QgsField& field( const QString& name ) const { return mFields[ indexFromName( name )].field; } const QgsField& field( const QString& name ) const { return mFields[ indexFromName( name )].field; }
//! Get field's origin (value from an enumeration) //! 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) //! Get field's origin index (its meaning is specific to each type of origin)
int fieldOriginIndex( int fieldIdx ) const { return mFields[fieldIdx].originIndex; } 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 //! map for quick resolution of name to index
QHash<QString, int> mNameToIndex; QHash<QString, int> mNameToIndex;
}; };

View File

@ -175,7 +175,7 @@ void QgsMapRenderer::adjustExtentToSize()
if ( !myWidth || !myHeight ) if ( !myWidth || !myHeight )
{ {
mScale = 1.0; mScale = 1.0;
newCoordXForm.setParameters( 0, 0, 0, 0 ); newCoordXForm.setParameters( 1, 0, 0, 0 );
return; return;
} }

View File

@ -47,6 +47,7 @@ QgsMessageOutput::~QgsMessageOutput()
QgsMessageOutputConsole::QgsMessageOutputConsole() QgsMessageOutputConsole::QgsMessageOutputConsole()
: mMessage( "" ) : mMessage( "" )
, mMsgType( MessageText )
{ {
} }

View File

@ -2091,6 +2091,9 @@ void QgsVectorLayer::addAttributeEditorWidget( QgsAttributeEditorElement* data )
const QString QgsVectorLayer::editorWidgetV2( int fieldIdx ) const const QString QgsVectorLayer::editorWidgetV2( int fieldIdx ) const
{ {
if ( fieldIdx < 0 || fieldIdx >= mUpdatedFields.count() )
return "TextEdit";
return mEditorWidgetV2Types.value( mUpdatedFields[fieldIdx].name(), "TextEdit" ); return mEditorWidgetV2Types.value( mUpdatedFields[fieldIdx].name(), "TextEdit" );
} }

View File

@ -25,9 +25,12 @@
QgsHueSaturationFilter::QgsHueSaturationFilter( QgsRasterInterface* input ) QgsHueSaturationFilter::QgsHueSaturationFilter( QgsRasterInterface* input )
: QgsRasterInterface( input ), : QgsRasterInterface( input ),
mSaturation( 0 ), mSaturation( 0 ),
mSaturationScale( 1 ),
mGrayscaleMode( QgsHueSaturationFilter::GrayscaleOff ), mGrayscaleMode( QgsHueSaturationFilter::GrayscaleOff ),
mColorizeOn( false ), mColorizeOn( false ),
mColorizeColor( QColor::fromRgb( 255, 128, 128 ) ), mColorizeColor( QColor::fromRgb( 255, 128, 128 ) ),
mColorizeH( 0 ),
mColorizeS( 50 ),
mColorizeStrength( 100 ) mColorizeStrength( 100 )
{ {
} }

View File

@ -261,6 +261,7 @@ QGis::DataType QgsRasterBlock::typeWithNoDataValue( QGis::DataType dataType, dou
case QGis::Float64: case QGis::Float64:
*noDataValue = std::numeric_limits<double>::max() * -1.0; *noDataValue = std::numeric_limits<double>::max() * -1.0;
newDataType = QGis::Float64; newDataType = QGis::Float64;
break;
default: default:
QgsDebugMsg( QString( "Unknow data type %1" ).arg( dataType ) ); QgsDebugMsg( QString( "Unknow data type %1" ).arg( dataType ) );
return QGis::UnknownDataType; return QGis::UnknownDataType;

View File

@ -984,7 +984,7 @@ QMap< QString, QStringList > QgsCptCityDirectoryItem::rampsMap()
curName = schemeName; curName = schemeName;
curVariant = ""; 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 // TODO need to detect if ends with b/c also
if ( schemeName.length() > 1 && schemeName.endsWith( "a" ) && ! listVariant.isEmpty() && if ( schemeName.length() > 1 && schemeName.endsWith( "a" ) && ! listVariant.isEmpty() &&
(( prevName + listVariant.last() + "a" ) == curName ) ) (( prevName + listVariant.last() + "a" ) == curName ) )
@ -994,32 +994,15 @@ QMap< QString, QStringList > QgsCptCityDirectoryItem::rampsMap()
} }
else else
{ {
num = schemeName.right( 3 ).toInt( &ok ); QRegExp rxVariant( "^(.*[^\\d])(\\d{1,3})$" );
Q_UNUSED( num ); int pos = rxVariant.indexIn( schemeName );
if ( ok ) if ( pos > -1 )
{ {
curName = schemeName.left( schemeName.size() - 3 ); curName = rxVariant.cap( 1 );
curVariant = schemeName.right( 3 ); curVariant = rxVariant.cap( 2 );
}
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 );
}
}
} }
} }
curSep = curName.right( 1 ); curSep = curName.right( 1 );
if ( curSep == "-" || curSep == "_" ) if ( curSep == "-" || curSep == "_" )
{ {

View File

@ -1437,7 +1437,14 @@ void QgsShapeburstFillSymbolLayerV2::dtArrayToQImage( double * array, QImage *im
squaredVal = array[idx]; squaredVal = array[idx];
//scale result to fit in the range [0, 1] //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 //convert value to color from ramp
pixColor = ramp->color( pixVal ); pixColor = ramp->color( pixVal );

View File

@ -31,12 +31,17 @@
QgsHeatmapRenderer::QgsHeatmapRenderer( ) QgsHeatmapRenderer::QgsHeatmapRenderer( )
: QgsFeatureRendererV2( "heatmapRenderer" ) : QgsFeatureRendererV2( "heatmapRenderer" )
, mCalculatedMaxValue( 0 )
, mRadius( 10 ) , mRadius( 10 )
, mRadiusPixels( 0 )
, mRadiusSquared( 0 )
, mRadiusUnit( QgsSymbolV2::MM ) , mRadiusUnit( QgsSymbolV2::MM )
, mWeightAttrNum( -1 )
, mGradientRamp( 0 ) , mGradientRamp( 0 )
, mInvertRamp( false ) , mInvertRamp( false )
, mExplicitMax( 0.0 ) , mExplicitMax( 0.0 )
, mRenderQuality( 1 ) , mRenderQuality( 1 )
, mFeaturesRendered( 0 )
{ {
mGradientRamp = new QgsVectorGradientColorRampV2( QColor( 255, 255, 255 ), QColor( 0, 0, 0 ) ); mGradientRamp = new QgsVectorGradientColorRampV2( QColor( 255, 255, 255 ), QColor( 0, 0, 0 ) );

View File

@ -154,7 +154,11 @@ void QgsDualView::columnBoxInit()
Q_FOREACH ( const QgsField& field, fields ) 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" ); QIcon icon = QgsApplication::getThemeIcon( "/mActionNewAttribute.png" );
QString text = field.name(); QString text = field.name();

View File

@ -421,6 +421,9 @@ void QgsAttributeForm::init()
Q_FOREACH ( const QgsField& field, mLayer->pendingFields().toList() ) Q_FOREACH ( const QgsField& field, mLayer->pendingFields().toList() )
{ {
int idx = mLayer->fieldNameIndex( field.name() ); int idx = mLayer->fieldNameIndex( field.name() );
if ( idx < 0 )
continue;
//show attribute alias if available //show attribute alias if available
QString fieldName = mLayer->attributeDisplayName( idx ); QString fieldName = mLayer->attributeDisplayName( idx );

View File

@ -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 ) 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) //draw small divisions starting at startPos (in mm)
double smallMarkerPos = startPos; double smallMarkerPos = startPos;
double smallDivisionSpacing = rulerScale / numDivisions; double smallDivisionSpacing = rulerScale / numDivisions;

View File

@ -49,6 +49,8 @@
QgsComposerView::QgsComposerView( QWidget* parent, const char* name, Qt::WindowFlags f ) QgsComposerView::QgsComposerView( QWidget* parent, const char* name, Qt::WindowFlags f )
: QGraphicsView( parent ) : QGraphicsView( parent )
, mCurrentTool( Select )
, mPreviousTool( Select )
, mRubberBandItem( 0 ) , mRubberBandItem( 0 )
, mRubberBandLineItem( 0 ) , mRubberBandLineItem( 0 )
, mMoveContentItem( 0 ) , mMoveContentItem( 0 )

View File

@ -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. // TODO We should thread this so that we don't hold the user up if the layer is massive.
mValueListWidget->clear(); mValueListWidget->clear();
if ( fieldIndex < 0 )
return;
mValueListWidget->setUpdatesEnabled( false ); mValueListWidget->setUpdatesEnabled( false );
mValueListWidget->blockSignals( true ); mValueListWidget->blockSignals( true );
@ -566,6 +570,7 @@ void QgsExpressionBuilderWidget::loadSampleValues()
mValueGroupBox->show(); mValueGroupBox->show();
int fieldIndex = mLayer->fieldNameIndex( item->text() ); int fieldIndex = mLayer->fieldNameIndex( item->text() );
fillFieldValues( fieldIndex, 10 ); fillFieldValues( fieldIndex, 10 );
} }

View File

@ -48,6 +48,7 @@ class GUI_EXPORT QgsIdentifyMenu : public QMenu
, mAllResults( false ) , mAllResults( false )
, mIsExternalAction( false ) , mIsExternalAction( false )
, mLayer( NULL ) , mLayer( NULL )
, mFeatureId( 0 )
, mLevel( LayerLevel ) , mLevel( LayerLevel )
, mMapLayerAction( NULL ) , mMapLayerAction( NULL )
{} {}
@ -57,6 +58,7 @@ class GUI_EXPORT QgsIdentifyMenu : public QMenu
, mAllResults( layer == 0 ) , mAllResults( layer == 0 )
, mIsExternalAction( mapLayerAction != 0 ) , mIsExternalAction( mapLayerAction != 0 )
, mLayer( layer ) , mLayer( layer )
, mFeatureId( 0 )
, mLevel( LayerLevel ) , mLevel( LayerLevel )
, mMapLayerAction( mapLayerAction ) , mMapLayerAction( mapLayerAction )
{} {}

View File

@ -581,8 +581,10 @@ QgsRendererRulePropsDialog::QgsRendererRulePropsDialog( QgsRuleBasedRendererV2::
{ {
groupScale->setChecked( true ); groupScale->setChecked( true );
// caution: rule uses scale denom, scale widget uses true scales // caution: rule uses scale denom, scale widget uses true scales
mScaleRangeWidget->setMaximumScale( 1.0 / rule->scaleMinDenom() ); if ( rule->scaleMinDenom() > 0 )
mScaleRangeWidget->setMinimumScale( 1.0 / rule->scaleMaxDenom() ); mScaleRangeWidget->setMaximumScale( 1.0 / rule->scaleMinDenom() );
if ( rule->scaleMaxDenom() > 0 )
mScaleRangeWidget->setMinimumScale( 1.0 / rule->scaleMaxDenom() );
} }
if ( mRule->symbol() ) if ( mRule->symbol() )

View File

@ -444,7 +444,7 @@ double Heatmap::quarticKernel( const double distance, const int bandwidth, const
case Heatmap::Scaled: case Heatmap::Scaled:
{ {
// Normalizing constant // 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 // Derived from Wand and Jones (1995), p. 175
return k * ( 15. / 16. ) * pow( 1. - pow( distance / ( double )bandwidth, 2 ), 2 ); 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: case Heatmap::Scaled:
{ {
// Normalizing constant // 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 // Derived from Wand and Jones (1995), p. 175
return k * ( 35. / 32. ) * pow( 1. - pow( distance / ( double )bandwidth, 2 ), 3 ); 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: case Heatmap::Scaled:
{ {
// Normalizing constant // 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 // Derived from Wand and Jones (1995), p. 175
return k * ( 3. / 4. ) * ( 1. - pow( distance / ( double )bandwidth, 2 ) ); return k * ( 3. / 4. ) * ( 1. - pow( distance / ( double )bandwidth, 2 ) );

View File

@ -281,6 +281,18 @@ QgsGraph* RgShortestPathWidget::getPath( QgsPoint& p1, QgsPoint& p2 )
QgsGraph *graph = builder.graph(); QgsGraph *graph = builder.graph();
int startVertexIdx = graph->findVertex( p1 ); 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; int criterionNum = 0;
if ( mCriterionName->currentIndex() > 0 ) if ( mCriterionName->currentIndex() > 0 )
@ -328,6 +340,9 @@ void RgShortestPathWidget::findingPath()
QList< QgsPoint > p; QList< QgsPoint > p;
while ( startVertexIdx != stopVertexIdx ) while ( startVertexIdx != stopVertexIdx )
{ {
if ( stopVertexIdx < 0 )
break;
QgsGraphArcIdList l = path->vertex( stopVertexIdx ).inArc(); QgsGraphArcIdList l = path->vertex( stopVertexIdx ).inArc();
if ( l.empty() ) if ( l.empty() )
break; break;
@ -399,6 +414,9 @@ void RgShortestPathWidget::exportPath()
QgsPolyline p; QgsPolyline p;
while ( startVertexIdx != stopVertexIdx ) while ( startVertexIdx != stopVertexIdx )
{ {
if ( stopVertexIdx < 0 )
break;
QgsGraphArcIdList l = path->vertex( stopVertexIdx ).inArc(); QgsGraphArcIdList l = path->vertex( stopVertexIdx ).inArc();
if ( l.empty() ) if ( l.empty() )
break; break;

View File

@ -62,7 +62,7 @@ class QgsMssqlConnectionItem : public QgsDataCollectionItem
virtual bool handleDrop( const QMimeData * data, Qt::DropAction action ) override; virtual bool handleDrop( const QMimeData * data, Qt::DropAction action ) override;
void refresh() override; void refresh() override;
QString connInfo() const { return mConnInfo; }; QString connInfo() const { return mConnInfo; }
signals: signals:
void addGeometryColumn( QgsMssqlLayerProperty ); void addGeometryColumn( QgsMssqlLayerProperty );
@ -98,7 +98,7 @@ class QgsMssqlSchemaItem : public QgsDataCollectionItem
QVector<QgsDataItem*> createChildren() override; QVector<QgsDataItem*> createChildren() override;
QgsMssqlLayerItem* addLayer( QgsMssqlLayerProperty layerProperty, bool refresh ); QgsMssqlLayerItem* addLayer( QgsMssqlLayerProperty layerProperty, bool refresh );
void refresh() override {}; // do not refresh directly void refresh() override {} // do not refresh directly
void addLayers( QgsDataItem* newLayers ); void addLayers( QgsDataItem* newLayers );
}; };
@ -113,7 +113,6 @@ class QgsMssqlLayerItem : public QgsLayerItem
QString createUri(); QString createUri();
QgsMssqlLayerItem* createClone(); QgsMssqlLayerItem* createClone();
bool Used;
private: private:
QgsMssqlLayerProperty mLayerProperty; QgsMssqlLayerProperty mLayerProperty;

View File

@ -5341,13 +5341,11 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS
return false; return false;
} }
bool saved = ( SQLITE_OK == ret ) ? true : false;
if ( NULL != errMsg ) if ( NULL != errMsg )
sqlite3_free( errMsg ); sqlite3_free( errMsg );
QgsSqliteHandle::closeDb( handle ); QgsSqliteHandle::closeDb( handle );
return saved; return true;
} }

View File

@ -79,6 +79,7 @@ QgsWcsCapabilities::QgsWcsCapabilities()
: mCapabilities() : mCapabilities()
, mCapabilitiesReply( NULL ) , mCapabilitiesReply( NULL )
, mCoverageCount( 0 ) , mCoverageCount( 0 )
, mCacheLoadControl( QNetworkRequest::PreferNetwork )
{ {
} }

View File

@ -213,7 +213,7 @@ QgsRasterLayer* QgsRemoteOWSBuilder::wmsLayerFromUrl( const QString& url, const
uri.setParam( "crs", crs ); uri.setParam( "crs", crs );
uri.setParam( "layers", layerList ); uri.setParam( "layers", layerList );
uri.setParam( "styles", styleList ); uri.setParam( "styles", styleList );
result = new QgsRasterLayer( uri.encodedUri(), "", "wms" ); result = new QgsRasterLayer( uri.encodedUri(), "", QString( "wms" ) );
if ( !result->isValid() ) if ( !result->isValid() )
{ {
return 0; return 0;