summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-02-08 18:20:14 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2011-02-09 18:29:17 -0200
commita9578348ff1d5e5d2dd26a97660587af041c4525 (patch)
treee648b0a96515b44717b8ff76cd7b2216abe7e73a
parent6bafe84c86b70ad9fd1e62dbe0405175d34e8912 (diff)
downloadshiboken-a9578348ff1d5e5d2dd26a97660587af041c4525.tar.gz
shiboken-a9578348ff1d5e5d2dd26a97660587af041c4525.tar.xz
shiboken-a9578348ff1d5e5d2dd26a97660587af041c4525.zip
Use action="set" instead of action="add" on reference-count tag.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r--generator/cppgenerator.cpp4
-rw-r--r--tests/samplebinding/typesystem_sample.xml2
2 files changed, 4 insertions, 2 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index 70d4388a..201d52e3 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -2235,8 +2235,10 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f
} else if (!refcount_mods.isEmpty()) {
foreach (ArgumentModification arg_mod, refcount_mods) {
- if (arg_mod.referenceCounts.first().action != ReferenceCount::Add)
+ if (arg_mod.referenceCounts.first().action != ReferenceCount::Set) {
+ ReportHandler::warning("\"set\" is the only value supported by Shiboken for action attribute of reference-count tag.");
continue;
+ }
const AbstractMetaClass* wrappedClass = 0;
QString pyArgName = argumentNameFromIndex(func, arg_mod.index, &wrappedClass);
if (pyArgName.isEmpty()) {
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index faa940df..b23e7f6d 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -253,7 +253,7 @@
<object-type name="ObjectView">
<modify-function signature="setModel(ObjectModel*)">
<modify-argument index="1">
- <reference-count action="add"/>
+ <reference-count action="set"/>
</modify-argument>
</modify-function>
</object-type>