KPluginFactory: fix create() apidox
ClosedPublic

Authored by elvisangelaccio on Nov 10 2018, 10:40 AM.

Details

Summary

kFatal() is long gone and was not ported to qFatal().
If there are multiple plugin choices without a keyword,
the function returns a random object among the candidates.

Diff Detail

Repository
R244 KCoreAddons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 10 2018, 10:40 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
elvisangelaccio requested review of this revision.Nov 10 2018, 10:40 AM
elvisangelaccio added a comment.EditedNov 10 2018, 10:44 AM

Note: I'm not 100% sure the code actually returns nullptr, so someone please double check.

dfaure requested changes to this revision.Nov 10 2018, 11:56 AM
dfaure added inline comments.
src/lib/plugin/kpluginfactory.h
347

I don't see that the code returns nullptr in this case, no.

Seems to me that it gets into kpluginfactory.cpp:143 which issues a qWarning [git log says I ported from kFatal to qWarning, not sure why, I guess I was doing like in Qt, bad API usage = warning, use QT_FATAL_WARNINGS if you want to abort on warnings]. The code then returns the last one of the candidates, but order is undefined, so the docu should say that it's not defined which object is returned.

This revision now requires changes to proceed.Nov 10 2018, 11:56 AM
  • Address comment
elvisangelaccio edited the summary of this revision. (Show Details)Nov 10 2018, 1:19 PM
elvisangelaccio marked an inline comment as done.
dfaure accepted this revision.Nov 10 2018, 9:33 PM
This revision is now accepted and ready to land.Nov 10 2018, 9:33 PM
This revision was automatically updated to reflect the committed changes.