@@ -199,30 +199,32 @@ void ShellHeaderGenerator::write(QTextStream &s, const AbstractMetaClass *meta_c
199
199
200
200
foreach (AbstractMetaFunction* fun, promoteFunctions) {
201
201
// normal promoter
202
- if (fun->isStatic ()) {
203
- s << " static " ;
204
- }
205
- s << " inline " ;
206
- writeFunctionSignature (s, fun, 0 , " promoted_" ,
207
- Option (IncludeDefaultExpression | OriginalName | UnderscoreSpaces | ProtectedEnumAsInts));
208
- s << " { " ;
209
- QString scriptFunctionName = fun->originalName ();
210
- AbstractMetaArgumentList args = fun->arguments ();
211
- if (fun->type ()) {
212
- s << " return " ;
202
+ if (fun->wasProtected ()) {
203
+ if (fun->isStatic ()) {
204
+ s << " static " ;
205
+ }
206
+ s << " inline " ;
207
+ writeFunctionSignature (s, fun, 0 , " promoted_" ,
208
+ Option (IncludeDefaultExpression | OriginalName | UnderscoreSpaces | ProtectedEnumAsInts));
209
+ s << " { " ;
210
+ QString scriptFunctionName = fun->originalName ();
211
+ AbstractMetaArgumentList args = fun->arguments ();
212
+ if (fun->type ()) {
213
+ s << " return " ;
214
+ }
215
+ // always do a direct call, since we want to call the real virtual function here
216
+ s << " this->" ;
217
+ s << fun->originalName () << " (" ;
218
+ writePromoterArgs (args, s);
219
+ s << " ); }" << endl;
213
220
}
214
- // always do a direct call, since we want to call the real virtual function here
215
- s << " this->" ;
216
- s << fun->originalName () << " (" ;
217
- writePromoterArgs (args, s);
218
- s << " ); }" << endl;
219
221
}
220
222
221
223
foreach (AbstractMetaFunction* fun, promoteFunctions) {
222
224
// qualified promoter for virtual functions
223
225
if (fun->isVirtual ()) {
224
226
s << " inline " ;
225
- writeFunctionSignature (s, fun, 0 , " py_qualified_ " ,
227
+ writeFunctionSignature (s, fun, 0 , " py_q_ " ,
226
228
Option (IncludeDefaultExpression | OriginalName | UnderscoreSpaces | ProtectedEnumAsInts));
227
229
s << " { " ;
228
230
QString scriptFunctionName = fun->originalName ();
@@ -361,7 +363,7 @@ void ShellHeaderGenerator::write(QTextStream &s, const AbstractMetaClass *meta_c
361
363
if (function->isVirtual ()) {
362
364
// qualified version that calls the promoter/the qualified version
363
365
s << " " ;
364
- writeFunctionSignature (s, function, 0 , " py_qualified_ " ,
366
+ writeFunctionSignature (s, function, 0 , " py_q_ " ,
365
367
Option (AddOwnershipTemplates | ConvertReferenceToPtr | FirstArgIsWrappedObject | IncludeDefaultExpression | OriginalName | ShowStatic | UnderscoreSpaces | ProtectedEnumAsInts));
366
368
s << " { " ;
367
369
@@ -375,7 +377,7 @@ void ShellHeaderGenerator::write(QTextStream &s, const AbstractMetaClass *meta_c
375
377
s << " &" ;
376
378
}
377
379
}
378
- s << " (((" << promoterClassName (meta_class) << " *)theWrappedObject)->py_qualified_ " ;
380
+ s << " (((" << promoterClassName (meta_class) << " *)theWrappedObject)->py_q_ " ;
379
381
s << function->originalName () << " (" ;
380
382
for (int i = 0 ; i < args.size (); ++i) {
381
383
if (i > 0 )
0 commit comments