Bug 442768

Summary: Generated .qch files makes assistant create bogus index entries to tabs.css
Product: [Frameworks and Libraries] frameworks-kapidox Reporter: Martin Sandsmark <martin.sandsmark>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: igorkuo, olvmari
Priority: NOR    
Version First Reported In: 5.95.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Martin Sandsmark 2021-09-21 08:54:27 UTC
I'm not sure if there's something wrong in how the documentation is done in general, or if it is in how doxygen or qhelpgenerator is invoked by ecm, but I thought ecm is a good a place to start as any.

Inspecting the assistant cache I count 55 bogus entries from various frameworks just for QNetworkAccessManager:

sqlite> select COUNT(*) from IndexTable, FileNameTable where Identifier like 'QNetworkAccessManager%' and IndexTable.FileId = FileNameTable.FileId and FileNameTable.Name = 'tabs.css';
55

The effect is that if you type in for example "QNetworkAccessManager" in the index tab in assistant, it helpfully asks if you want to view the QNetworkAccessManager documentation or tabs.css (from KF5KIO.qch).

If I type in "QComboBox" I get 4 different tabs.css suggestions.
Comment 1 Martin Sandsmark 2021-09-21 08:58:54 UTC
Doing some more bad SQL (`sqlite> select distinct FolderTable.Name from IndexTable, FileNameTable, FolderTable where Identifier like 'Q%' and IndexTable.FileId = FileNameTable.FileId and FileNameTable.Name = 'tabs.css' and FileNameTable.FolderId = FolderTable.Id;`) it seems like all frameworks contains at least one bogus index entry. Maybe there's some duplicate identifiers or something?
Comment 2 Martin Sandsmark 2021-09-21 09:16:21 UTC
I'm not sure if this is the issue, but the .qhp files generated by ecm contains a ton of <keyword> entries that point to non-existent files (e. g. <keyword name="objectName" id="QObject::objectName" ref="qobject.html#objectName-prop" />, qobject.html doesn't exist in that .qch file).

But it sounds plausible that qt help just resolves invalid file references to 0, and tabs.css seems to be the first file in the .qch files.
Comment 3 Igor Kushnir 2022-06-24 10:51:17 UTC
This bug affects KDevelop's Documentation view. The documentation shown for many (all?) KIO classes and functions is this useless tabs.css file.
Comment 4 Igor Kushnir 2022-06-25 14:04:03 UTC
(In reply to Igor Kushnir from comment #3)
> This bug affects KDevelop's Documentation view. The documentation shown for
> many (all?) KIO classes and functions is this useless tabs.css file.
This is actually an issue for many frameworks: KIO, KTextEditor, Solid, DBusAddons. In the IndexTable of their *.qch files in /usr/share/doc/qt/ FileId equals 1 for each identifier. The issue does *not* affect for example KGantt: correct documentation is displayed in KDevelop and there are many different FileId_s in KGantt.qch's IndexTable.

My system information: Manjaro Xfce with latest updates.
Comment 5 Christophe Marin 2022-06-27 07:31:24 UTC
With frameworks built not rebuilt since 2 weeks:

in assistant:
select distinct FolderTable.Name from IndexTable, FileNameTable, FolderTable where Identifier like 'Q%' and IndexTable.FileId = FileNameTable.FileId;

lists the KDE Frameworks:
[...]
kio
attica
baloo
bluezqt
kactivities
kactivitiesstats
karchive
kauth
kbookmarks
kcmutils
kcalendarcore
kcalendarutils
kchart
kcodecs
kcompletion
[...]

so they're indexed but when looking specifically for tabs.css:

select distinct FolderTable.Name from IndexTable, FileNameTable, FolderTable where Identifier like 'Q%' and IndexTable.FileId = FileNameTable.FileId and FileNameTable.Name = 'tabs.css' and FileNameTable.FolderId = FolderTable.Id;

doesn't return anything.

The docs were generated using doxygen 1.9.3 if that matters.
Comment 6 Igor Kushnir 2022-06-27 08:11:07 UTC
(In reply to Christophe Giboudeaux from comment #5)
> in assistant:
> select distinct FolderTable.Name from IndexTable, FileNameTable, FolderTable
> where Identifier like 'Q%' and IndexTable.FileId = FileNameTable.FileId;
This query returns the list of many (all?) KDE Frameworks on my system as well.

> select distinct FolderTable.Name from IndexTable, FileNameTable, FolderTable
> where Identifier like 'Q%' and IndexTable.FileId = FileNameTable.FileId and
> FileNameTable.Name = 'tabs.css' and FileNameTable.FolderId = FolderTable.Id;
On my system this query returns:
kchart
kdsoapwsdiscoveryclient
kgantt
These 3 may be the only KDE libraries on my system with documentations unaffected by this bug.
Looking into /usr/share/doc/qt, I see that the documentations for these 3 libraries were generated in 2021, whereas all other framework documentations were generated in May or June, 2022.

Sorry, I am not very good at SQL. I guess your meaning is that the second query should return the list of broken documentations, but somehow it returns the list of good ones on my system. My previous comments are based on examining tables in qch files manually/visually on the Browse Data tab of DB Browser for SQLite GUI (sqlitebrowser).
Comment 7 Igor Kushnir 2022-06-27 10:41:32 UTC
Just checked Contents and Index navigation in Qt Assistant. Works for Qt frameworks, the standard library (cppreference-doc-en-cpp) and for the 3 libraries with not broken documentation (kchart, kdsoapwsdiscoveryclient, kgantt). Doesn't work for all other KDE frameworks: selecting an item on the Index tab shows the tabs.css file. On the Contents tab, selecting the topmost page of each framework, e.g. KDeclarative 5.95.0 displays the main page correctly, following links from this page works perfectly. But when I select a non-top entry in the Contents, e.g. Introduction or Classes, a page like this appears:

Frame load interrupted by policy change
------------------------------------------------------------------------------------------------------------
Failed to load URL qthelp://org.kde.kdeclarative.5_95_0/kdeclarative/annotated.

                                                                                                        WebKit Error 102
Comment 8 Christophe Marin 2022-06-27 11:39:54 UTC
For my case, the reason is different. The qch layout is completely broken with doxygen 1.9.3 but fine with 1.9.4
Comment 9 Igor Kushnir 2022-06-27 12:07:54 UTC
(In reply to Christophe Giboudeaux from comment #8)
> For my case, the reason is different. The qch layout is completely broken
> with doxygen 1.9.3 but fine with 1.9.4
The 3 working documentations I wrote about are generated by doxygen 1.9.1. The rest - by doxygen 1.9.3. So this could be the same issue. https://github.com/doxygen/doxygen/issues/9294 perhaps? Good to know that the issue is fixed in the latest doxygen version.
Comment 10 Igor Kushnir 2022-07-24 14:19:54 UTC
*** Bug 457063 has been marked as a duplicate of this bug. ***
Comment 11 Igor Kushnir 2022-12-12 19:23:45 UTC
Cannot reproduce after Arch Linux doxygen package was updated to 1.9.5 and the *.qch files were generated with the newer doxygen version. Cannot reproduce the original Qt documentation issue either.