18 #include "qgsversion.h" 19 #include "qgsconfig.h" 29 , mFunction( function )
36 append( message, tag );
46 mMessageList.append( message );
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;
74 int sPrefixLength = strlen( CMAKE_SOURCE_DIR ) + 1;
75 file = m.
file().mid( sPrefixLength );
87 if ( !m.
tag().isEmpty() )
94 if ( !file.isEmpty() )
96 where += QStringLiteral(
"file: %1 row: %2" ).arg( file ).arg( m.
line() );
100 where += QStringLiteral(
"function %1:" ).arg( m.
function() );
102 if ( !where.isEmpty() )
104 str += QStringLiteral(
" (%1)" ).arg( where );
110 str +=
"<p><b>" + m.
tag() +
":</b> " + m.
message();
112 QString location = QStringLiteral(
"%1 : %2 : %3" ).arg( file ).arg( m.
line() ).arg( m.
function() );
113 if ( !srcUrl.isEmpty() )
115 QString url = QStringLiteral(
"%1/%2#L%3" ).arg( srcUrl, file ).arg( m.
line() );
116 str += QStringLiteral(
"<br>(<a href='%1'>%2</a>)" ).arg( url, location );
120 str += QStringLiteral(
"<br>(%1)" ).arg( location );
131 return mMessageList.first().message();
static const char * QGIS_DEV_VERSION
The development version.
QString message(QgsErrorMessage::Format format=QgsErrorMessage::Html) const
Full error messages description.
QgsError()=default
Constructor for QgsError.
QgsErrorMessage represents single error message.
void append(const QString &message, const QString &tag)
Append new error message.
QgsErrorMessage()=default
Constructor for QgsErrorMessage.
QString summary() const
Short error description, usually the first error in chain, the real error.