Skip to content

Commit ebf677a

Browse files
committed
improve doc command for package qthelp files
* documentation.cc (load_ref): if search for identifier fails, search for keywords before starting the full text search
1 parent 65d5a6b commit ebf677a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libgui/src/documentation.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,12 @@ documentation::load_ref (const QString& ref_name)
704704
#if defined (HAVE_QHELPENGINE_DOCUMENTSFORIDENTIFIER)
705705
QList<QHelpLink> found_links
706706
= m_help_engine->documentsForIdentifier (ref_name);
707+
// Depending on how the qch-file was generated, searching for an Id
708+
// might not be successful and the full text search would be started
709+
// next. In order to still find an exisiting index entry, try searching
710+
// for the keyword as well.
711+
if (found_links.count () == 0)
712+
found_links = m_help_engine->documentsForKeyword (ref_name);
707713
#else
708714
QMap<QString, QUrl> found_links
709715
= m_help_engine->linksForIdentifier (ref_name);

0 commit comments

Comments
 (0)