Skip to content
Permalink
Browse files

Coverity fixes - unreachable code

  • Loading branch information
nyalldawson committed Feb 16, 2015
1 parent c1fe68c commit 318a7161f5aef53d055f1830a0472d4553d9c581
@@ -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();
@@ -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;
@@ -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();
@@ -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 )
@@ -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( '/' ) )
@@ -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 );
}

0 comments on commit 318a716

Please sign in to comment.
You can’t perform that action at this time.