From 956a8c13a836eb4d3b469bf2c9d8cbb1619ddf12 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 22 Jun 2018 17:32:53 +0200 Subject: shiboken: Improve error message about missing function for modification The signature is passed through TypeDatabase::normalizedSignature() which calls QMetaObject::normalizedSignature(). Keep the original signature and output it in the error message. Change-Id: Ibd1ddd0dee17d828710caf4bf6d674c35776b4c2 Reviewed-by: Alexandru Croitor --- sources/shiboken2/ApiExtractor/typesystem.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sources/shiboken2/ApiExtractor/typesystem.cpp') diff --git a/sources/shiboken2/ApiExtractor/typesystem.cpp b/sources/shiboken2/ApiExtractor/typesystem.cpp index 52f05ce5b..baaec6d30 100644 --- a/sources/shiboken2/ApiExtractor/typesystem.cpp +++ b/sources/shiboken2/ApiExtractor/typesystem.cpp @@ -1717,9 +1717,9 @@ bool Handler::startElement(const QStringRef &n, const QXmlStreamAttributes &atts ", was=%1").arg(topElement.type, 0, 16); return false; } - QString signature = attributes[QLatin1String("signature")]; + const QString originalSignature = attributes[QLatin1String("signature")]; - signature = TypeDatabase::normalizedSignature(signature); + QString signature = TypeDatabase::normalizedSignature(originalSignature); if (signature.isEmpty()) { m_error = QLatin1String("No signature for the added function"); return false; @@ -1754,6 +1754,7 @@ bool Handler::startElement(const QStringRef &n, const QXmlStreamAttributes &atts FunctionModification mod; if (!mod.setSignature(m_currentSignature, &m_error)) return false; + mod.setOriginalSignature(originalSignature); m_contextStack.top()->functionMods << mod; } break; @@ -1763,9 +1764,9 @@ bool Handler::startElement(const QStringRef &n, const QXmlStreamAttributes &atts ", was=%1").arg(topElement.type, 0, 16); return false; } - QString signature = attributes[QLatin1String("signature")]; + const QString originalSignature = attributes[QLatin1String("signature")]; - signature = TypeDatabase::normalizedSignature(signature); + const QString signature = TypeDatabase::normalizedSignature(originalSignature); if (signature.isEmpty()) { m_error = QLatin1String("No signature for modified function"); return false; @@ -1780,6 +1781,7 @@ bool Handler::startElement(const QStringRef &n, const QXmlStreamAttributes &atts FunctionModification mod; if (!mod.setSignature(signature, &m_error)) return false; + mod.setOriginalSignature(originalSignature); m_currentSignature = signature; QString access = attributes[QLatin1String("access")].toLower(); -- cgit v1.2.3