fix help titles
This commit is contained in:
1 parent
c961b30525
commit
9d3944c5fe
1 file changed
+13
-1
@@ -190,7 +190,19 @@ void HelpDlg::prepare(int sbPos)
|
|||||||
: phrases.lookup(QStringLiteral("FEATURES"), no);
|
: phrases.lookup(QStringLiteral("FEATURES"), no);
|
||||||
break;
|
break;
|
||||||
case LinkCategory::Model: title = helpText.lookup(QStringLiteral("HELPTITLE_MODELLIST")); break;
|
case LinkCategory::Model: title = helpText.lookup(QStringLiteral("HELPTITLE_MODELLIST")); break;
|
||||||
case LinkCategory::Text: title = helpText.lookupByHandle(no); break;
|
case LinkCategory::Text: {
|
||||||
|
// Text pages carry their own "$Caption\" markup prefix (handled by
|
||||||
|
// addTextual() for the body) - extract just that for the heading
|
||||||
|
// instead of using the whole raw (multi-paragraph) body as-is.
|
||||||
|
const QString body = helpText.lookupByHandle(no);
|
||||||
|
if (!body.isEmpty() && body.at(0) == QLatin1Char('$')) {
|
||||||
|
const int brk = body.indexOf(QLatin1Char('\\'));
|
||||||
|
title = brk > 0 ? body.mid(1, brk - 1) : body.mid(1);
|
||||||
|
} else {
|
||||||
|
title = body;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case LinkCategory::Misc:
|
case LinkCategory::Misc:
|
||||||
switch (static_cast<MiscLinkIndex>(no)) {
|
switch (static_cast<MiscLinkIndex>(no)) {
|
||||||
case MiscLinkIndex::Main: title = helpText.lookup(QStringLiteral("HELPTITLE_MAIN")); break;
|
case MiscLinkIndex::Main: title = helpText.lookup(QStringLiteral("HELPTITLE_MAIN")); break;
|
||||||
|
|||||||
Reference in new issue
Block a user