changeset 33001:bf0b6e629eff stable

fix XREF in urls of octaves help collection (bug #65285) * documentation.cc (handle_index_clicked): replace #XREF by #index- in help urls
author Torsten Lilge <ttl-octave@mailbox.org>
date Sat, 10 Feb 2024 13:39:44 +0100
parents fcf504e687c0
children 3a0d7c21384c 175eb207d9d9
files libgui/src/documentation.cc
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/documentation.cc	Fri Feb 09 21:45:34 2024 -0500
+++ b/libgui/src/documentation.cc	Sat Feb 10 13:39:44 2024 +0100
@@ -1073,9 +1073,14 @@
                                                   const QString&)
 {
   if (url.scheme () == "qthelp")
-    setSource (url);
+    {
+      // URL wihtin the help system, replace #XREF by #index-
+      QString u = url.toString ();
+      u.replace ("#XREF", "#index-");
+      setSource (QUrl (u));
+    }
   else
-    QDesktopServices::openUrl (url);
+    QDesktopServices::openUrl (url);  // URL outside help system
 }
 
 void documentation_browser::notice_settings ()