Skip to content
Permalink
Browse files

warnings fix

  • Loading branch information
blazek committed Oct 24, 2012
1 parent 6ad4fae commit 3284fccd0bb33b9fffe2c152812063165e22010b
Showing with 30 additions and 28 deletions.
  1. +27 −27 src/core/qgserror.cpp
  2. +3 −1 src/core/raster/qgsmultibandcolorrenderer.cpp
@@ -22,46 +22,45 @@

#include <QRegExp>

QgsErrorMessage::QgsErrorMessage ( const QString & theMessage, const QString & theTag, const QString & theFile, const QString & theFunction, int theLine )
: mMessage(theMessage)
, mTag(theTag)
, mFile(theFile)
, mFunction(theFunction)
, mLine(theLine)
, mFormat(Text)
QgsErrorMessage::QgsErrorMessage( const QString & theMessage, const QString & theTag, const QString & theFile, const QString & theFunction, int theLine )
: mMessage( theMessage )
, mTag( theTag )
, mFile( theFile )
, mFunction( theFunction )
, mLine( theLine )
, mFormat( Text )
{
}

QgsError::QgsError ( const QString & theMessage, const QString & theTag )
QgsError::QgsError( const QString & theMessage, const QString & theTag )
{
append ( theMessage, theTag );
append( theMessage, theTag );
}

void QgsError::append ( const QString & theMessage, const QString & theTag )
void QgsError::append( const QString & theMessage, const QString & theTag )
{
mMessageList.append ( QgsErrorMessage ( theMessage, theTag ) );
mMessageList.append( QgsErrorMessage( theMessage, theTag ) );
}

void QgsError::append ( const QgsErrorMessage & theMessage )
void QgsError::append( const QgsErrorMessage & theMessage )
{
mMessageList.append ( theMessage );
mMessageList.append( theMessage );
}

QString QgsError::message ( QgsErrorMessage::Format theFormat ) const
QString QgsError::message( QgsErrorMessage::Format theFormat ) const
{
QString str;
int sPrefixLength = strlen( CMAKE_SOURCE_DIR ) + 1;

QString srcUrl;
#if defined(QGISDEBUG) && defined(QGS_GIT_REMOTE_URL)
// TODO: verify if we are not ahead to origin (remote hash does not exist)
// and there are no local not commited changes
QString hash = QString(QGis::QGIS_DEV_VERSION);
QString remote = QString(QGS_GIT_REMOTE_URL);
QgsDebugMsg ("remote = " + remote );
if ( !hash.isEmpty () && !remote.isEmpty() && remote.contains ( "github.com" ) )
// and there are no local not commited changes
QString hash = QString( QGis::QGIS_DEV_VERSION );
QString remote = QString( QGS_GIT_REMOTE_URL );
QgsDebugMsg( "remote = " + remote );
if ( !hash.isEmpty() && !remote.isEmpty() && remote.contains( "github.com" ) )
{
QString path = remote.remove( QRegExp(".*github.com[:/]" )).remove(".git");
QString path = remote.remove( QRegExp( ".*github.com[:/]" ) ).remove( ".git" );
srcUrl = "https://github.com/" + path + "/blob/" + hash;
}
#endif
@@ -71,7 +70,8 @@ QString QgsError::message ( QgsErrorMessage::Format theFormat ) const
#ifdef QGISDEBUG
QString file;
#ifndef _MSC_VER
file = m.file().mid(sPrefixLength);
int sPrefixLength = strlen( CMAKE_SOURCE_DIR ) + 1;
file = m.file().mid( sPrefixLength );
#else
file = m.file();
#endif
@@ -89,10 +89,10 @@ QString QgsError::message ( QgsErrorMessage::Format theFormat ) const
str += "<p><b>" + m.tag() + ":</b> " + m.message();
#ifdef QGISDEBUG
QString location = QString( "%1 : %2 : %3" ).arg( file ).arg( m.line() ).arg( m.function() );
if ( !srcUrl.isEmpty() )
if ( !srcUrl.isEmpty() )
{
QString url = QString("%1/%2#L%3").arg(srcUrl).arg(file).arg( m.line() );
str += QString( "<br>(<a href='%1'>%2</a>)" ).arg(url).arg( location );
QString url = QString( "%1/%2#L%3" ).arg( srcUrl ).arg( file ).arg( m.line() );
str += QString( "<br>(<a href='%1'>%2</a>)" ).arg( url ).arg( location );
}
else
{
@@ -104,8 +104,8 @@ QString QgsError::message ( QgsErrorMessage::Format theFormat ) const
return str;
}

QString QgsError::summary ( ) const
QString QgsError::summary( ) const
{
// The first message in chain is usually the real error given by backend/server
return mMessageList.first().message();
return mMessageList.first().message();
}
@@ -243,7 +243,9 @@ QgsRasterBlock* QgsMultiBandColorRenderer::block( int bandNo, QgsRectangle cons
}

bool isNoData = false;
double redVal, greenVal, blueVal;
double redVal = 0;
double greenVal = 0;
double blueVal = 0;
if ( mRedBand > 0 )
{
redVal = redBlock->value( i );

0 comments on commit 3284fcc

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