summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2010-04-09 13:16:09 (GMT)
committerMartin Smith <msmith@trolltech.com>2010-04-09 13:16:09 (GMT)
commit0bd75b67bc23d51670822305a31e19a74ca7134e (patch)
tree41b37d4e21ffd4b7bb7974e6b2bf9aa6494b5781 /tools
parent5e5836702662783a4fba5f95a487948e5c6d2a4e (diff)
parente4cae397e3737551752487000e152162d0878f88 (diff)
downloadQt-0bd75b67bc23d51670822305a31e19a74ca7134e.zip
Qt-0bd75b67bc23d51670822305a31e19a74ca7134e.tar.gz
Qt-0bd75b67bc23d51670822305a31e19a74ca7134e.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'tools')
-rw-r--r--tools/assistant/lib/qhelpprojectdata.cpp28
-rw-r--r--tools/linguist/linguist.pro1
-rw-r--r--tools/linguist/shared/translator.cpp9
-rw-r--r--tools/tools.pro3
4 files changed, 30 insertions, 11 deletions
diff --git a/tools/assistant/lib/qhelpprojectdata.cpp b/tools/assistant/lib/qhelpprojectdata.cpp
index 83491a0..b0faf0c 100644
--- a/tools/assistant/lib/qhelpprojectdata.cpp
+++ b/tools/assistant/lib/qhelpprojectdata.cpp
@@ -47,6 +47,7 @@
#include <QtCore/QStack>
#include <QtCore/QMap>
#include <QtCore/QRegExp>
+#include <QtCore/QUrl>
#include <QtCore/QVariant>
#include <QtXml/QXmlStreamReader>
@@ -77,6 +78,7 @@ private:
void readFiles();
void raiseUnknownTokenError();
void addMatchingFiles(const QString &pattern);
+ bool hasValidSyntax(const QString &nameSpace, const QString &vFolder) const;
QMap<QString, QStringList> dirEntriesCache;
};
@@ -115,16 +117,14 @@ void QHelpProjectDataPrivate::readProject()
if (isStartElement()) {
if (name() == QLatin1String("virtualFolder")) {
virtualFolder = readElementText();
- if (virtualFolder.contains(QLatin1String("/")))
+ if (!hasValidSyntax(QLatin1String("test"), virtualFolder))
raiseError(QCoreApplication::translate("QHelpProject",
- "A virtual folder must not contain "
- "a \'/\' character!"));
+ "Virtual folder has invalid syntax."));
} else if (name() == QLatin1String("namespace")) {
namespaceName = readElementText();
- if (namespaceName.contains(QLatin1String("/")))
+ if (!hasValidSyntax(namespaceName, QLatin1String("test")))
raiseError(QCoreApplication::translate("QHelpProject",
- "A namespace must not contain a "
- "\'/\' character!"));
+ "Namespace has invalid syntax."));
} else if (name() == QLatin1String("customFilter")) {
readCustomFilter();
} else if (name() == QLatin1String("filterSection")) {
@@ -318,6 +318,22 @@ void QHelpProjectDataPrivate::addMatchingFiles(const QString &pattern)
filterSectionList.last().addFile(pattern);
}
+bool QHelpProjectDataPrivate::hasValidSyntax(const QString &nameSpace,
+ const QString &vFolder) const
+{
+ const QLatin1Char slash('/');
+ if (nameSpace.contains(slash) || vFolder.contains(slash))
+ return false;
+ QUrl url;
+ const QLatin1String scheme("qthelp");
+ url.setScheme(scheme);
+ url.setHost(nameSpace);
+ url.setPath(vFolder);
+
+ const QString expectedUrl(scheme + QLatin1String("://") + nameSpace + slash + vFolder);
+ return url.isValid() && url.toString() == expectedUrl;
+}
+
/*!
\internal
\class QHelpProjectData
diff --git a/tools/linguist/linguist.pro b/tools/linguist/linguist.pro
index c4b7c29..248c89e 100644
--- a/tools/linguist/linguist.pro
+++ b/tools/linguist/linguist.pro
@@ -4,4 +4,3 @@ SUBDIRS = \
lupdate \
lconvert
!no-png:!contains(QT_CONFIG, no-gui):SUBDIRS += linguist
-CONFIG += ordered
diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp
index 465355d..ae7728e 100644
--- a/tools/linguist/shared/translator.cpp
+++ b/tools/linguist/shared/translator.cpp
@@ -45,8 +45,13 @@
#include <stdio.h>
#ifdef Q_OS_WIN
-#include <io.h> // required for _setmode, to avoid _O_TEXT streams...
-#include <fcntl.h> // for _O_BINARY
+// required for _setmode, to avoid _O_TEXT streams...
+# ifdef Q_OS_WINCE
+# include <stdlib.h>
+# else
+# include <io.h> // for _setmode
+# include <fcntl.h> // for _O_BINARY
+# endif
#endif
#include <QtCore/QDebug>
diff --git a/tools/tools.pro b/tools/tools.pro
index cfa202e..99a965d 100644
--- a/tools/tools.pro
+++ b/tools/tools.pro
@@ -19,7 +19,7 @@ TEMPLATE = subdirs
unix:!mac:!embedded:contains(QT_CONFIG, qt3support):SUBDIRS += qtconfig
win32:!wince*:SUBDIRS += activeqt
}
- contains(QT_CONFIG, declarative):SUBDIRS += qmlviewer qmldebugger
+ contains(QT_CONFIG, declarative):SUBDIRS += qml
}
SUBDIRS += linguist
@@ -30,7 +30,6 @@ mac {
embedded:SUBDIRS += kmap2qmap
-contains(QT_CONFIG, declarative):SUBDIRS += qml
contains(QT_CONFIG, dbus):SUBDIRS += qdbus
!wince*:contains(QT_CONFIG, xmlpatterns): SUBDIRS += xmlpatterns xmlpatternsvalidator
embedded: SUBDIRS += makeqpf