[Development] QHelpEngineCore::documentsForIdentifier
Edward Welbourne
edward.welbourne at qt.io
Thu Aug 27 19:07:29 CEST 2020
Martin Koller (14 August 2020 17:06) wrote:
> I found myself getting an empty list when using
> QHelpEngineCore::documentsForIdentifier(id) but getting 1 element when
> using the deprecated QHelpEngineCore::linksForIdentifier(id).
Definitely sounds like a bug, although I find no
QHelpEngineCore::linksForIdentifier() - did you mean
QHelpCollectionHandler::linksForIdentifier() ?
> Checking the code I stumbled over something which I believe is a bug:
>
> QHelpEngineCore::documentsForIdentifier(const QString &id, const
> QString &filterName) does
>
> if (!d->setup() || !d->usesFilterEngine)
> return QList<QHelpLink>();
>
> so it checks if the new filter engine is active, but I think this is
> not needed here, since in this code, the filter engine is not used at
> all, since the filterName is already given as argument.
Sounds plausible.
Also, QHelpEngineCore::documentsForIdentifier(const QString &id) calls
documentsForIdentifier(const QString &id, const QString &filterName)
passing a filterName that it determines based on d->usesFilterEngine,
which rather suggests it thinks d->usesFilterEngine isn't a prerequisite
of getting any entries.
> Since I ported older code to the new api but did not call
> setUsesFilterEngine(true) (which I believe should not be needed when I
> don't work with filters), this check was hit and I get no results.
>
> Am I right ?
I don't know this code at all but it sounds like reasonable grounds to
submit a patch to Gerrit and ask for review by folk implicated in the
review that added this code (this March):
https://codereview.qt-project.org/c/qt/qttools/+/291144
Eddy.
More information about the Development
mailing list