Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid some compiler warnings
  • Loading branch information
nyalldawson committed Jan 14, 2015
1 parent 6cb4114 commit a4ee405
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
10 changes: 10 additions & 0 deletions src/app/qgsmaplayerstyleguiutils.cpp
Expand Up @@ -84,9 +84,13 @@ void QgsMapLayerStyleGuiUtils::addStyle()
bool res = layer->styleManager()->addStyleFromLayer( text );

if ( res ) // make it active!
{
layer->styleManager()->setCurrentStyle( text );
}
else
{
QgsDebugMsg( "Failed to add style: " + text );
}
}

void QgsMapLayerStyleGuiUtils::useStyle()
Expand All @@ -103,7 +107,9 @@ void QgsMapLayerStyleGuiUtils::useStyle()

bool res = layer->styleManager()->setCurrentStyle( name );
if ( !res )
{
QgsDebugMsg( "Failed to set current style: " + name );
}
}


Expand All @@ -118,7 +124,9 @@ void QgsMapLayerStyleGuiUtils::removeStyle()

bool res = layer->styleManager()->removeStyle( layer->styleManager()->currentStyle() );
if ( !res )
{
QgsDebugMsg( "Failed to remove current style" );
}
}


Expand All @@ -142,5 +150,7 @@ void QgsMapLayerStyleGuiUtils::renameStyle()

bool res = layer->styleManager()->renameStyle( name, text );
if ( !res )
{
QgsDebugMsg( "Failed to rename style: " + name );
}
}
3 changes: 2 additions & 1 deletion src/gui/qgsmapcanvassnapper.cpp
Expand Up @@ -311,7 +311,8 @@ int QgsMapCanvasSnapper::snapToBackgroundLayers( const QgsPoint& point, QList<Qg
if ( intersectionPoint->type() == QGis::Point )
{
//We have to check the intersection point is inside the tolerance distance for both layers
double toleranceA, toleranceB;
double toleranceA = 0;
double toleranceB = 0;
for ( int i = 0 ;i < snapLayers.size();++i )
{
if ( snapLayers[i].mLayer == oSegIt->layer )
Expand Down
7 changes: 4 additions & 3 deletions src/gui/symbology-ng/qgsheatmaprendererwidget.cpp
Expand Up @@ -160,12 +160,13 @@ void QgsHeatmapRendererWidget::on_mRadiusUnitWidget_changed()
case 0:
unit = QgsSymbolV2::Pixel;
break;
case 1:
unit = QgsSymbolV2::MM;
break;
case 2:
unit = QgsSymbolV2::MapUnit;
break;
case 1:
default:
unit = QgsSymbolV2::MM;
break;
}

mRenderer->setRadiusUnit( unit );
Expand Down
7 changes: 4 additions & 3 deletions src/gui/symbology-ng/qgssymbollayerv2widget.cpp
Expand Up @@ -3164,12 +3164,13 @@ void QgsRasterFillSymbolLayerWidget::on_mWidthUnitWidget_changed()
case 0:
unit = QgsSymbolV2::Pixel;
break;
case 1:
unit = QgsSymbolV2::MM;
break;
case 2:
unit = QgsSymbolV2::MapUnit;
break;
case 1:
default:
unit = QgsSymbolV2::MM;
break;
}

mLayer->setWidthUnit( unit );
Expand Down
1 change: 1 addition & 0 deletions src/providers/grass/qgsgrassfeatureiterator.cpp
Expand Up @@ -624,6 +624,7 @@ QgsGrassFeatureSource::QgsGrassFeatureSource( const QgsGrassProvider* p )
int layerId = QgsGrassProvider::openLayer( p->mGisdbase, p->mLocation, p->mMapset, p->mMapName, p->mLayerField );

Q_ASSERT( layerId == mLayerId );
Q_UNUSED( layerId ); //avoid compilier warning
}

QgsGrassFeatureSource::~QgsGrassFeatureSource()
Expand Down

0 comments on commit a4ee405

Please sign in to comment.