Skip to content

Commit d2a7c93

Browse files
committed
Fix Coverity logically dead code error
1 parent 4b4606f commit d2a7c93

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/app/qgisapp.cpp

+11-6
Original file line numberDiff line numberDiff line change
@@ -5839,13 +5839,18 @@ void QgisApp::saveMapAsImage()
58395839
} );
58405840
connect( mapRendererTask, &QgsMapRendererTask::errorOccurred, this, [ = ]( int error )
58415841
{
5842-
if ( error == QgsMapRendererTask::ImageAllocationFail )
5842+
switch ( error )
58435843
{
5844-
messageBar()->pushWarning( tr( "Save as image" ), tr( "Could not allocate required memory for image" ) );
5845-
}
5846-
else if ( error == QgsMapRendererTask::ImageAllocationFail )
5847-
{
5848-
messageBar()->pushWarning( tr( "Save as image" ), tr( "Could not save the image to file" ) );
5844+
case QgsMapRendererTask::ImageAllocationFail:
5845+
{
5846+
messageBar()->pushWarning( tr( "Save as image" ), tr( "Could not allocate required memory for image" ) );
5847+
break;
5848+
}
5849+
case QgsMapRendererTask::ImageSaveFail:
5850+
{
5851+
messageBar()->pushWarning( tr( "Save as image" ), tr( "Could not save the image to file" ) );
5852+
break;
5853+
}
58495854
}
58505855
} );
58515856

0 commit comments

Comments
 (0)