18 #include "qgsversion.h"
19 #include "qgsconfig.h"
26 : mMessage( theMessage )
29 , mFunction( theFunction )
37 append( theMessage, theTag );
55 #if defined(QGISDEBUG) && defined(QGS_GIT_REMOTE_URL)
59 QString remote = QString( QGS_GIT_REMOTE_URL );
60 if ( !hash.isEmpty() && !remote.isEmpty() && remote.contains(
"github.com" ) )
62 QString path = remote.remove( QRegExp(
".*github.com[:/]" ) ).remove(
".git" );
63 srcUrl =
"https://github.com/" + path +
"/blob/" + hash;
72 int sPrefixLength = strlen( CMAKE_SOURCE_DIR ) + 1;
73 file = m.
file().mid( sPrefixLength );
85 if ( !m.
tag().isEmpty() )
92 if ( !file.isEmpty() )
94 where += QString(
"file: %1 row: %2" ).arg( file ).arg( m.
line() );
98 where += QString(
"function %1:" ).arg( m.
function() );
100 if ( !where.isEmpty() )
102 str += QString(
" (%1)" ).arg( where );
108 str +=
"<p><b>" + m.
tag() +
":</b> " + m.
message();
110 QString location = QString(
"%1 : %2 : %3" ).arg( file ).arg( m.
line() ).arg( m.
function() );
111 if ( !srcUrl.isEmpty() )
113 QString url = QString(
"%1/%2#L%3" ).arg( srcUrl ).arg( file ).arg( m.
line() );
114 str += QString(
"<br>(<a href='%1'>%2</a>)" ).arg( url ).arg( location );
118 str += QString(
"<br>(%1)" ).arg( location );