Bug 458510 - QtHelp homepage lists duplicates for every entry
Summary: QtHelp homepage lists duplicates for every entry
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Documentation viewer (show other bugs)
Version: git master
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Igor Kushnir
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-30 12:55 UTC by David Redondo
Modified: 2024-10-18 10:44 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 6.1.241200
Sentry Crash Report:


Attachments
screenshot (192.18 KB, image/png)
2022-08-30 12:55 UTC, David Redondo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Redondo 2022-08-30 12:55:21 UTC
Created attachment 151706 [details]
screenshot

STEPS TO REPRODUCE
1. Open QtHelp homepage

OBSERVED RESULT
- Each entry listed multiple times

EXPECTED RESULT
- Each entry only listed once

ADDITIONAL INFORMATION
- Qt assistant only lists everything once
- in /usr/share/qt5/doc each framework has only one file
Comment 1 David Redondo 2022-08-30 13:05:36 UTC
Actually the duplicates are all 5.87
Comment 2 David Redondo 2022-08-30 13:32:30 UTC
If I uncheck "Load Qt API documentation" and instead add /usr/share/qt5/doc below, everything is there only once in the combobox and their main pages only have one entry.
Comment 3 Igor Kushnir 2022-08-31 09:17:16 UTC
I experienced this bug multiple times in the past. I think the issue is that KDevelop does not properly refresh its database and keeps cached documentation entries, even after they are overwritten by newer versions during a system upgrade. The cache is stored in ~/.local/share/kdevelop/*.qhc
Comment 4 David Redondo 2022-08-31 12:57:44 UTC
You are right after deleting that, it doesnt happen anymore

But doing that I encountered another bug, there was initially no content at all. I had to toggle the checkbox in the settings so it would appear.
Comment 5 Igor Kushnir 2022-08-31 16:11:28 UTC
(In reply to David Redondo from comment #4)
> You are right after deleting that, it doesnt happen anymore
> 
> But doing that I encountered another bug, there was initially no content at
> all. I had to toggle the checkbox in the settings so it would appear.
Yes, I recall this bug too.
Comment 6 Igor Kushnir 2024-09-23 16:05:24 UTC
(In reply to David Redondo from comment #4)
> But doing that I encountered another bug, there was initially no content at
> all. I had to toggle the checkbox in the settings so it would appear.
Looks like this other bug has been fixed (probably by Milian during the Qt 6 porting).

I just found how Qt Creator detects missing documentation files in a function named cleanUpDocumentation(), then unregisters the corresponding documentation namespaces. I'll try to do the same cleanup on KDevelop start and finally fix this bug.
Comment 7 Bug Janitor Service 2024-09-28 17:44:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/672
Comment 8 Igor Kushnir 2024-10-18 10:44:01 UTC
Git commit bf50a33c1282523800efd12e4506c0dbcef9144f by Igor Kushnir.
Committed on 18/10/2024 at 10:42.
Pushed by igorkushnir into branch 'master'.

QtHelpQtDoc: unregister obsolete documentations

A system upgrade updates Qt documentation .qch files and increases
namespace versions. Obsolete namespaces remain in
~/.local/share/kdevelop/qthelpcollection.qhc until the user removes this
file manually. As a consequence, duplicate entries appear on the QtHelp
home page.

Unregister namespaces that are absent from currently existing QtHelp
.qch files in order to prevent the duplicate entries and free up disk
space.

Subsequent commits will reuse the new helper function
QtHelpProviderAbstract::cleanUpRegisteredDocumentations().
FIXED-IN: 6.1.241200

M  +20   -0    plugins/qthelp/qthelpproviderabstract.cpp
M  +17   -0    plugins/qthelp/qthelpproviderabstract.h
M  +25   -6    plugins/qthelp/qthelpqtdoc.cpp

https://invent.kde.org/kdevelop/kdevelop/-/commit/bf50a33c1282523800efd12e4506c0dbcef9144f