Skip to content

Commit

Permalink
Coverity fixes - unreachable code
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 16, 2015
1 parent c1fe68c commit 318a716
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 23 deletions.
7 changes: 0 additions & 7 deletions src/core/raster/qgsrasterchecker.cpp
Expand Up @@ -86,7 +86,6 @@ bool QgsRasterChecker::runTest( QString theVerifiedKey, QString theVerifiedUri,
bool allOk = true;
for ( int band = 1; band <= expectedProvider->bandCount(); band++ )
{
bool bandOk = true;
mReport += QString( "<h3>Band %1</h3>\n" ).arg( band );
mReport += QString( "<table style='%1'>\n" ).arg( mTabStyle );
mReport += compareHead();
Expand Down Expand Up @@ -123,12 +122,6 @@ bool QgsRasterChecker::runTest( QString theVerifiedKey, QString theVerifiedUri,
mReport += "</table>";
mReport += "<br>";

if ( !bandOk )
{
allOk = false;
continue;
}

if ( !statsOk || !typesOk )
{
allOk = false;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsdetaileditemdelegate.cpp
Expand Up @@ -111,7 +111,6 @@ void QgsDetailedItemDelegate::paintManually( QPainter *thepPainter,

QFontMetrics myTitleMetrics( titleFont( theOption ) );
QFontMetrics myDetailMetrics( detailFont( theOption ) );
QFontMetrics myCategoryMetrics( categoryFont( theOption ) );
int myTextStartX = theOption.rect.x() + horizontalSpacing();
int myTextStartY = theOption.rect.y() + verticalSpacing();
int myHeight = myTitleMetrics.height() + verticalSpacing();
Expand Down Expand Up @@ -147,6 +146,7 @@ void QgsDetailedItemDelegate::paintManually( QPainter *thepPainter,
QPixmap myDecoPixmap = theData.icon();
if ( !myDecoPixmap.isNull() )
{
myIconFlag = true;
int iconWidth = 32, iconHeight = 32;

if ( myDecoPixmap.width() <= iconWidth && myDecoPixmap.height() <= iconHeight )
Expand Down
24 changes: 9 additions & 15 deletions src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp
Expand Up @@ -681,11 +681,8 @@ void eVisGenericEventBrowserGui::restoreDefaultOptions()
*/
void eVisGenericEventBrowserGui::setBasePathToDataSource()
{
//Noticed some strangeness here while cleaning up for migration to the QGIS trunk - PJE 2009-07-01
//TODO: The check for windows paths not longer does anything, remove or fix

int myPathMarker = 0;
bool isWindows = false;

QString mySourceUri = mDataProvider->dataSourceUri();
//Check to see which way the directory symbol goes, I think this is actually unnecessary in qt
if ( mySourceUri.contains( '/' ) )
Expand All @@ -701,22 +698,19 @@ void eVisGenericEventBrowserGui::setBasePathToDataSource()
mySourceUri.truncate( myPathMarker + 1 );

//check for duplicate directory symbols when concatinating the two strings
if ( isWindows )
#ifdef Q_OS_WIN
mySourceUri.replace( "\\\\", "\\" );
#else
if ( mySourceUri.startsWith( "http://", Qt::CaseInsensitive ) )
{
mySourceUri.replace( "\\\\", "\\" );
mySourceUri.replace( "//", "/" );
mySourceUri.replace( "http:/", "http://", Qt::CaseInsensitive );
}
else
{
if ( mySourceUri.startsWith( "http://", Qt::CaseInsensitive ) )
{
mySourceUri.replace( "//", "/" );
mySourceUri.replace( "http:/", "http://", Qt::CaseInsensitive );
}
else
{
mySourceUri.replace( "//", "/" );
}
mySourceUri.replace( "//", "/" );
}
#endif

leBasePath->setText( mySourceUri );
}
Expand Down

0 comments on commit 318a716

Please sign in to comment.