aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-05-13 11:47:54 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:15:23 -0300
commited5af2558722705d38a33fc9b98cf93ccdfae9dd (patch)
tree562fa6dced72513b9edf209d60f4e7c540060074
parent899d04d28ebb104b216b444af9eec411fbb3135b (diff)
Implemented keep-reference action 'add'.
Reviewer: Hugo Parente <hugo.lima@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--generator/cppgenerator.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index ab1529092..a417bd891 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -2319,8 +2319,9 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f
foreach (ArgumentModification arg_mod, refcount_mods) {
ReferenceCount refCount = arg_mod.referenceCounts.first();
if (refCount.action != ReferenceCount::Set
- && refCount.action != ReferenceCount::Remove) {
- ReportHandler::warning("\"set\" and \"remove\" are the only values supported by Shiboken for action attribute of reference-count tag.");
+ && refCount.action != ReferenceCount::Remove
+ && refCount.action != ReferenceCount::Add) {
+ ReportHandler::warning("\"set\", \"add\" and \"remove\" are the only values supported by Shiboken for action attribute of reference-count tag.");
continue;
}
const AbstractMetaClass* wrappedClass = 0;
@@ -2341,7 +2342,9 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f
if (varName.isEmpty())
varName = func->minimalSignature() + QString().number(arg_mod.index);
- s << varName << "\", " << pyArgName << ");" << endl;
+ s << varName << "\", " << pyArgName << ", "
+ << (refCount.action == ReferenceCount::Add ? "true" : "false")
+ << ");" << endl;
if (arg_mod.index == 0)
hasReturnPolicy = true;