15QString QHelpGlobal::uniquifyConnectionName(
const QString &name,
void *pointer)
18 QMutexLocker locker(&mutex);
19 static QHash<QString, quint16> idHash;
20 return QString::asprintf(
"%ls-%p-%d", qUtf16Printable(name), pointer, ++idHash[name]);
23QString QHelpGlobal::documentTitle(
const QString &content)
25 QString title = QCoreApplication::translate(
"QHelp",
"Untitled");
26 if (!content.isEmpty()) {
27 const int start = content.indexOf(
"<title>"_L1, 0, Qt::CaseInsensitive) + 7;
28 const int end = content.indexOf(
"</title>"_L1, 0, Qt::CaseInsensitive);
29 if ((end - start) > 0) {
30 title = content.mid(start, end - start);
31 if (Qt::mightBeRichText(title) || title.contains(u'&')) {
34 title = doc.toPlainText();