summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-08-21 07:23:33 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-08-21 07:23:33 (GMT)
commit45357546c29240b95300f392084a2fe901073d85 (patch)
treeaca89043c1bd80a3a7515402ee0fbb55b9cbf6ee /src/corelib
parent2e645960930442e895f887f1ef5e226d14eabcc7 (diff)
parentf11fc8f62558543dac1eca9d52a4801196c55221 (diff)
downloadQt-45357546c29240b95300f392084a2fe901073d85.zip
Qt-45357546c29240b95300f392084a2fe901073d85.tar.gz
Qt-45357546c29240b95300f392084a2fe901073d85.tar.bz2
Merge commit 'qt/master'
Conflicts: configure.exe examples/examples.pro qmake/Makefile.unix qmake/Makefile.win32 qmake/Makefile.win32-g++ qmake/Makefile.win32-g++-sh qmake/qmake.pro src/script/api/qscriptable.h src/script/api/qscriptclasspropertyiterator.h src/script/api/qscriptcontext.h src/script/api/qscriptengineagent.cpp src/script/api/qscriptstring.cpp src/script/api/qscriptstring.h src/script/api/qscriptvalueiterator.cpp src/script/api/qscriptvalueiterator.h src/script/qscriptclass.cpp src/script/qscriptcontext.cpp src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptvalue.cpp src/script/qscriptvalue_p.h src/script/qscriptvalueimplfwd_p.h src/script/script.pro src/src.pro tests/auto/auto.pro tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp tools/configure/configureapp.cpp
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qfeatures.txt7
-rw-r--r--src/corelib/tools/qbytearray.h1
-rw-r--r--src/corelib/tools/qregexp.cpp35
3 files changed, 22 insertions, 21 deletions
diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt
index 9408a5b..3a6c050 100644
--- a/src/corelib/global/qfeatures.txt
+++ b/src/corelib/global/qfeatures.txt
@@ -1143,13 +1143,6 @@ Requires: UNDOSTACK LISTVIEW
Name: QUndoView
SeeAlso: ???
-Feature: SCRIPT
-Description: Provides support for the QtScript module
-Section: Utilities
-Requires: TEXTDATE DATESTRING PROPERTIES
-Name: QtScript
-SeeAlso: ???
-
Feature: ACCESSIBILITY
Description: Provides accessibility support.
Section: Utilities
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index 4c4f8fb..300188d 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -321,6 +321,7 @@ public:
// stl compatibility
typedef const char & const_reference;
typedef char & reference;
+ typedef char value_type;
void push_back(char c);
void push_back(const char *c);
void push_back(const QByteArray &a);
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp
index 3cec0bf..5e952ee 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/tools/qregexp.cpp
@@ -1262,28 +1262,35 @@ struct QRegExpLookahead
};
#endif
-QRegExpEngine::QRegExpEngine(const QRegExpEngineKey &key)
- : cs(key.cs), greedyQuantifiers(key.patternSyntax == QRegExp::RegExp2),
- xmlSchemaExtensions(false)
-{
- setup();
-
- QString rx;
+/*! \internal
+ convert the pattern string to the RegExp syntax.
- switch (key.patternSyntax) {
- case QRegExp::Wildcard:
+ This is also used by QScriptEngine::newRegExp to convert to a pattern that JavaScriptCore can understan
+ */
+Q_CORE_EXPORT QString qt_regexp_toCanonical(const QString &pattern, QRegExp::PatternSyntax patternSyntax)
+{
+ switch (patternSyntax) {
#ifndef QT_NO_REGEXP_WILDCARD
- rx = wc2rx(key.pattern);
-#endif
+ case QRegExp::Wildcard:
+ return wc2rx(pattern);
break;
+#endif
case QRegExp::FixedString:
- rx = QRegExp::escape(key.pattern);
+ return QRegExp::escape(pattern);
break;
case QRegExp::W3CXmlSchema11:
- xmlSchemaExtensions = true;
default:
- rx = key.pattern;
+ return pattern;
}
+}
+
+QRegExpEngine::QRegExpEngine(const QRegExpEngineKey &key)
+ : cs(key.cs), greedyQuantifiers(key.patternSyntax == QRegExp::RegExp2),
+ xmlSchemaExtensions(key.patternSyntax == QRegExp::W3CXmlSchema11)
+{
+ setup();
+
+ QString rx = qt_regexp_toCanonical(key.pattern, key.patternSyntax);
valid = (parse(rx.unicode(), rx.length()) == rx.length());
if (!valid) {