summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJarek Kobus <jkobus@trolltech.com>2009-04-02 13:08:25 (GMT)
committerJarek Kobus <jkobus@trolltech.com>2009-04-02 13:08:25 (GMT)
commitf399569248c6bdc9cb828471fe6bcc66b90c4535 (patch)
treeba7d20c1cf37e2152094ee43af6818823347d52a /tools
parent2b47dac1f7e0822e9ac2ef1ce98746e35faf995d (diff)
parentc02ad8a6f03fb2c23e854783e7620a5a43d991c2 (diff)
downloadQt-f399569248c6bdc9cb828471fe6bcc66b90c4535.zip
Qt-f399569248c6bdc9cb828471fe6bcc66b90c4535.tar.gz
Qt-f399569248c6bdc9cb828471fe6bcc66b90c4535.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'tools')
-rw-r--r--tools/assistant/lib/qhelpsearchindexreader_clucene.cpp114
-rw-r--r--tools/assistant/lib/qhelpsearchindexreader_clucene_p.h15
-rw-r--r--tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp408
-rw-r--r--tools/assistant/tools/assistant/contentwindow.cpp41
-rw-r--r--tools/assistant/tools/assistant/helpviewer.cpp24
-rw-r--r--tools/assistant/tools/assistant/indexwindow.cpp56
-rw-r--r--tools/assistant/tools/assistant/indexwindow.h2
-rw-r--r--tools/configure/tools.cpp41
-rw-r--r--tools/configure/tools.h41
-rw-r--r--tools/designer/src/lib/shared/plugindialog_p.h11
-rw-r--r--tools/linguist/linguist/formpreviewview.cpp2
-rw-r--r--tools/linguist/linguist/main.cpp13
-rw-r--r--tools/linguist/linguist/mainwindow.cpp2
-rw-r--r--tools/linguist/linguist/messageeditor.cpp2
-rw-r--r--tools/linguist/linguist/phrase.cpp2
-rw-r--r--tools/qdoc3/test/qt-api-only.qdocconf2
-rw-r--r--tools/qdoc3/test/qt-build-docs.qdocconf6
17 files changed, 656 insertions, 126 deletions
diff --git a/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp b/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp
index 82a3a17..a1ba001 100644
--- a/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp
+++ b/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp
@@ -83,9 +83,8 @@ void QHelpSearchIndexReader::cancelSearching()
mutex.unlock();
}
-void QHelpSearchIndexReader::search(const QString &collectionFile,
- const QString &indexFilesFolder,
- const QList<QHelpSearchQuery> &queryList)
+void QHelpSearchIndexReader::search(const QString &collectionFile, const QString &indexFilesFolder,
+ const QList<QHelpSearchQuery> &queryList)
{
QMutexLocker lock(&mutex);
@@ -147,17 +146,16 @@ void QHelpSearchIndexReader::run()
try {
#endif
QCLuceneBooleanQuery booleanQuery;
- if (!buildQuery(booleanQuery, queryList)) {
+ QCLuceneStandardAnalyzer analyzer;
+ if (!buildQuery(booleanQuery, queryList, analyzer)) {
emit searchingFinished(0);
return;
}
const QStringList attribList = engine.filterAttributes(engine.currentFilter());
if (!attribList.isEmpty()) {
- QCLuceneStandardAnalyzer analyzer;
QCLuceneQuery* query = QCLuceneQueryParser::parse(QLatin1String("+")
- + attribList.join(QLatin1String(" +")), QLatin1String("attribute"),
- analyzer);
+ + attribList.join(QLatin1String(" +")), QLatin1String("attribute"), analyzer);
if (!query) {
emit searchingFinished(0);
@@ -168,10 +166,26 @@ void QHelpSearchIndexReader::run()
QCLuceneIndexSearcher indexSearcher(indexPath);
QCLuceneHits hits = indexSearcher.search(booleanQuery);
- const QStringList namespaceList = engine.registeredDocumentations();
+
+ bool boost = true;
+ QCLuceneBooleanQuery tryHarderQuery;
+ if (hits.length() == 0) {
+ if (buildTryHarderQuery(tryHarderQuery, queryList, analyzer)) {
+ if (!attribList.isEmpty()) {
+ QCLuceneQuery* query = QCLuceneQueryParser::parse(QLatin1String("+")
+ + attribList.join(QLatin1String(" +")), QLatin1String("attribute"),
+ analyzer);
+ tryHarderQuery.add(query, true, true, false);
+ }
+ hits = indexSearcher.search(tryHarderQuery);
+ boost = (hits.length() == 0);
+ }
+ }
QSet<QString> pathSet;
QCLuceneDocument document;
+ const QStringList namespaceList = engine.registeredDocumentations();
+
for (qint32 i = 0; i < hits.length(); i++) {
document = hits.document(i);
const QString path = document.get(QLatin1String("path"));
@@ -192,8 +206,8 @@ void QHelpSearchIndexReader::run()
}
indexSearcher.close();
- int count = hitList.count();
- if (count > 0)
+ const int count = hitList.count();
+ if ((count > 0) && boost)
boostSearchHits(engine, hitList, queryList);
emit searchingFinished(hitList.count());
@@ -206,11 +220,9 @@ void QHelpSearchIndexReader::run()
}
}
-bool QHelpSearchIndexReader::defaultQuery(const QString &term,
- QCLuceneBooleanQuery &booleanQuery)
+bool QHelpSearchIndexReader::defaultQuery(const QString &term, QCLuceneBooleanQuery &booleanQuery,
+ QCLuceneStandardAnalyzer &analyzer)
{
- QCLuceneStandardAnalyzer analyzer;
-
const QLatin1String c("content");
const QLatin1String t("titleTokenized");
@@ -226,21 +238,23 @@ bool QHelpSearchIndexReader::defaultQuery(const QString &term,
}
bool QHelpSearchIndexReader::buildQuery(QCLuceneBooleanQuery &booleanQuery,
- const QList<QHelpSearchQuery> &queryList)
+ const QList<QHelpSearchQuery> &queryList, QCLuceneStandardAnalyzer &analyzer)
{
foreach (const QHelpSearchQuery query, queryList) {
switch (query.fieldName) {
case QHelpSearchQuery::FUZZY: {
const QLatin1String fuzzy("~");
- foreach (const QString term, query.wordList) {
- if (term.isEmpty() || !defaultQuery(term.toLower() + fuzzy, booleanQuery))
+ foreach (const QString &term, query.wordList) {
+ if (term.isEmpty()
+ || !defaultQuery(term.toLower() + fuzzy, booleanQuery, analyzer)) {
return false;
+ }
}
} break;
case QHelpSearchQuery::WITHOUT: {
QStringList stopWords = QCLuceneStopAnalyzer().englishStopWords();
- foreach (const QString term, query.wordList) {
+ foreach (const QString &term, query.wordList) {
if (stopWords.contains(term, Qt::CaseInsensitive))
continue;
@@ -259,14 +273,14 @@ bool QHelpSearchIndexReader::buildQuery(QCLuceneBooleanQuery &booleanQuery,
} break;
case QHelpSearchQuery::PHRASE: {
- const QString term = query.wordList.at(0).toLower();
+ const QString &term = query.wordList.at(0).toLower();
if (term.contains(QLatin1Char(' '))) {
QStringList termList = term.split(QLatin1String(" "));
QCLucenePhraseQuery *q = new QCLucenePhraseQuery();
QStringList stopWords = QCLuceneStopAnalyzer().englishStopWords();
- foreach (const QString t, termList) {
- if (!stopWords.contains(t, Qt::CaseInsensitive))
- q->addTerm(QCLuceneTerm(QLatin1String("content"), t.toLower()));
+ foreach (const QString &term, termList) {
+ if (!stopWords.contains(term, Qt::CaseInsensitive))
+ q->addTerm(QCLuceneTerm(QLatin1String("content"), term.toLower()));
}
booleanQuery.add(q, true, true, false);
} else {
@@ -286,7 +300,7 @@ bool QHelpSearchIndexReader::buildQuery(QCLuceneBooleanQuery &booleanQuery,
case QHelpSearchQuery::ALL: {
QStringList stopWords = QCLuceneStopAnalyzer().englishStopWords();
- foreach (const QString term, query.wordList) {
+ foreach (const QString &term, query.wordList) {
if (stopWords.contains(term, Qt::CaseInsensitive))
continue;
@@ -302,9 +316,8 @@ bool QHelpSearchIndexReader::buildQuery(QCLuceneBooleanQuery &booleanQuery,
} break;
case QHelpSearchQuery::DEFAULT: {
- QCLuceneStandardAnalyzer analyzer;
- foreach (const QString t, query.wordList) {
- QCLuceneQuery *query = QCLuceneQueryParser::parse(t.toLower(),
+ foreach (const QString &term, query.wordList) {
+ QCLuceneQuery *query = QCLuceneQueryParser::parse(term.toLower(),
QLatin1String("content"), analyzer);
if (query)
@@ -313,8 +326,8 @@ bool QHelpSearchIndexReader::buildQuery(QCLuceneBooleanQuery &booleanQuery,
} break;
case QHelpSearchQuery::ATLEAST: {
- foreach (const QString term, query.wordList) {
- if (term.isEmpty() || !defaultQuery(term.toLower(), booleanQuery))
+ foreach (const QString &term, query.wordList) {
+ if (term.isEmpty() || !defaultQuery(term.toLower(), booleanQuery, analyzer))
return false;
}
}
@@ -324,16 +337,38 @@ bool QHelpSearchIndexReader::buildQuery(QCLuceneBooleanQuery &booleanQuery,
return true;
}
+bool QHelpSearchIndexReader::buildTryHarderQuery(QCLuceneBooleanQuery &booleanQuery,
+ const QList<QHelpSearchQuery> &queryList, QCLuceneStandardAnalyzer &analyzer)
+{
+ bool retVal = false;
+ foreach (const QHelpSearchQuery query, queryList) {
+ switch (query.fieldName) {
+ default: break;
+ case QHelpSearchQuery::DEFAULT: {
+ foreach (const QString &term, query.wordList) {
+ QCLuceneQuery *query = QCLuceneQueryParser::parse(term.toLower(),
+ QLatin1String("content"), analyzer);
+
+ if (query) {
+ retVal = true;
+ booleanQuery.add(query, true, false, false);
+ }
+ }
+ } break;
+ }
+ }
+ return retVal;
+}
+
void QHelpSearchIndexReader::boostSearchHits(const QHelpEngineCore &engine,
- QList<QHelpSearchEngine::SearchHit> &hitList,
- const QList<QHelpSearchQuery> &queryList)
+ QList<QHelpSearchEngine::SearchHit> &hitList, const QList<QHelpSearchQuery> &queryList)
{
foreach (const QHelpSearchQuery query, queryList) {
if (query.fieldName != QHelpSearchQuery::DEFAULT)
continue;
QString joinedQuery = query.wordList.join(QLatin1String(" "));
-
+
QCLuceneStandardAnalyzer analyzer;
QCLuceneQuery *parsedQuery = QCLuceneQueryParser::parse(
joinedQuery, QLatin1String("content"), analyzer);
@@ -351,8 +386,7 @@ void QHelpSearchIndexReader::boostSearchHits(const QHelpEngineCore &engine,
QStringList searchTerms;
while (index != -1) {
nextIndex = joinedQuery.indexOf(QLatin1String("content:"), index + 1);
- term = joinedQuery.mid(index + length, nextIndex - (length + index))
- .simplified();
+ term = joinedQuery.mid(index + length, nextIndex - (length + index)).simplified();
if (term.startsWith(QLatin1String("\""))
&& term.endsWith(QLatin1String("\""))) {
searchTerms.append(term.remove(QLatin1String("\"")));
@@ -370,17 +404,19 @@ void QHelpSearchIndexReader::boostSearchHits(const QHelpEngineCore &engine,
QString data = QString::fromUtf8(engine.fileData(hit.first));
int counter = 0;
- foreach (const QString& term, searchTerms)
+ foreach (const QString &term, searchTerms)
counter += data.count(term, Qt::CaseInsensitive);
hitMap.insertMulti(counter, hit);
}
QList<QHelpSearchEngine::SearchHit> boostedList;
- QMap<int, QHelpSearchEngine::SearchHit>::const_iterator i;
- for (i = hitMap.constEnd(), --i; i != hitMap.constBegin(); --i)
- boostedList.append(i.value());
- boostedList += hitList.mid(count - 1, hitList.count());
-
+ QMap<int, QHelpSearchEngine::SearchHit>::const_iterator it = hitMap.constEnd();
+ do {
+ --it;
+ boostedList.append(it.value());
+ } while (it != hitMap.constBegin());
+ boostedList += hitList.mid(count, hitList.count());
+
hitList = boostedList;
}
}
diff --git a/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h b/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h
index 892c4e6..f7536e9 100644
--- a/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h
+++ b/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h
@@ -54,6 +54,8 @@
//
#include "qhelpsearchengine.h"
+
+#include "fulltextsearch/qanalyzer_p.h"
#include "fulltextsearch/qquery_p.h"
#include <QtCore/QList>
@@ -93,12 +95,13 @@ signals:
private:
void run();
- bool defaultQuery(const QString &term,
- QCLuceneBooleanQuery &booleanQuery);
- bool buildQuery(QCLuceneBooleanQuery &booleanQuery,
- const QList<QHelpSearchQuery> &queryList);
- void boostSearchHits(const QHelpEngineCore &engine,
- QList<QHelpSearchEngine::SearchHit> &hitList,
+ bool defaultQuery(const QString &term, QCLuceneBooleanQuery &booleanQuery,
+ QCLuceneStandardAnalyzer &analyzer);
+ bool buildQuery(QCLuceneBooleanQuery &booleanQuery, const QList<QHelpSearchQuery> &queryList,
+ QCLuceneStandardAnalyzer &analyzer);
+ bool buildTryHarderQuery(QCLuceneBooleanQuery &booleanQuery,
+ const QList<QHelpSearchQuery> &queryList, QCLuceneStandardAnalyzer &analyzer);
+ void boostSearchHits(const QHelpEngineCore &engine, QList<QHelpSearchEngine::SearchHit> &hitList,
const QList<QHelpSearchQuery> &queryList);
private:
diff --git a/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp b/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp
index e53bbae..195c490 100644
--- a/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp
+++ b/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp
@@ -59,16 +59,340 @@
#include <QtNetwork/QLocalSocket>
#include <QtNetwork/QLocalServer>
+#include "private/qfunctions_p.h"
+
QT_BEGIN_NAMESPACE
namespace qt {
namespace fulltextsearch {
namespace clucene {
+// taken from qtexthtmlparser
+static const struct QTextHtmlEntity
+{
+ const char *name;
+ quint16 code;
+} entities[] = {
+ { "AElig", 0x00c6 },
+ { "AMP", 38 },
+ { "Aacute", 0x00c1 },
+ { "Acirc", 0x00c2 },
+ { "Agrave", 0x00c0 },
+ { "Alpha", 0x0391 },
+ { "Aring", 0x00c5 },
+ { "Atilde", 0x00c3 },
+ { "Auml", 0x00c4 },
+ { "Beta", 0x0392 },
+ { "Ccedil", 0x00c7 },
+ { "Chi", 0x03a7 },
+ { "Dagger", 0x2021 },
+ { "Delta", 0x0394 },
+ { "ETH", 0x00d0 },
+ { "Eacute", 0x00c9 },
+ { "Ecirc", 0x00ca },
+ { "Egrave", 0x00c8 },
+ { "Epsilon", 0x0395 },
+ { "Eta", 0x0397 },
+ { "Euml", 0x00cb },
+ { "GT", 62 },
+ { "Gamma", 0x0393 },
+ { "Iacute", 0x00cd },
+ { "Icirc", 0x00ce },
+ { "Igrave", 0x00cc },
+ { "Iota", 0x0399 },
+ { "Iuml", 0x00cf },
+ { "Kappa", 0x039a },
+ { "LT", 60 },
+ { "Lambda", 0x039b },
+ { "Mu", 0x039c },
+ { "Ntilde", 0x00d1 },
+ { "Nu", 0x039d },
+ { "OElig", 0x0152 },
+ { "Oacute", 0x00d3 },
+ { "Ocirc", 0x00d4 },
+ { "Ograve", 0x00d2 },
+ { "Omega", 0x03a9 },
+ { "Omicron", 0x039f },
+ { "Oslash", 0x00d8 },
+ { "Otilde", 0x00d5 },
+ { "Ouml", 0x00d6 },
+ { "Phi", 0x03a6 },
+ { "Pi", 0x03a0 },
+ { "Prime", 0x2033 },
+ { "Psi", 0x03a8 },
+ { "QUOT", 34 },
+ { "Rho", 0x03a1 },
+ { "Scaron", 0x0160 },
+ { "Sigma", 0x03a3 },
+ { "THORN", 0x00de },
+ { "Tau", 0x03a4 },
+ { "Theta", 0x0398 },
+ { "Uacute", 0x00da },
+ { "Ucirc", 0x00db },
+ { "Ugrave", 0x00d9 },
+ { "Upsilon", 0x03a5 },
+ { "Uuml", 0x00dc },
+ { "Xi", 0x039e },
+ { "Yacute", 0x00dd },
+ { "Yuml", 0x0178 },
+ { "Zeta", 0x0396 },
+ { "aacute", 0x00e1 },
+ { "acirc", 0x00e2 },
+ { "acute", 0x00b4 },
+ { "aelig", 0x00e6 },
+ { "agrave", 0x00e0 },
+ { "alefsym", 0x2135 },
+ { "alpha", 0x03b1 },
+ { "amp", 38 },
+ { "and", 0x22a5 },
+ { "ang", 0x2220 },
+ { "apos", 0x0027 },
+ { "aring", 0x00e5 },
+ { "asymp", 0x2248 },
+ { "atilde", 0x00e3 },
+ { "auml", 0x00e4 },
+ { "bdquo", 0x201e },
+ { "beta", 0x03b2 },
+ { "brvbar", 0x00a6 },
+ { "bull", 0x2022 },
+ { "cap", 0x2229 },
+ { "ccedil", 0x00e7 },
+ { "cedil", 0x00b8 },
+ { "cent", 0x00a2 },
+ { "chi", 0x03c7 },
+ { "circ", 0x02c6 },
+ { "clubs", 0x2663 },
+ { "cong", 0x2245 },
+ { "copy", 0x00a9 },
+ { "crarr", 0x21b5 },
+ { "cup", 0x222a },
+ { "curren", 0x00a4 },
+ { "dArr", 0x21d3 },
+ { "dagger", 0x2020 },
+ { "darr", 0x2193 },
+ { "deg", 0x00b0 },
+ { "delta", 0x03b4 },
+ { "diams", 0x2666 },
+ { "divide", 0x00f7 },
+ { "eacute", 0x00e9 },
+ { "ecirc", 0x00ea },
+ { "egrave", 0x00e8 },
+ { "empty", 0x2205 },
+ { "emsp", 0x2003 },
+ { "ensp", 0x2002 },
+ { "epsilon", 0x03b5 },
+ { "equiv", 0x2261 },
+ { "eta", 0x03b7 },
+ { "eth", 0x00f0 },
+ { "euml", 0x00eb },
+ { "euro", 0x20ac },
+ { "exist", 0x2203 },
+ { "fnof", 0x0192 },
+ { "forall", 0x2200 },
+ { "frac12", 0x00bd },
+ { "frac14", 0x00bc },
+ { "frac34", 0x00be },
+ { "frasl", 0x2044 },
+ { "gamma", 0x03b3 },
+ { "ge", 0x2265 },
+ { "gt", 62 },
+ { "hArr", 0x21d4 },
+ { "harr", 0x2194 },
+ { "hearts", 0x2665 },
+ { "hellip", 0x2026 },
+ { "iacute", 0x00ed },
+ { "icirc", 0x00ee },
+ { "iexcl", 0x00a1 },
+ { "igrave", 0x00ec },
+ { "image", 0x2111 },
+ { "infin", 0x221e },
+ { "int", 0x222b },
+ { "iota", 0x03b9 },
+ { "iquest", 0x00bf },
+ { "isin", 0x2208 },
+ { "iuml", 0x00ef },
+ { "kappa", 0x03ba },
+ { "lArr", 0x21d0 },
+ { "lambda", 0x03bb },
+ { "lang", 0x2329 },
+ { "laquo", 0x00ab },
+ { "larr", 0x2190 },
+ { "lceil", 0x2308 },
+ { "ldquo", 0x201c },
+ { "le", 0x2264 },
+ { "lfloor", 0x230a },
+ { "lowast", 0x2217 },
+ { "loz", 0x25ca },
+ { "lrm", 0x200e },
+ { "lsaquo", 0x2039 },
+ { "lsquo", 0x2018 },
+ { "lt", 60 },
+ { "macr", 0x00af },
+ { "mdash", 0x2014 },
+ { "micro", 0x00b5 },
+ { "middot", 0x00b7 },
+ { "minus", 0x2212 },
+ { "mu", 0x03bc },
+ { "nabla", 0x2207 },
+ { "nbsp", 0x00a0 },
+ { "ndash", 0x2013 },
+ { "ne", 0x2260 },
+ { "ni", 0x220b },
+ { "not", 0x00ac },
+ { "notin", 0x2209 },
+ { "nsub", 0x2284 },
+ { "ntilde", 0x00f1 },
+ { "nu", 0x03bd },
+ { "oacute", 0x00f3 },
+ { "ocirc", 0x00f4 },
+ { "oelig", 0x0153 },
+ { "ograve", 0x00f2 },
+ { "oline", 0x203e },
+ { "omega", 0x03c9 },
+ { "omicron", 0x03bf },
+ { "oplus", 0x2295 },
+ { "or", 0x22a6 },
+ { "ordf", 0x00aa },
+ { "ordm", 0x00ba },
+ { "oslash", 0x00f8 },
+ { "otilde", 0x00f5 },
+ { "otimes", 0x2297 },
+ { "ouml", 0x00f6 },
+ { "para", 0x00b6 },
+ { "part", 0x2202 },
+ { "percnt", 0x0025 },
+ { "permil", 0x2030 },
+ { "perp", 0x22a5 },
+ { "phi", 0x03c6 },
+ { "pi", 0x03c0 },
+ { "piv", 0x03d6 },
+ { "plusmn", 0x00b1 },
+ { "pound", 0x00a3 },
+ { "prime", 0x2032 },
+ { "prod", 0x220f },
+ { "prop", 0x221d },
+ { "psi", 0x03c8 },
+ { "quot", 34 },
+ { "rArr", 0x21d2 },
+ { "radic", 0x221a },
+ { "rang", 0x232a },
+ { "raquo", 0x00bb },
+ { "rarr", 0x2192 },
+ { "rceil", 0x2309 },
+ { "rdquo", 0x201d },
+ { "real", 0x211c },
+ { "reg", 0x00ae },
+ { "rfloor", 0x230b },
+ { "rho", 0x03c1 },
+ { "rlm", 0x200f },
+ { "rsaquo", 0x203a },
+ { "rsquo", 0x2019 },
+ { "sbquo", 0x201a },
+ { "scaron", 0x0161 },
+ { "sdot", 0x22c5 },
+ { "sect", 0x00a7 },
+ { "shy", 0x00ad },
+ { "sigma", 0x03c3 },
+ { "sigmaf", 0x03c2 },
+ { "sim", 0x223c },
+ { "spades", 0x2660 },
+ { "sub", 0x2282 },
+ { "sube", 0x2286 },
+ { "sum", 0x2211 },
+ { "sup", 0x2283 },
+ { "sup1", 0x00b9 },
+ { "sup2", 0x00b2 },
+ { "sup3", 0x00b3 },
+ { "supe", 0x2287 },
+ { "szlig", 0x00df },
+ { "tau", 0x03c4 },
+ { "there4", 0x2234 },
+ { "theta", 0x03b8 },
+ { "thetasym", 0x03d1 },
+ { "thinsp", 0x2009 },
+ { "thorn", 0x00fe },
+ { "tilde", 0x02dc },
+ { "times", 0x00d7 },
+ { "trade", 0x2122 },
+ { "uArr", 0x21d1 },
+ { "uacute", 0x00fa },
+ { "uarr", 0x2191 },
+ { "ucirc", 0x00fb },
+ { "ugrave", 0x00f9 },
+ { "uml", 0x00a8 },
+ { "upsih", 0x03d2 },
+ { "upsilon", 0x03c5 },
+ { "uuml", 0x00fc },
+ { "weierp", 0x2118 },
+ { "xi", 0x03be },
+ { "yacute", 0x00fd },
+ { "yen", 0x00a5 },
+ { "yuml", 0x00ff },
+ { "zeta", 0x03b6 },
+ { "zwj", 0x200d },
+ { "zwnj", 0x200c }
+};
+
+Q_STATIC_GLOBAL_OPERATOR bool operator<(const QString &entityStr, const QTextHtmlEntity &entity)
+{
+ return entityStr < QLatin1String(entity.name);
+}
+
+Q_STATIC_GLOBAL_OPERATOR bool operator<(const QTextHtmlEntity &entity, const QString &entityStr)
+{
+ return QLatin1String(entity.name) < entityStr;
+}
+
+static QChar resolveEntity(const QString &entity)
+{
+ const QTextHtmlEntity *start = &entities[0];
+ const QTextHtmlEntity *end = &entities[(sizeof(entities) / sizeof(entities[0]))];
+ const QTextHtmlEntity *e = qBinaryFind(start, end, entity);
+ if (e == end)
+ return QChar();
+ return e->code;
+}
+
+static const uint latin1Extended[0xA0 - 0x80] = {
+ 0x20ac, // 0x80
+ 0x0081, // 0x81 direct mapping
+ 0x201a, // 0x82
+ 0x0192, // 0x83
+ 0x201e, // 0x84
+ 0x2026, // 0x85
+ 0x2020, // 0x86
+ 0x2021, // 0x87
+ 0x02C6, // 0x88
+ 0x2030, // 0x89
+ 0x0160, // 0x8A
+ 0x2039, // 0x8B
+ 0x0152, // 0x8C
+ 0x008D, // 0x8D direct mapping
+ 0x017D, // 0x8E
+ 0x008F, // 0x8F directmapping
+ 0x0090, // 0x90 directmapping
+ 0x2018, // 0x91
+ 0x2019, // 0x92
+ 0x201C, // 0x93
+ 0X201D, // 0x94
+ 0x2022, // 0x95
+ 0x2013, // 0x96
+ 0x2014, // 0x97
+ 0x02DC, // 0x98
+ 0x2122, // 0x99
+ 0x0161, // 0x9A
+ 0x203A, // 0x9B
+ 0x0153, // 0x9C
+ 0x009D, // 0x9D direct mapping
+ 0x017E, // 0x9E
+ 0x0178 // 0x9F
+};
+// end taken from qtexthtmlparser
+
class DocumentHelper
{
public:
- DocumentHelper(const QString& fileName, const QByteArray &data)
+ DocumentHelper(const QString &fileName, const QByteArray &data)
: fileName(fileName) , data(readData(data)) {}
~DocumentHelper() {}
@@ -131,8 +455,15 @@ private:
while (j < length) {
c = buf[j++];
if (c == QLatin1Char('<') || c == QLatin1Char('&')) {
- if (count > 1)
+ if (count > 1 && c != QLatin1Char('&'))
parsedContent.append(QLatin1Char(' '));
+ else if (c == QLatin1Char('&')) {
+ // Note: this will modify the counter j, in case we sucessful parsed the entity
+ // we will have modified the counter to stay 1 before the closing ';', so
+ // the following if condition will be met with if (c == QLatin1Char(';'))
+ parsedContent.append(parseEntity(length, buf, j));
+ }
+
count = 0;
valid = false;
continue;
@@ -157,6 +488,63 @@ private:
return parsedContent;
}
+ // taken from qtexthtmlparser
+ // parses an entity after "&", and returns it
+ QString parseEntity(int len, const QChar *buf, int &pos) const
+ {
+ int recover = pos;
+ QString entity;
+ while (pos < len) {
+ QChar c = buf[pos++];
+ if (c.isSpace() || pos - recover > 9) {
+ goto error;
+ }
+ if (c == QLatin1Char(';')) {
+ pos--;
+ break;
+ }
+ entity += c;
+ }
+ {
+ QChar resolved = resolveEntity(entity);
+ if (!resolved.isNull())
+ return QString(resolved);
+ }
+ if (entity.length() > 1 && entity.at(0) == QLatin1Char('#')) {
+ entity.remove(0, 1); // removing leading #
+
+ int base = 10;
+ bool ok = false;
+
+ if (entity.at(0).toLower() == QLatin1Char('x')) { // hex entity?
+ entity.remove(0, 1);
+ base = 16;
+ }
+
+ uint uc = entity.toUInt(&ok, base);
+ if (ok) {
+ if (uc >= 0x80 && uc < 0x80 + (sizeof(latin1Extended) / sizeof(latin1Extended[0])))
+ uc = latin1Extended[uc - 0x80]; // windows latin 1 extended
+ QString str;
+ if (uc > 0xffff) {
+ // surrogate pair
+ uc -= 0x10000;
+ ushort high = uc/0x400 + 0xd800;
+ ushort low = uc%0x400 + 0xdc00;
+ str.append(QChar(high));
+ str.append(QChar(low));
+ } else {
+ str.append(QChar(uc));
+ }
+ return str;
+ }
+ }
+ error:
+ pos = recover;
+ return QLatin1String(" ");
+ }
+ // end taken from qtexthtmlparser
+
private:
QString fileName;
QString data;
@@ -239,7 +627,7 @@ void QHelpSearchIndexWriter::run()
// old style qhc file < 4.4.2, need to convert...
const QStringList indexedNamespaces = engine.customValue(oldKey).
toString().split(QLatin1String("|"), QString::SkipEmptyParts);
- foreach (const QString& nameSpace, indexedNamespaces)
+ foreach (const QString &nameSpace, indexedNamespaces)
indexMap.insert(nameSpace, QDateTime());
engine.removeCustomValue(oldKey);
} else {
@@ -294,7 +682,7 @@ void QHelpSearchIndexWriter::run()
}
if (QCLuceneIndexReader::indexExists(indexPath) && !reindex) {
- foreach(const QString& namespaceName, registeredDocs) {
+ foreach(const QString &namespaceName, registeredDocs) {
mutexLocker.relock();
if (m_cancel) {
emit indexingFinished();
@@ -342,7 +730,7 @@ void QHelpSearchIndexWriter::run()
writer->setMaxFieldLength(QCLuceneIndexWriter::DEFAULT_MAX_FIELD_LENGTH);
QStringList namespaces;
- foreach(const QString& namespaceName, registeredDocs) {
+ foreach(const QString &namespaceName, registeredDocs) {
mutexLocker.relock();
if (m_cancel) {
writer->close();
@@ -367,7 +755,7 @@ void QHelpSearchIndexWriter::run()
break;
} else {
bool bail = false;
- foreach (const QStringList& attributes, attributeSets) {
+ foreach (const QStringList &attributes, attributeSets) {
const QList<QUrl> docFiles = indexableFiles(&engine,
namespaceName, attributes);
if (!addDocuments(docFiles, engine, attributes, namespaceName,
@@ -397,7 +785,7 @@ void QHelpSearchIndexWriter::run()
mutexLocker.unlock();
QStringList indexedNamespaces = indexMap.keys();
- foreach(const QString& namespaceName, indexedNamespaces) {
+ foreach(const QString &namespaceName, indexedNamespaces) {
mutexLocker.relock();
if (m_cancel)
break;
@@ -422,7 +810,7 @@ bool QHelpSearchIndexWriter::addDocuments(const QList<QUrl> docFiles,
const QString attrList = attributes.join(QLatin1String(" "));
locker.unlock();
- foreach(const QUrl& url, docFiles) {
+ foreach(const QUrl &url, docFiles) {
QCLuceneDocument document;
DocumentHelper helper(url.toString(), engine.fileData(url));
if (helper.addFieldsToDocument(&document, namespaceName, attrList))
@@ -450,8 +838,8 @@ void QHelpSearchIndexWriter::removeDocuments(const QString &indexPath,
reader.close();
}
-bool QHelpSearchIndexWriter::writeIndexMap(QHelpEngineCore& engine,
- const QMap<QString, QDateTime>& indexMap)
+bool QHelpSearchIndexWriter::writeIndexMap(QHelpEngineCore &engine,
+ const QMap<QString, QDateTime> &indexMap)
{
QByteArray bArray;
diff --git a/tools/assistant/tools/assistant/contentwindow.cpp b/tools/assistant/tools/assistant/contentwindow.cpp
index ef272e8..24e7ca9 100644
--- a/tools/assistant/tools/assistant/contentwindow.cpp
+++ b/tools/assistant/tools/assistant/contentwindow.cpp
@@ -118,19 +118,24 @@ void ContentWindow::keyPressEvent(QKeyEvent *e)
bool ContentWindow::eventFilter(QObject *o, QEvent *e)
{
- if (m_contentWidget && o == m_contentWidget->viewport() && e->type()
- == QEvent::MouseButtonRelease) {
+ if (m_contentWidget && o == m_contentWidget->viewport()
+ && e->type() == QEvent::MouseButtonRelease) {
QMouseEvent *me = static_cast<QMouseEvent*>(e);
- if (m_contentWidget->indexAt(me->pos()).isValid()
- && me->button() == Qt::LeftButton) {
- itemClicked(m_contentWidget->currentIndex());
- } else if (m_contentWidget->indexAt(me->pos()).isValid()
- && me->button() == Qt::MidButton) {
- QHelpContentModel *contentModel =
- qobject_cast<QHelpContentModel*>(m_contentWidget->model());
- QHelpContentItem *itm =
- contentModel->contentItemAt(m_contentWidget->currentIndex());
- CentralWidget::instance()->setSourceInNewTab(itm->url());
+ QModelIndex index = m_contentWidget->indexAt(me->pos());
+ QItemSelectionModel *sm = m_contentWidget->selectionModel();
+
+ if (index.isValid() && (sm && sm->isSelected(index))) {
+ if (me->button() == Qt::LeftButton) {
+ itemClicked(index);
+ } else if (me->button() == Qt::MidButton) {
+ QHelpContentModel *contentModel =
+ qobject_cast<QHelpContentModel*>(m_contentWidget->model());
+ if (contentModel) {
+ QHelpContentItem *itm = contentModel->contentItemAt(index);
+ if (itm)
+ CentralWidget::instance()->setSourceInNewTab(itm->url());
+ }
+ }
}
}
return QWidget::eventFilter(o, e);
@@ -160,14 +165,14 @@ void ContentWindow::showContextMenu(const QPoint &pos)
void ContentWindow::itemClicked(const QModelIndex &index)
{
- if (!index.isValid())
- return;
QHelpContentModel *contentModel =
qobject_cast<QHelpContentModel*>(m_contentWidget->model());
- QHelpContentItem *itm =
- contentModel->contentItemAt(index);
- if (itm)
- emit linkActivated(itm->url());
+
+ if (contentModel) {
+ QHelpContentItem *itm = contentModel->contentItemAt(index);
+ if (itm)
+ emit linkActivated(itm->url());
+ }
}
QT_END_NAMESPACE
diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp
index 9817f23..6b049e8 100644
--- a/tools/assistant/tools/assistant/helpviewer.cpp
+++ b/tools/assistant/tools/assistant/helpviewer.cpp
@@ -201,10 +201,14 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *,
{
const QUrl &url = request.url();
if (isLocalUrl(url)) {
- if (url.path().endsWith(QLatin1String("pdf"))) {
- QString fileName = url.toString();
- fileName = QDir::tempPath() + QDir::separator() + fileName.right
- (fileName.length() - fileName.lastIndexOf(QChar('/')));
+ const QString& path = url.path();
+ if (path.endsWith(QLatin1String(".pdf"))) {
+ const int lastDash = path.lastIndexOf(QChar('/'));
+ QString fileName = QDir::tempPath() + QDir::separator();
+ if (lastDash < 0)
+ fileName += path;
+ else
+ fileName += path.mid(lastDash + 1, path.length());
QFile tmpFile(QDir::cleanPath(fileName));
if (tmpFile.open(QIODevice::ReadWrite)) {
@@ -396,15 +400,19 @@ void HelpViewer::zoomOut(int range)
bool HelpViewer::launchedWithExternalApp(const QUrl &url)
{
- bool isPdf = url.path().endsWith(QLatin1String("pdf"));
+ bool isPdf = url.path().endsWith(QLatin1String(".pdf"));
if (url.scheme() == QLatin1String("http")
|| url.scheme() == QLatin1String("ftp")
|| url.scheme() == QLatin1String("mailto") || isPdf) {
bool launched = false;
if (isPdf && url.scheme() == QLatin1String("qthelp")) {
- QString fileName = url.toString();
- fileName = QDir::tempPath() + QDir::separator() + fileName.right
- (fileName.length() - fileName.lastIndexOf(QLatin1Char('/')));
+ const QString& path = url.path();
+ const int lastDash = path.lastIndexOf(QChar('/'));
+ QString fileName = QDir::tempPath() + QDir::separator();
+ if (lastDash < 0)
+ fileName += path;
+ else
+ fileName += path.mid(lastDash + 1, path.length());
QFile tmpFile(QDir::cleanPath(fileName));
if (tmpFile.open(QIODevice::ReadWrite)) {
diff --git a/tools/assistant/tools/assistant/indexwindow.cpp b/tools/assistant/tools/assistant/indexwindow.cpp
index e7575fa..4bd6f4f 100644
--- a/tools/assistant/tools/assistant/indexwindow.cpp
+++ b/tools/assistant/tools/assistant/indexwindow.cpp
@@ -122,10 +122,9 @@ bool IndexWindow::eventFilter(QObject *obj, QEvent *e)
m_indexWidget->setCurrentIndex(idx);
break;
case Qt::Key_Escape:
- emit escapePressed();
+ emit escapePressed();
break;
- default:
- ;
+ default: ; // stop complaining
}
} else if (obj == m_indexWidget && e->type() == QEvent::ContextMenu) {
QContextMenuEvent *ctxtEvent = static_cast<QContextMenuEvent*>(e);
@@ -140,44 +139,15 @@ bool IndexWindow::eventFilter(QObject *obj, QEvent *e)
if (curTab == action)
m_indexWidget->activateCurrentItem();
else if (newTab == action) {
- QHelpIndexModel *model =
- qobject_cast<QHelpIndexModel*>(m_indexWidget->model());
- QString keyword = model->data(idx, Qt::DisplayRole).toString();
- if (model) {
- QMap<QString, QUrl> links = model->linksForKeyword(keyword);
- if (links.count() == 1) {
- CentralWidget::instance()->
- setSourceInNewTab(links.constBegin().value());
- } else {
- TopicChooser tc(this, keyword, links);
- if (tc.exec() == QDialog::Accepted) {
- CentralWidget::instance()->setSourceInNewTab(tc.link());
- }
- }
- }
+ open(m_indexWidget, idx);
}
}
} else if (m_indexWidget && obj == m_indexWidget->viewport()
&& e->type() == QEvent::MouseButtonRelease) {
QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(e);
QModelIndex idx = m_indexWidget->indexAt(mouseEvent->pos());
- if (idx.isValid() && mouseEvent->button()==Qt::MidButton) {
- QHelpIndexModel *model =
- qobject_cast<QHelpIndexModel*>(m_indexWidget->model());
- QString keyword = model->data(idx, Qt::DisplayRole).toString();
- if (model) {
- QMap<QString, QUrl> links = model->linksForKeyword(keyword);
- if (links.count() > 1) {
- TopicChooser tc(this, keyword, links);
- if (tc.exec() == QDialog::Accepted) {
- CentralWidget::instance()->setSourceInNewTab(tc.link());
- }
- } else if (links.count() == 1) {
- CentralWidget::instance()->
- setSourceInNewTab(links.constBegin().value());
- }
- }
- }
+ if (idx.isValid() && mouseEvent->button()==Qt::MidButton)
+ open(m_indexWidget, idx);
}
#ifdef Q_OS_MAC
else if (obj == m_indexWidget && e->type() == QEvent::KeyPress) {
@@ -213,4 +183,20 @@ void IndexWindow::focusInEvent(QFocusEvent *e)
}
}
+void IndexWindow::open(QHelpIndexWidget* indexWidget, const QModelIndex &index)
+{
+ QHelpIndexModel *model = qobject_cast<QHelpIndexModel*>(indexWidget->model());
+ if (model) {
+ QString keyword = model->data(index, Qt::DisplayRole).toString();
+ QMap<QString, QUrl> links = model->linksForKeyword(keyword);
+ if (links.count() > 1) {
+ TopicChooser tc(this, keyword, links);
+ if (tc.exec() == QDialog::Accepted)
+ CentralWidget::instance()->setSourceInNewTab(tc.link());
+ } else if (links.count() == 1) {
+ CentralWidget::instance()->setSourceInNewTab(links.constBegin().value());
+ }
+ }
+}
+
QT_END_NAMESPACE
diff --git a/tools/assistant/tools/assistant/indexwindow.h b/tools/assistant/tools/assistant/indexwindow.h
index f1f57f9..14ed83c 100644
--- a/tools/assistant/tools/assistant/indexwindow.h
+++ b/tools/assistant/tools/assistant/indexwindow.h
@@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE
class QHelpIndexWidget;
class QHelpEngine;
+class QModelIndex;
class IndexWindow : public QWidget
{
@@ -79,6 +80,7 @@ private slots:
private:
bool eventFilter(QObject *obj, QEvent *e);
void focusInEvent(QFocusEvent *e);
+ void open(QHelpIndexWidget *indexWidget, const QModelIndex &index);
QLineEdit *m_searchLineEdit;
QHelpIndexWidget *m_indexWidget;
diff --git a/tools/configure/tools.cpp b/tools/configure/tools.cpp
index ae1ecda..5d12ea5 100644
--- a/tools/configure/tools.cpp
+++ b/tools/configure/tools.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "tools.h"
#include <QDir>
diff --git a/tools/configure/tools.h b/tools/configure/tools.h
index e95ff13..68a439a 100644
--- a/tools/configure/tools.h
+++ b/tools/configure/tools.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef _TOOLS_H_
#define _TOOLS_H_
diff --git a/tools/designer/src/lib/shared/plugindialog_p.h b/tools/designer/src/lib/shared/plugindialog_p.h
index d50a804..a2601d4 100644
--- a/tools/designer/src/lib/shared/plugindialog_p.h
+++ b/tools/designer/src/lib/shared/plugindialog_p.h
@@ -42,6 +42,17 @@
#ifndef PLUGINDIALOG_H
#define PLUGINDIALOG_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "ui_plugindialog.h"
QT_BEGIN_NAMESPACE
diff --git a/tools/linguist/linguist/formpreviewview.cpp b/tools/linguist/linguist/formpreviewview.cpp
index 990414b..184f01b 100644
--- a/tools/linguist/linguist/formpreviewview.cpp
+++ b/tools/linguist/linguist/formpreviewview.cpp
@@ -473,7 +473,7 @@ void FormPreviewView::setSourceContext(int model, MessageItem *messageItem)
}
QDir dir = QFileInfo(m_dataModel->srcFileName(model)).dir();
- QString fileName = dir.absoluteFilePath(messageItem->fileName());
+ QString fileName = QDir::cleanPath(dir.absoluteFilePath(messageItem->fileName()));
if (m_lastFormName != fileName) {
delete m_form;
m_form = 0;
diff --git a/tools/linguist/linguist/main.cpp b/tools/linguist/linguist/main.cpp
index 018fbc5..a6a0d27 100644
--- a/tools/linguist/linguist/main.cpp
+++ b/tools/linguist/linguist/main.cpp
@@ -80,12 +80,15 @@ int main(int argc, char **argv)
}
QTranslator translator;
- translator.load(QLatin1String("linguist_") + QLocale::system().name(), resourceDir);
- app.installTranslator(&translator);
-
QTranslator qtTranslator;
- qtTranslator.load(QLatin1String("qt_") + QLocale::system().name(), resourceDir);
- app.installTranslator(&qtTranslator);
+ QString sysLocale = QLocale::system().name();
+ if (translator.load(QLatin1String("linguist_") + sysLocale, resourceDir)) {
+ app.installTranslator(&translator);
+ if (qtTranslator.load(QLatin1String("qt_") + sysLocale, resourceDir))
+ app.installTranslator(&qtTranslator);
+ else
+ app.removeTranslator(&translator);
+ }
app.setOrganizationName(QLatin1String("Trolltech"));
app.setApplicationName(QLatin1String("Linguist"));
diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp
index 6ee0dd8..84200d4 100644
--- a/tools/linguist/linguist/mainwindow.cpp
+++ b/tools/linguist/linguist/mainwindow.cpp
@@ -1535,7 +1535,7 @@ void MainWindow::selectedMessageChanged(const QModelIndex &sortedIndex, const QM
} else {
m_sourceAndFormView->setCurrentWidget(m_sourceCodeView);
QDir dir = QFileInfo(m_dataModel->srcFileName(model)).dir();
- QString fileName = dir.absoluteFilePath(m->fileName());
+ QString fileName = QDir::cleanPath(dir.absoluteFilePath(m->fileName()));
m_sourceCodeView->setSourceContext(fileName, m->lineNumber());
}
m_errorsView->setEnabled(true);
diff --git a/tools/linguist/linguist/messageeditor.cpp b/tools/linguist/linguist/messageeditor.cpp
index e858bbb..3fc91e3 100644
--- a/tools/linguist/linguist/messageeditor.cpp
+++ b/tools/linguist/linguist/messageeditor.cpp
@@ -786,6 +786,7 @@ void MessageEditor::selectAll()
void MessageEditor::emitTranslationChanged()
{
+ static_cast<FormWidget *>(sender())->getEditor()->setFocus(); // DND proofness
updateBeginFromSource();
updateUndoRedo();
emit translationChanged(translations(m_currentModel));
@@ -793,6 +794,7 @@ void MessageEditor::emitTranslationChanged()
void MessageEditor::emitTranslatorCommentChanged()
{
+ static_cast<FormWidget *>(sender())->getEditor()->setFocus(); // DND proofness
updateUndoRedo();
emit translatorCommentChanged(m_editors[m_currentModel].transCommentText->getTranslation());
}
diff --git a/tools/linguist/linguist/phrase.cpp b/tools/linguist/linguist/phrase.cpp
index 563c72d..300f6e8 100644
--- a/tools/linguist/linguist/phrase.cpp
+++ b/tools/linguist/linguist/phrase.cpp
@@ -243,7 +243,7 @@ bool PhraseBook::load(const QString &fileName, bool *langGuessed)
// don't click on these!
reader.setFeature(QLatin1String("http://xml.org/sax/features/namespaces"), false);
reader.setFeature(QLatin1String("http://xml.org/sax/features/namespace-prefixes"), true);
- reader.setFeature(QLatin1String("http://qtsoftware.com/xml/features/report-whitespace"
+ reader.setFeature(QLatin1String("http://trolltech.com/xml/features/report-whitespace"
"-only-CharData"), false);
QphHandler *hand = new QphHandler(this);
reader.setContentHandler(hand);
diff --git a/tools/qdoc3/test/qt-api-only.qdocconf b/tools/qdoc3/test/qt-api-only.qdocconf
index 2e91ba2..bc5656b 100644
--- a/tools/qdoc3/test/qt-api-only.qdocconf
+++ b/tools/qdoc3/test/qt-api-only.qdocconf
@@ -9,7 +9,7 @@ url = ./
# Ensures that the documentation for the tools is not included in the generated
# .qhp file.
-qhp.Qt.excluded = $QT_SOURCE_TREE/doc/src/assistant-manual.qdoc \
+qhp.Qt.excluded += $QT_SOURCE_TREE/doc/src/assistant-manual.qdoc \
$QT_SOURCE_TREE/doc/src/examples/simpletextviewer.qdoc \
$QT_SOURCE_TREE/doc/src/designer-manual.qdoc \
$QT_SOURCE_TREE/doc/src/examples/calculatorbuilder.qdoc \
diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf
index ce415b7..a13ea94 100644
--- a/tools/qdoc3/test/qt-build-docs.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs.qdocconf
@@ -92,7 +92,11 @@ excludedirs = $QT_SOURCE_TREE/src/3rdparty/clucene \
$QT_SOURCE_TREE/src/3rdparty/webkit/WebCore \
$QT_SOURCE_TREE/src/3rdparty/wintab \
$QT_SOURCE_TREE/src/3rdparty/zlib \
- $QT_SOURCE_TREE/doc/src/snippets
+ $QT_SOURCE_TREE/doc/src/snippets \
+ $QT_SOURCE_TREE/src/3rdparty/phonon/gstreamer \
+ $QT_SOURCE_TREE/src/3rdparty/phonon/ds9 \
+ $QT_SOURCE_TREE/src/3rdparty/phonon/qt7 \
+ $QT_SOURCE_TREE/src/3rdparty/phonon/waveout
sources.fileextensions = "*.cpp *.qdoc *.mm"
examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp"