Check function parameters and return type for use of QString and QByteArray

master
Jos van den Oever 2018-08-05 19:51:38 +02:00
parent cdc50304b3
commit 73b9c89b30
2 changed files with 18 additions and 0 deletions

View File

@ -779,6 +779,14 @@ void writeRustTypes(const Configuration& conf, QTextStream& r) {
hasString |= p.type.type == BindingType::QString;
hasByteArray |= p.type.type == BindingType::QByteArray;
}
for (auto f: o.functions) {
hasString |= f.type.type == BindingType::QString;
hasByteArray |= f.type.type == BindingType::QByteArray;
for (auto a: f.args) {
hasString |= a.type.type == BindingType::QString;
hasByteArray |= a.type.type == BindingType::QByteArray;
}
}
}
if (hasOption || hasListOrTree) {

View File

@ -149,6 +149,16 @@ struct Configuration {
ops.append(ip.type.name);
}
}
for (auto f: o.functions) {
if (!ops.contains(f.type.name)) {
ops.append(f.type.name);
}
for (auto a: f.args) {
if (!ops.contains(a.type.name)) {
ops.append(a.type.name);
}
}
}
}
return ops;
}