18 #include "qgsversion.h"
19 #include "qgsconfig.h"
29 , mFunction( function )
57 #if defined(QGISDEBUG) && defined(QGS_GIT_REMOTE_URL)
61 QString remote = QStringLiteral( QGS_GIT_REMOTE_URL );
62 if ( !hash.isEmpty() && !remote.isEmpty() && remote.contains( QLatin1String(
"github.com" ) ) )
64 QString path = remote.remove( QRegExp(
".*github.com[:/]" ) ).remove( QStringLiteral(
".git" ) );
65 srcUrl =
"https://github.com/" + path +
"/blob/" + hash;
69 const auto constMMessageList = mMessageList;
75 int sPrefixLength = strlen( CMAKE_SOURCE_DIR ) + 1;
76 file = m.file().mid( sPrefixLength );
88 if ( !m.tag().isEmpty() )
95 if ( !file.isEmpty() )
97 where += QStringLiteral(
"file: %1 row: %2" ).arg( file ).arg( m.line() );
99 if ( !m.function().isEmpty() )
101 where += QStringLiteral(
"function %1:" ).arg( m.function() );
103 if ( !where.isEmpty() )
105 str += QStringLiteral(
" (%1)" ).arg( where );
111 str +=
"<p><b>" + m.tag() +
":</b> " + m.message();
113 QString location = QStringLiteral(
"%1 : %2 : %3" ).arg( file ).arg( m.line() ).arg( m.function() );
114 if ( !srcUrl.isEmpty() )
116 QString url = QStringLiteral(
"%1/%2#L%3" ).arg( srcUrl, file ).arg( m.line() );
117 str += QStringLiteral(
"<br>(<a href='%1'>%2</a>)" ).arg( url, location );
121 str += QStringLiteral(
"<br>(%1)" ).arg( location );
132 return mMessageList.first().message();