@@ -199,30 +199,32 @@ void ShellHeaderGenerator::write(QTextStream &s, const AbstractMetaClass *meta_c
199199
200200 foreach (AbstractMetaFunction* fun, promoteFunctions) {
201201 // 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;
213220 }
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;
219221 }
220222
221223 foreach (AbstractMetaFunction* fun, promoteFunctions) {
222224 // qualified promoter for virtual functions
223225 if (fun->isVirtual ()) {
224226 s << " inline " ;
225- writeFunctionSignature (s, fun, 0 , " py_qualified_ " ,
227+ writeFunctionSignature (s, fun, 0 , " py_q_ " ,
226228 Option (IncludeDefaultExpression | OriginalName | UnderscoreSpaces | ProtectedEnumAsInts));
227229 s << " { " ;
228230 QString scriptFunctionName = fun->originalName ();
@@ -361,7 +363,7 @@ void ShellHeaderGenerator::write(QTextStream &s, const AbstractMetaClass *meta_c
361363 if (function->isVirtual ()) {
362364 // qualified version that calls the promoter/the qualified version
363365 s << " " ;
364- writeFunctionSignature (s, function, 0 , " py_qualified_ " ,
366+ writeFunctionSignature (s, function, 0 , " py_q_ " ,
365367 Option (AddOwnershipTemplates | ConvertReferenceToPtr | FirstArgIsWrappedObject | IncludeDefaultExpression | OriginalName | ShowStatic | UnderscoreSpaces | ProtectedEnumAsInts));
366368 s << " { " ;
367369
@@ -375,7 +377,7 @@ void ShellHeaderGenerator::write(QTextStream &s, const AbstractMetaClass *meta_c
375377 s << " &" ;
376378 }
377379 }
378- s << " (((" << promoterClassName (meta_class) << " *)theWrappedObject)->py_qualified_ " ;
380+ s << " (((" << promoterClassName (meta_class) << " *)theWrappedObject)->py_q_ " ;
379381 s << function->originalName () << " (" ;
380382 for (int i = 0 ; i < args.size (); ++i) {
381383 if (i > 0 )
0 commit comments