D16798: KPluginFactory: fix create() apidox

David Faure noreply at phabricator.kde.org
Sat Nov 10 11:56:41 GMT 2018


dfaure requested changes to this revision.
dfaure added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> kpluginfactory.h:347
>       * Use this method to create an object. It will try to create an object which inherits
> -     * \p T. If it has multiple choices, you will get a fatal error (kFatal()), so be careful
> +     * \p T. If it has multiple choices, you will get a @c nullptr, so be careful
>       * to request a unique interface or use keywords.

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.

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D16798

To: elvisangelaccio, dfaure, apol
Cc: kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20181110/1385eb24/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list