diff -r b72c6db6890b -r 5dc02b23752f tools/assistant/lib/qhelp_global.cpp --- a/tools/assistant/lib/qhelp_global.cpp Wed Jun 23 19:07:03 2010 +0300 +++ b/tools/assistant/lib/qhelp_global.cpp Tue Jul 06 15:10:48 2010 +0300 @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include #include #include #include @@ -55,12 +56,12 @@ counter = 0; return QString::fromLatin1("%1-%2-%3"). - arg(name).arg(long(pointer)).arg(counter); + arg(name).arg(quintptr(pointer)).arg(counter); } QString QHelpGlobal::documentTitle(const QString &content) { - QString title = QObject::tr("Untitled"); + QString title = QCoreApplication::translate("QHelp", "Untitled"); if (!content.isEmpty()) { int start = content.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive) + 7; int end = content.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive); @@ -86,17 +87,18 @@ QString QHelpGlobal::codecFromHtmlData(const QByteArray &data) { - QString content = QString::fromUtf8(data.constData(), data.size()); - int start = content.indexOf(QLatin1String(" 0) { - int end; QRegExp r(QLatin1String("charset=([^\"\\s]+)")); while (start != -1) { - end = content.indexOf(QLatin1Char('>'), start) + 1; - const QString &meta = content.mid(start, end - start).toLower(); + const int end = head.indexOf(QLatin1Char('>'), start) + 1; + if (end <= start) + break; + const QString &meta = head.mid(start, end - start).toLower(); if (r.indexIn(meta) != -1) return r.cap(1); - start = content.indexOf(QLatin1String(".*")); - return encodingExp.exactMatch(content) ? encodingExp.cap(1) : QString(); + return encodingExp.exactMatch(head) ? encodingExp.cap(1) : QString(); }