Skip to content

Commit 318a716

Browse files
committed
Coverity fixes - unreachable code
1 parent c1fe68c commit 318a716

File tree

3 files changed

+10
-23
lines changed

3 files changed

+10
-23
lines changed

src/core/raster/qgsrasterchecker.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ bool QgsRasterChecker::runTest( QString theVerifiedKey, QString theVerifiedUri,
8686
bool allOk = true;
8787
for ( int band = 1; band <= expectedProvider->bandCount(); band++ )
8888
{
89-
bool bandOk = true;
9089
mReport += QString( "<h3>Band %1</h3>\n" ).arg( band );
9190
mReport += QString( "<table style='%1'>\n" ).arg( mTabStyle );
9291
mReport += compareHead();
@@ -123,12 +122,6 @@ bool QgsRasterChecker::runTest( QString theVerifiedKey, QString theVerifiedUri,
123122
mReport += "</table>";
124123
mReport += "<br>";
125124

126-
if ( !bandOk )
127-
{
128-
allOk = false;
129-
continue;
130-
}
131-
132125
if ( !statsOk || !typesOk )
133126
{
134127
allOk = false;

src/gui/qgsdetaileditemdelegate.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ void QgsDetailedItemDelegate::paintManually( QPainter *thepPainter,
111111

112112
QFontMetrics myTitleMetrics( titleFont( theOption ) );
113113
QFontMetrics myDetailMetrics( detailFont( theOption ) );
114-
QFontMetrics myCategoryMetrics( categoryFont( theOption ) );
115114
int myTextStartX = theOption.rect.x() + horizontalSpacing();
116115
int myTextStartY = theOption.rect.y() + verticalSpacing();
117116
int myHeight = myTitleMetrics.height() + verticalSpacing();
@@ -147,6 +146,7 @@ void QgsDetailedItemDelegate::paintManually( QPainter *thepPainter,
147146
QPixmap myDecoPixmap = theData.icon();
148147
if ( !myDecoPixmap.isNull() )
149148
{
149+
myIconFlag = true;
150150
int iconWidth = 32, iconHeight = 32;
151151

152152
if ( myDecoPixmap.width() <= iconWidth && myDecoPixmap.height() <= iconHeight )

src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp

+9-15
Original file line numberDiff line numberDiff line change
@@ -681,11 +681,8 @@ void eVisGenericEventBrowserGui::restoreDefaultOptions()
681681
*/
682682
void eVisGenericEventBrowserGui::setBasePathToDataSource()
683683
{
684-
//Noticed some strangeness here while cleaning up for migration to the QGIS trunk - PJE 2009-07-01
685-
//TODO: The check for windows paths not longer does anything, remove or fix
686-
687684
int myPathMarker = 0;
688-
bool isWindows = false;
685+
689686
QString mySourceUri = mDataProvider->dataSourceUri();
690687
//Check to see which way the directory symbol goes, I think this is actually unnecessary in qt
691688
if ( mySourceUri.contains( '/' ) )
@@ -701,22 +698,19 @@ void eVisGenericEventBrowserGui::setBasePathToDataSource()
701698
mySourceUri.truncate( myPathMarker + 1 );
702699

703700
//check for duplicate directory symbols when concatinating the two strings
704-
if ( isWindows )
701+
#ifdef Q_OS_WIN
702+
mySourceUri.replace( "\\\\", "\\" );
703+
#else
704+
if ( mySourceUri.startsWith( "http://", Qt::CaseInsensitive ) )
705705
{
706-
mySourceUri.replace( "\\\\", "\\" );
706+
mySourceUri.replace( "//", "/" );
707+
mySourceUri.replace( "http:/", "http://", Qt::CaseInsensitive );
707708
}
708709
else
709710
{
710-
if ( mySourceUri.startsWith( "http://", Qt::CaseInsensitive ) )
711-
{
712-
mySourceUri.replace( "//", "/" );
713-
mySourceUri.replace( "http:/", "http://", Qt::CaseInsensitive );
714-
}
715-
else
716-
{
717-
mySourceUri.replace( "//", "/" );
718-
}
711+
mySourceUri.replace( "//", "/" );
719712
}
713+
#endif
720714

721715
leBasePath->setText( mySourceUri );
722716
}

0 commit comments

Comments
 (0)