fix type namespace requirement
ClosedPublic

Authored by sitter on Jan 28 2020, 4:30 PM.

Details

Summary

it was hard to find in all the text anyway. and it's an entirely
pointless requirement. we can easily determine the type name dynamically
and call with or without namespace as necessary. this way users of kauth
cannot make the mistake of not using the namespace by accident.

I've thought about using a generic return argument (passing the typeName
into QGenericReturnArgument directly) but I think that opens the helper
code to memory corruption should they make the mistake of returning an
entirely unexpected type. so, what I ended up with is a bit more code
unfortunately.

Test Plan

helper code works with both using namespace and without

Diff Detail

Repository
R283 KAuth
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sitter created this revision.Jan 28 2020, 4:30 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 28 2020, 4:30 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
sitter requested review of this revision.Jan 28 2020, 4:30 PM
davidedmundson accepted this revision.Mar 6 2020, 1:20 PM

This is rather horrible, but at the same time makes a lot of sense.

One minor comment, but then, ship it I guess.

src/backends/dbus/DBusHelperProxy.cpp
281

we could:

int offset = metaObj->indexOfMethod(slotname);

instead of a loop.

This revision is now accepted and ready to land.Mar 6 2020, 1:20 PM
sitter updated this revision to Diff 77262.Mar 9 2020, 11:32 AM

switch to indexOfMethod, also construct a signature from the slotname. indexOf requires a normalized signature (e.g. save(QVariantMap))

davidedmundson accepted this revision.Mar 9 2020, 6:47 PM
This revision was automatically updated to reflect the committed changes.