Fix QtHelp
ClosedPublic

Authored by antonanikin on Oct 29 2016, 10:21 AM.

Details

Reviewers
brauch
Group Reviewers
KDevelop
Commits
R32:48b0276f67de: Fix QtHelp
Summary

This patch fixes broken code-context help. Old version has buggy behavior:

  1. Place following code to some source file (line numbers is for example):
1: QHBoxLayout hbl;
2: QLayout* l = &hbl;
3: l->addWidget(new QPushButton);
4: hbl.addWidget(new QPushButton);

Restart KDevelop.

  1. Place cursor to addWidget in line 3 and call "Show Documentation" from context menu. Help page is shown and all it's OK.
  1. Place cursor to addWidget in line 4 and call help again. Help page is shown but with wrong contents.
  1. Place cursor again to addWidget in line 3 and call "Show documentation". Help page is shown but again with wrong contents.
  1. Such broken search will happens until next restart.

This behavior caused by wrong usage of documentation Url - it passed as baseUrl parameter of QWebView::setContent() method, which is wrong. Qt doc says:

External objects referenced in the content are located relative to baseUrl.

Therefore new version uses setUrl() method to set correct documentation Url.

Test Plan

Tested on master branch. The presented example works as it must.

Diff Detail

Repository
R32 KDevelop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
antonanikin retitled this revision from to qthelp_fix.
antonanikin updated this object.
antonanikin edited the test plan for this revision. (Show Details)
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptOct 29 2016, 10:21 AM
antonanikin retitled this revision from qthelp_fix to Fix QtHelp.Oct 29 2016, 10:33 AM
antonanikin updated this object.
antonanikin edited the test plan for this revision. (Show Details)
antonanikin added a reviewer: KDevelop.
antonanikin edited the test plan for this revision. (Show Details)
brauch accepted this revision.Oct 29 2016, 10:59 AM
brauch added a reviewer: brauch.
brauch added a subscriber: brauch.

Good find! I have seen this issue but never looked into it. For clarity -- the issue is that the "url" argument of setContent() doesn't do what you would suspect it to do, right? If so, please mention that in the commit message :)

This revision is now accepted and ready to land.Oct 29 2016, 10:59 AM
antonanikin edited edge metadata.

Summary update

This revision was automatically updated to reflect the committed changes.