aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-08-23 16:31:22 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-08-24 08:09:40 +0000
commit9ef1e16b3325239bf782ddb893cbe2b76ab4b4d7 (patch)
treedbe6cb32fca074664a8e0f54155c88ca57cf610d
parent31eb5b52d7ceb28e5783a4a383b547434ea832b5 (diff)
shiboken: Output argument index in warning about unsupported parameter
It makes it easier to generate modification tags by script. Change-Id: I3d256371974e05eee336eaac3541029078ea2cc5 Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index f7c47fd05..7317947d5 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -2123,14 +2123,19 @@ static void checkTypeViability(const AbstractMetaFunction* func, const AbstractM
|| !func->conversionRule(TypeSystem::All, argIdx).isEmpty()
|| func->hasInjectedCode())
return;
- QString prefix;
+ QString message;
+ QTextStream str(&message);
+ str << "There's no user provided way (conversion rule, argument"
+ " removal, custom code, etc) to handle the primitive ";
+ if (argIdx == 0)
+ str << "return type '" << type->cppSignature() << '\'';
+ else
+ str << "type '" << type->cppSignature() << "' of argument " << argIdx;
+ str << " in function '";
if (func->ownerClass())
- prefix = func->ownerClass()->qualifiedCppName() + QLatin1String("::");
- qCWarning(lcShiboken).noquote().nospace()
- << QString::fromLatin1("There's no user provided way (conversion rule, argument removal, custom code, etc) "
- "to handle the primitive %1 type '%2' in function '%3%4'.")
- .arg(argIdx == 0 ? QStringLiteral("return") : QStringLiteral("argument"),
- type->cppSignature(), prefix, func->signature());
+ str << func->ownerClass()->qualifiedCppName() << "::";
+ str << func->signature() << "'.";
+ qCWarning(lcShiboken).noquote().nospace() << message;
}
static void checkTypeViability(const AbstractMetaFunction* func)