summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2010-01-14 08:48:16 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2010-01-14 08:48:16 (GMT)
commitcf74ef2ca9163ac6e15b6a218ef284f6104cdcab (patch)
tree68fc4ba63a8080917550f8c769c8c4e8f64f45a1
parent3531f4c831407016ef0735d9cdff9b193e4b3f92 (diff)
parent862d5433fb694a03715b2327a107b3192b921924 (diff)
downloadQt-cf74ef2ca9163ac6e15b6a218ef284f6104cdcab.zip
Qt-cf74ef2ca9163ac6e15b6a218ef284f6104cdcab.tar.gz
Qt-cf74ef2ca9163ac6e15b6a218ef284f6104cdcab.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6
Conflicts: dist/changes-4.6.1
-rw-r--r--configure.exebin1176576 -> 1176064 bytes
-rw-r--r--dist/changes-4.6.168
-rw-r--r--doc/src/deployment/qt-conf.qdoc2
-rw-r--r--doc/src/examples/moveblocks.qdoc6
-rw-r--r--doc/src/objectmodel/properties.qdoc19
-rw-r--r--doc/src/snippets/code/doc_src_properties.qdoc2
-rw-r--r--examples/animation/moveblocks/main.cpp1
-rw-r--r--examples/graphicsview/graphicsview.pro1
-rw-r--r--examples/widgets/validators/validators.ui321
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog12
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro9
-rw-r--r--src/corelib/io/qfileinfo.cpp7
-rw-r--r--src/gui/dialogs/qmessagebox.cpp21
-rw-r--r--src/gui/styles/qs60style.cpp9
-rw-r--r--src/gui/styles/qs60style_p.h5
-rw-r--r--src/gui/styles/qs60style_s60.cpp5
-rw-r--r--src/gui/styles/qs60style_simulated.cpp7
-rw-r--r--src/gui/widgets/qstackedwidget.cpp7
-rw-r--r--src/multimedia/audio/qaudioinput.cpp2
-rw-r--r--src/network/ssl/qsslsocket_p.h3
-rw-r--r--tests/auto/linguist/lupdate/.gitignore2
-rw-r--r--tests/auto/linguist/lupdate/lupdate.pro3
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/backslashes/lupdatecmd2
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/backslashes/project.pro16
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/backslashes/ts/project.ts.result (renamed from tests/auto/linguist/lupdate/testdata/good/backslashes/project.ts.result)0
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.pro15
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr/project.pro15
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.pro11
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.pro11
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/heuristics/expectedoutput.txt6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/heuristics/lupdatecmd2
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/heuristics/main.cpp (renamed from tests/auto/linguist/lupdate/testlupdate.h)53
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/heuristics/project.pro3
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/heuristics/project.ts.before38
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/heuristics/project.ts.result22
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.pro11
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/merge_ordering/lupdatecmd6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.pro13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/merge_versions/project.pro13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.pro13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp/project.pro13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/lupdatecmd6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.pro13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.pro13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergeui/project.pro13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergeui_obsolete/project.pro13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/multiple_locations/project.pro11
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/namespaces/project.pro11
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parse_special_chars/project.pro11
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecontexts/project.pro11
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp/project.pro11
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt1
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.pro11
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsejava/project.pro11
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseui/project.pro12
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/prefix/project.pro11
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/preprocess/project.pro11
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsing/project.pro11
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsing2/project.pro11
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.pro5
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingpri/project.pro9
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/project.pro5
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/sub1/sub1.pro11
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingsubs/common/common.pro5
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingsubs/lupdatecmd1
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingsubs/mac/mac.pro6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingsubs/project.pro5
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingsubs/unix/unix.pro6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingsubs/win/win.pro6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd2
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/reloutput/main.cpp (renamed from tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/main.cpp)0
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/reloutput/project.pro3
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/reloutput/translations/project.ts.result (renamed from tests/auto/linguist/lupdate/testdata/output_ts/project.ts.result)0
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/textsimilarity/project.pro13
-rw-r--r--tests/auto/linguist/lupdate/testdata/output_ts/lupdatecmd5
-rw-r--r--tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/tools.pro12
-rw-r--r--tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/translations/readme.txt2
-rw-r--r--tests/auto/linguist/lupdate/testlupdate.cpp158
-rw-r--r--tests/auto/linguist/lupdate/tst_lupdate.cpp251
-rw-r--r--tests/benchmarks/qnetworkreply/tst_qnetworkreply.cpp8
-rw-r--r--tools/configure/configureapp.cpp3
-rw-r--r--tools/linguist/lupdate/cpp.cpp2
-rw-r--r--tools/linguist/lupdate/main.cpp8
-rw-r--r--tools/linguist/lupdate/merge.cpp95
-rw-r--r--tools/linguist/shared/translator.cpp12
-rw-r--r--translations/qt_de.ts28
87 files changed, 674 insertions, 956 deletions
diff --git a/configure.exe b/configure.exe
index a410efc..d88da13 100644
--- a/configure.exe
+++ b/configure.exe
Binary files differ
diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1
index e31fc7c..6e95fd5 100644
--- a/dist/changes-4.6.1
+++ b/dist/changes-4.6.1
@@ -29,8 +29,10 @@ New features
Optimizations
-------------
- - Optimized foo in QSomeClass
- * See list of Important Behavior Changes below
+ - Optimized empty QUrl creation
+ * [QTBUG-4030] Empty QUrls no longer allocate memory now
+
+ * See list of Important Behavior Changes below
****************************************************************************
@@ -45,6 +47,17 @@ QtCore
and Symbian by using realpath() system call
* Avoid stat() when opening a file
+ - QLibrary and QPluginLoader
+ * Do not look at the Qt patch-level version embedded in plugins'
+ buildkeys when trying to determine if the plugin is compatible
+
+ - QProcessEnvironment
+ * [QTBUG-6701] Ensure we don't crash in operator==
+
+ - QTextEncoder
+ * [merge request 399] QTextEncoder::fromUnicode as QT3 support
+ member
+
- QXmlStreamreader
* [merge request 1926] Fix parsing of DTDs that contain empty markup
declarations
@@ -114,8 +127,30 @@ QtGui
QtDBus
------
- - foo
- * bar
+ - QDBusConnection
+ * [QTBUG-5979] Fixed the signal-delivery mechanism to update
+ correctly when the sender name changes/appears on the bus.
+ * [QTBUG-7041] Fixed marshalling of booleans in release mode.
+ * [QT-2307] Fixed calls with the QDBus::BlockWithGui mode.
+
+ - QDBusInterface
+ * Made it continue working even when the remote object
+ introspection fails.
+
+ - QDBusInterface and qdbuscpp2xml
+ * [QTBUG-5563] Fixed an issue with generating annotations in
+ signals
+
+ - QDBusPendingReply and QDBusReply
+ * [QTBUG-6571] Fixed a crash that would happen if you tried to
+ make a call with a disconnected QDBusConnection
+
+QtMultimedia
+------------
+
+ - QAudioOutput
+ * [Merge request 418] Fixed compilation the example provided for
+ QAudioOutput::start
QtNetwork
---------
@@ -124,6 +159,8 @@ QtNetwork
* HTTP: Smaller improvements
* HTTP: Send our locale with the HTTP request
* HTTP: Start Accept-language and Authorization header with capital letter
+ * HTTP: Fix caching algorithm, matching RFC 2612 and the documentation
+ * HTTP [QTBUG-7060]: Fix an issue with headers like "private, max-age=300"
* file: Introduce special subclass for higher performance with file:// URLs
- QTcpSocket
* [QTBUG-5799] Fix waitForConnected() on Windows
@@ -187,7 +224,7 @@ QtOpenVG
- [QTBUG-7051] Reset the OpenVG scissor after a native painting call-out.
- [QTBUG-7015] Avoid deep copies of QImage in QImage::bits() calls.
-QtwebKit
+QtWebKit
--------
- Fixed user agent string on Symbian (webkit.org/b/31961)
@@ -200,6 +237,7 @@ QtwebKit
- Fixed assertion when dragging SVG images (webkit.org/b/32511)
- Fixed crash with ACID3 test on Symbian
- Fixed security issue XSL stylesheets and security origins.
+ - Added the framecapture example to the default build (merge request 2235)
QtScript
--------
@@ -260,7 +298,15 @@ Third party components
Qt for Unix (X11 and Mac OS X)
------------------------------
- -
+ - [QTBUG-6755] Ensure we don't call select(2) with a negative timeout
+ if the timer expires during timeout recalculation.
+
+ - Added mkspecs for Sun CC that enable -library=stlport by default,
+ to restore STL capability with that compiler.
+
+ - [QTBUG-6576] Fixed compilation on HP-UX 11.11
+
+ - [QTBUG-6961] Fixed compilation on HURD
Qt for Linux/X11
----------------
@@ -361,5 +407,13 @@ Qt for Symbian
* Important Behavior Changes *
****************************************************************************
- -
+ - Phonon
+ * Include headers have been changed. The only official method for
+ including Phonon headers is <phonon/ClassName> or
+ <phonon/classname.h>. This change was necessary because of
+ frameworks on Mac.
+
+ Compatibility is provided for <Phonon/*> includes, but is not
+ guaranteed to work. Including <phonon> and <Phonon> is not
+ supported.
diff --git a/doc/src/deployment/qt-conf.qdoc b/doc/src/deployment/qt-conf.qdoc
index 4357c88..b195889 100644
--- a/doc/src/deployment/qt-conf.qdoc
+++ b/doc/src/deployment/qt-conf.qdoc
@@ -128,7 +128,7 @@
\list
\o 4.0.1 matches \c Paths/4
\o 4.1.5 matches \c Paths/4.1
- \o 4.6.3 matches \c Paths/4.2.5
+ \o 4.6.3 matches \c Paths/4.2.5 (because 4.2.5 is the latest version with the same major version number)
\o 5.0.0 matches \c Paths
\o 6.0.2 matches \c Paths/6
\endlist
diff --git a/doc/src/examples/moveblocks.qdoc b/doc/src/examples/moveblocks.qdoc
index 2d0787a..f3e8ce5 100644
--- a/doc/src/examples/moveblocks.qdoc
+++ b/doc/src/examples/moveblocks.qdoc
@@ -60,7 +60,7 @@
states.
\o \c StateSwitchTransition is a custom transition that
triggers on \c{StateSwitchEvent}s.
- \o \c StateSwitchEvent is a QEvent that trigger \c{StateSwitchTransition}s.
+ \o \c StateSwitchEvent is a QEvent that triggers \c{StateSwitchTransition}s.
\o \c QGraphicsRectWidget is a QGraphicsWidget that simply
paints its background in a solid \l{Qt::}{blue} color.
\endlist
@@ -141,7 +141,7 @@
Finally, we can create the state machine, add our initial state,
and start execution of the state graph.
- \section2 The \c createGemetryState() Function
+ \section2 The \c createGeometryState() Function
In \c createGeometryState(), we set up the geometry for each
graphics item.
@@ -155,7 +155,7 @@
\section1 The StateSwitcher Class
\c StateSwitcher has state switch transitions to each \l{QState}s
- we created with \c createGemetryState(). Its job is to transition
+ we created with \c createGeometryState(). Its job is to transition
to one of these states at random when it is entered.
All functions in \c StateSwitcher are inlined. We'll step through
diff --git a/doc/src/objectmodel/properties.qdoc b/doc/src/objectmodel/properties.qdoc
index 076c544..a807caf 100644
--- a/doc/src/objectmodel/properties.qdoc
+++ b/doc/src/objectmodel/properties.qdoc
@@ -208,17 +208,20 @@
the property type. The meta-object compiler enforces these
requirements.
- Given a pointer to an instance of MyClass or a pointer to an
- instance of QObject that happens to be an instance of MyClass, we
- have two ways to set its priority property.
+ Given a pointer to an instance of MyClass or a pointer to a
+ QObject that is an instance of MyClass, we have two ways to set
+ its priority property:
\snippet doc/src/snippets/code/doc_src_properties.qdoc 6
- In the example, the enumeration type used for the property type
- was locally declared in MyClass. Had it been declared in another
- class, its fully qualified name (i.e., OtherClass::Priority) would
- be required. In addition, that other class must also inherit
- QObject and register the enum type using Q_ENUMS().
+ In the example, the enumeration type that is the property type is
+ declared in MyClass and registered with the \l{Meta-Object System}
+ using the Q_ENUMS() macro. This makes the enumeration values
+ available as strings for use as in the call to setProperty(). Had
+ the enumeration type been declared in another class, its fully
+ qualified name (i.e., OtherClass::Priority) would be required, and
+ that other class would also have to inherit QObject and register
+ the enumeration type there using the Q_ENUMS() macro.
A similar macro, Q_FLAGS(), is also available. Like Q_ENUMS(), it
registers an enumeration type, but it marks the type as being a
diff --git a/doc/src/snippets/code/doc_src_properties.qdoc b/doc/src/snippets/code/doc_src_properties.qdoc
index 38cc139..962d930 100644
--- a/doc/src/snippets/code/doc_src_properties.qdoc
+++ b/doc/src/snippets/code/doc_src_properties.qdoc
@@ -112,7 +112,7 @@ MyClass *myinstance = new MyClass;
QObject *object = myinstance;
myinstance->setPriority(MyClass::VeryHigh);
-object->setProperty("priority", (int)MyClass::VeryHigh);
+object->setProperty("priority", "VeryHigh");
//! [6]
diff --git a/examples/animation/moveblocks/main.cpp b/examples/animation/moveblocks/main.cpp
index 4475cbb..d70326e 100644
--- a/examples/animation/moveblocks/main.cpp
+++ b/examples/animation/moveblocks/main.cpp
@@ -147,7 +147,6 @@ QState *createGeometryState(QObject *w1, const QRect &rect1,
{
QState *result = new QState(parent);
result->assignProperty(w1, "geometry", rect1);
- result->assignProperty(w1, "geometry", rect1);
result->assignProperty(w2, "geometry", rect2);
result->assignProperty(w3, "geometry", rect3);
result->assignProperty(w4, "geometry", rect4);
diff --git a/examples/graphicsview/graphicsview.pro b/examples/graphicsview/graphicsview.pro
index 210ab1f..8f65d51 100644
--- a/examples/graphicsview/graphicsview.pro
+++ b/examples/graphicsview/graphicsview.pro
@@ -10,6 +10,7 @@ SUBDIRS = \
dragdroprobot \
flowlayout \
anchorlayout \
+ simpleanchorlayout \
weatheranchorlayout
contains(QT_CONFIG, qt3support):SUBDIRS += portedcanvas portedasteroids
diff --git a/examples/widgets/validators/validators.ui b/examples/widgets/validators/validators.ui
index f05b96f..cd984e6 100644
--- a/examples/widgets/validators/validators.ui
+++ b/examples/widgets/validators/validators.ui
@@ -1,41 +1,42 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>ValidatorsForm</class>
- <widget class="QWidget" name="ValidatorsForm" >
- <property name="geometry" >
+ <widget class="QWidget" name="ValidatorsForm">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>526</width>
- <height>668</height>
+ <height>443</height>
</rect>
</property>
- <property name="windowTitle" >
- <string>Form</string>
+ <property name="windowTitle">
+ <string>Validators</string>
</property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>9</number>
+ </property>
<item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
+ <layout class="QHBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
- <widget class="LocaleSelector" name="localeSelector" />
+ <widget class="LocaleSelector" name="localeSelector"/>
</item>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
@@ -46,84 +47,84 @@
</layout>
</item>
<item>
- <widget class="QGroupBox" name="groupBox" >
- <property name="title" >
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
<string>QIntValidator</string>
</property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>9</number>
+ </property>
<item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
+ <layout class="QHBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
- <layout class="QGridLayout" >
- <property name="margin" >
+ <layout class="QGridLayout">
+ <property name="margin">
<number>0</number>
</property>
- <property name="spacing" >
+ <property name="spacing">
<number>6</number>
</property>
- <item row="0" column="0" >
- <widget class="QLabel" name="label" >
- <property name="text" >
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
<string>Min:</string>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QSpinBox" name="minVal" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
+ <item row="0" column="1">
+ <widget class="QSpinBox" name="minVal">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimum" >
+ <property name="minimum">
<number>-1000000</number>
</property>
- <property name="maximum" >
+ <property name="maximum">
<number>1000000</number>
</property>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QLabel" name="label_2" >
- <property name="text" >
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
<string>Max:</string>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="1" column="1" >
- <widget class="QSpinBox" name="maxVal" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
+ <item row="1" column="1">
+ <widget class="QSpinBox" name="maxVal">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimum" >
+ <property name="minimum">
<number>-1000000</number>
</property>
- <property name="maximum" >
+ <property name="maximum">
<number>1000000</number>
</property>
- <property name="value" >
+ <property name="value">
<number>1000</number>
</property>
</widget>
@@ -131,39 +132,39 @@
</layout>
</item>
<item>
- <widget class="QFrame" name="frame" >
- <property name="frameShape" >
+ <widget class="QFrame" name="frame">
+ <property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
- <property name="frameShadow" >
+ <property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>9</number>
+ </property>
<item>
- <widget class="LEDWidget" name="ledWidget" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+ <widget class="LEDWidget" name="ledWidget">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="pixmap" >
- <pixmap resource="validators.qrc" >:/ledoff.png</pixmap>
+ <property name="pixmap">
+ <pixmap resource="validators.qrc">:/ledoff.png</pixmap>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
- <widget class="QLabel" name="label_7" >
- <property name="text" >
+ <widget class="QLabel" name="label_7">
+ <property name="text">
<string>editingFinished()</string>
</property>
</widget>
@@ -175,13 +176,13 @@
</item>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeType" >
+ <property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
@@ -190,134 +191,134 @@
</spacer>
</item>
<item>
- <widget class="QLineEdit" name="editor" />
+ <widget class="QLineEdit" name="editor"/>
</item>
</layout>
</widget>
</item>
<item>
- <widget class="QGroupBox" name="groupBox_2" >
- <property name="title" >
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
<string>QDoubleValidator</string>
</property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>9</number>
+ </property>
<item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
+ <layout class="QHBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
- <layout class="QGridLayout" >
- <property name="margin" >
+ <layout class="QGridLayout">
+ <property name="margin">
<number>0</number>
</property>
- <property name="spacing" >
+ <property name="spacing">
<number>6</number>
</property>
- <item row="0" column="0" >
- <widget class="QLabel" name="label_3" >
- <property name="text" >
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
<string>Min:</string>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QDoubleSpinBox" name="doubleMinVal" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
+ <item row="0" column="1">
+ <widget class="QDoubleSpinBox" name="doubleMinVal">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimum" >
+ <property name="minimum">
<double>-100000.000000000000000</double>
</property>
- <property name="maximum" >
+ <property name="maximum">
<double>100000.000000000000000</double>
</property>
- <property name="value" >
+ <property name="value">
<double>0.000000000000000</double>
</property>
</widget>
</item>
- <item row="0" column="2" >
- <widget class="QLabel" name="label_5" >
- <property name="text" >
+ <item row="0" column="2">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
<string>Format:</string>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="0" column="3" >
- <widget class="QComboBox" name="doubleFormat" >
+ <item row="0" column="3">
+ <widget class="QComboBox" name="doubleFormat">
<item>
- <property name="text" >
+ <property name="text">
<string>Standard</string>
</property>
</item>
<item>
- <property name="text" >
+ <property name="text">
<string>Scientific</string>
</property>
</item>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QLabel" name="label_4" >
- <property name="text" >
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
<string>Max:</string>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="1" column="1" >
- <widget class="QDoubleSpinBox" name="doubleMaxVal" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
+ <item row="1" column="1">
+ <widget class="QDoubleSpinBox" name="doubleMaxVal">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimum" >
+ <property name="minimum">
<double>-100000.000000000000000</double>
</property>
- <property name="maximum" >
+ <property name="maximum">
<double>100000.000000000000000</double>
</property>
- <property name="value" >
+ <property name="value">
<double>1000.000000000000000</double>
</property>
</widget>
</item>
- <item row="1" column="2" >
- <widget class="QLabel" name="label_6" >
- <property name="text" >
+ <item row="1" column="2">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
<string>Decimals:</string>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="1" column="3" >
- <widget class="QSpinBox" name="doubleDecimals" >
- <property name="value" >
+ <item row="1" column="3">
+ <widget class="QSpinBox" name="doubleDecimals">
+ <property name="value">
<number>2</number>
</property>
</widget>
@@ -325,36 +326,36 @@
</layout>
</item>
<item>
- <widget class="QFrame" name="frame_2" >
- <property name="frameShape" >
+ <widget class="QFrame" name="frame_2">
+ <property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
- <property name="frameShadow" >
+ <property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>9</number>
+ </property>
<item>
- <widget class="LEDWidget" name="doubleLedWidget" >
- <property name="text" >
+ <widget class="LEDWidget" name="doubleLedWidget">
+ <property name="text">
<string/>
</property>
- <property name="pixmap" >
- <pixmap resource="validators.qrc" >:/ledoff.png</pixmap>
+ <property name="pixmap">
+ <pixmap resource="validators.qrc">:/ledoff.png</pixmap>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
- <widget class="QLabel" name="label_8" >
- <property name="text" >
+ <widget class="QLabel" name="label_8">
+ <property name="text">
<string>editingFinished()</string>
</property>
</widget>
@@ -366,13 +367,13 @@
</item>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeType" >
+ <property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
@@ -381,17 +382,17 @@
</spacer>
</item>
<item>
- <widget class="QLineEdit" name="doubleEditor" />
+ <widget class="QLineEdit" name="doubleEditor"/>
</item>
</layout>
</widget>
</item>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>111</height>
@@ -400,19 +401,19 @@
</spacer>
</item>
<item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
+ <layout class="QHBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
@@ -421,8 +422,8 @@
</spacer>
</item>
<item>
- <widget class="QPushButton" name="pushButton" >
- <property name="text" >
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
<string>Quit</string>
</property>
</widget>
@@ -444,7 +445,7 @@
</customwidget>
</customwidgets>
<resources>
- <include location="validators.qrc" />
+ <include location="validators.qrc"/>
</resources>
<connections>
<connection>
@@ -453,11 +454,11 @@
<receiver>ValidatorsForm</receiver>
<slot>close()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>94</x>
<y>274</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>131</x>
<y>260</y>
</hint>
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index b69ac98..bc6d661 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -8,4 +8,4 @@ The commit imported was from the
and has the sha1 checksum
- bd6591b4acaf2172ab05702153ef539c0ac89cbb
+ 8b9165d3bc84d1c8cc7df49a191cc3857b5530d4
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index ab5b131..02daf86 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-13 Miikka Heikkinen <miikka.heikkinen@digia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt/Symbian] Added missing vendor information to qtwebkit.sis
+
+ This information is necessary to Symbian sign the package.
+
+ http://bugreports.qt.nokia.com/browse/QTBUG-7290
+
+ * WebCore.pro:
+
2010-01-12 Jakub Wieczorek <faw217@gmail.com>
Reviewed by Adam Barth.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 3eba696..9432217 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -9,6 +9,15 @@ symbian: {
webkitlibs.sources = QtWebKit.dll
webkitlibs.path = /sys/bin
+ vendorinfo = \
+ "; Localised Vendor name" \
+ "%{\"Nokia, Qt\"}" \
+ " " \
+ "; Unique Vendor name" \
+ ":\"Nokia, Qt\"" \
+ " "
+ webkitlibs.pkg_prerules = vendorinfo
+
DEPLOYMENT += webkitlibs
TARGET.UID3 = 0x200267C2
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index b4437db..e90529e 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -573,10 +573,13 @@ QString QFileInfo::canonicalFilePath() const
QString QFileInfo::absolutePath() const
{
Q_D(const QFileInfo);
- if (d->data->fileName.isEmpty())
+
+ if (!d->data->fileEngine) {
+ return QLatin1String("");
+ } else if (d->data->fileName.isEmpty()) {
qWarning("QFileInfo::absolutePath: Constructed with empty filename");
- if(!d->data->fileEngine)
return QLatin1String("");
+ }
return d->getFileName(QAbstractFileEngine::AbsolutePathName);
}
diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp
index 30892f2..d1b2e3f 100644
--- a/src/gui/dialogs/qmessagebox.cpp
+++ b/src/gui/dialogs/qmessagebox.cpp
@@ -58,6 +58,7 @@
#include <QtGui/qtextdocument.h>
#include <QtGui/qapplication.h>
#include <QtGui/qtextedit.h>
+#include <QtGui/qtextbrowser.h>
#include <QtGui/qmenu.h>
#include "qdialog_p.h"
#include <QtGui/qfont.h>
@@ -188,8 +189,8 @@ public:
bool autoAddOkButton;
QAbstractButton *detectedEscapeButton;
QLabel *informativeLabel;
-#ifdef Q_OS_SYMBIAN
- QTextEdit *textEdit;
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
+ QTextBrowser *textBrowser;
#endif
QPointer<QObject> receiverToDisconnectOnClose;
QByteArray memberToDisconnectOnClose;
@@ -2462,12 +2463,12 @@ void QMessageBox::setInformativeText(const QString &text)
#endif
label->setWordWrap(true);
QGridLayout *grid = static_cast<QGridLayout *>(layout());
-#ifdef Q_OS_SYMBIAN
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
label->hide();
- QTextEdit *textEdit = new QTextEdit(this);
- textEdit->setReadOnly(true);
- grid->addWidget(textEdit, 1, 1, 1, 1);
- d->textEdit = textEdit;
+ QTextBrowser *textBrowser = new QTextBrowser(this);
+ textBrowser->setOpenExternalLinks(true);
+ grid->addWidget(textBrowser, 1, 1, 1, 1);
+ d->textBrowser = textBrowser;
#else
grid->addWidget(label, 1, 1, 1, 1);
#endif
@@ -2475,9 +2476,9 @@ void QMessageBox::setInformativeText(const QString &text)
}
d->informativeLabel->setText(text);
-#ifdef Q_OS_SYMBIAN
- //We need to put the informative label inside textEdit to enable scrolling of long texts.
- d->textEdit->setText(d->informativeLabel->text());
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
+ //We need to put the informative label inside textBrowser to enable scrolling of long texts.
+ d->textBrowser->setText(d->informativeLabel->text());
#endif
d->updateSize();
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 23818b2..ca0b8c7 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -343,7 +343,8 @@ bool QS60StylePrivate::drawsOwnThemeBackground(const QWidget *widget)
}
QFont QS60StylePrivate::s60Font(
- QS60StyleEnums::FontCategories fontCategory, int pointSize) const
+ QS60StyleEnums::FontCategories fontCategory,
+ int pointSize, bool resolveFontSize) const
{
QFont result;
int actualPointSize = pointSize;
@@ -356,7 +357,7 @@ QFont QS60StylePrivate::s60Font(
Q_ASSERT(actualPointSize > 0);
const QPair<QS60StyleEnums::FontCategories, int> key(fontCategory, actualPointSize);
if (!m_mappedFontsCache.contains(key)) {
- result = s60Font_specific(fontCategory, actualPointSize);
+ result = s60Font_specific(fontCategory, actualPointSize, resolveFontSize);
m_mappedFontsCache.insert(key, result);
} else {
result = m_mappedFontsCache.value(key);
@@ -620,8 +621,10 @@ void QS60StylePrivate::setFont(QWidget *widget) const
fontCategory = QS60StyleEnums::FC_Title;
}
if (fontCategory != QS60StyleEnums::FC_Undefined) {
+ const bool resolveFontSize = widget->testAttribute(Qt::WA_SetFont)
+ && (widget->font().resolve() & QFont::SizeResolved);
const QFont suggestedFont =
- s60Font(fontCategory, widget->font().pointSizeF());
+ s60Font(fontCategory, widget->font().pointSizeF(), resolveFontSize);
widget->setFont(suggestedFont);
}
}
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index 11137a4..1417552 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -401,7 +401,7 @@ public:
static bool drawsOwnThemeBackground(const QWidget *widget);
QFont s60Font(QS60StyleEnums::FontCategories fontCategory,
- int pointSize = -1) const;
+ int pointSize = -1, bool resolveFontSize = true) const;
// clears all style caches (fonts, colors, pixmaps)
void clearCaches(CacheClearReason reason = CC_UndefinedChange);
@@ -484,7 +484,8 @@ private:
static QPixmap part(QS60StyleEnums::SkinParts part, const QSize &size,
QPainter *painter, SkinElementFlags flags = KDefaultSkinElementFlags);
- static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize);
+ static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory,
+ int pointSize, bool resolveFontSize);
static QSize screenSize();
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 4767264..be61073 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -909,8 +909,11 @@ TAknsItemID QS60StyleModeSpecifics::partSpecificThemeId(int part)
}
QFont QS60StylePrivate::s60Font_specific(
- QS60StyleEnums::FontCategories fontCategory, int pointSize)
+ QS60StyleEnums::FontCategories fontCategory,
+ int pointSize, bool resolveFontSize)
{
+ Q_UNUSED(resolveFontSize);
+
TAknFontCategory aknFontCategory = EAknFontCategoryUndefined;
switch (fontCategory) {
case QS60StyleEnums::FC_Primary:
diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp
index 4499f06..bd43eb7 100644
--- a/src/gui/styles/qs60style_simulated.cpp
+++ b/src/gui/styles/qs60style_simulated.cpp
@@ -342,10 +342,13 @@ bool QS60StylePrivate::hasSliderGrooveGraphic()
return false;
}
-QFont QS60StylePrivate::s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize)
+QFont QS60StylePrivate::s60Font_specific(
+ QS60StyleEnums::FontCategories fontCategory,
+ int pointSize, bool resolveFontSize)
{
QFont result;
- result.setPointSize(pointSize);
+ if (resolveFontSize)
+ result.setPointSize(pointSize);
switch (fontCategory) {
case QS60StyleEnums::FC_Primary:
result.setBold(true);
diff --git a/src/gui/widgets/qstackedwidget.cpp b/src/gui/widgets/qstackedwidget.cpp
index 396e233..2509a21 100644
--- a/src/gui/widgets/qstackedwidget.cpp
+++ b/src/gui/widgets/qstackedwidget.cpp
@@ -186,8 +186,11 @@ int QStackedWidget::insertWidget(int index, QWidget *widget)
}
/*!
- Removes the given \a widget from the QStackedWidget. The widget
- is \e not deleted.
+ Removes the given \a widget from the QStackedWidget.
+
+ \bold{Note:} The ownership of \a widget remains the same.
+ The widget is \e not deleted, but simply removed from the widget's
+ stacked layout, causing it to be hidden.
\sa addWidget(), insertWidget(), currentWidget()
*/
diff --git a/src/multimedia/audio/qaudioinput.cpp b/src/multimedia/audio/qaudioinput.cpp
index 6fc4284..da39c4a 100644
--- a/src/multimedia/audio/qaudioinput.cpp
+++ b/src/multimedia/audio/qaudioinput.cpp
@@ -103,7 +103,7 @@ QT_BEGIN_NAMESPACE
audio = new QAudioInput(format, this);
QTimer::singleShot(3000, this, SLOT(stopRecording()));
- audio->start(outputFile);
+ audio->start(&outputFile);
// Records audio for 3000ms
}
\endcode
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index 5615685..8e22664 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -83,9 +83,6 @@ public:
QList<QSslError> ignoreErrorsList;
bool* readyReadEmittedPointer;
- QRingBuffer readBuffer;
- QRingBuffer writeBuffer;
-
QSslConfigurationPrivate configuration;
QList<QSslError> sslErrors;
diff --git a/tests/auto/linguist/lupdate/.gitignore b/tests/auto/linguist/lupdate/.gitignore
index 4ba5b79..389f2dc 100644
--- a/tests/auto/linguist/lupdate/.gitignore
+++ b/tests/auto/linguist/lupdate/.gitignore
@@ -1,4 +1,4 @@
tst_lupdate
testdata/good/*/project.ts
-testdata/output_ts/toplevel/library/tools/translations/project.ts
+testdata/good/*/*/project.ts
testdata/recursivescan/*.ts
diff --git a/tests/auto/linguist/lupdate/lupdate.pro b/tests/auto/linguist/lupdate/lupdate.pro
index 19259dc..bcaaf66 100644
--- a/tests/auto/linguist/lupdate/lupdate.pro
+++ b/tests/auto/linguist/lupdate/lupdate.pro
@@ -2,6 +2,5 @@ CONFIG += qttest_p4
TARGET = tst_lupdate
-HEADERS += testlupdate.h
-SOURCES += tst_lupdate.cpp testlupdate.cpp
+SOURCES += tst_lupdate.cpp
diff --git a/tests/auto/linguist/lupdate/testdata/good/backslashes/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/backslashes/lupdatecmd
index 9b83a04..f0e1ab2 100644
--- a/tests/auto/linguist/lupdate/testdata/good/backslashes/lupdatecmd
+++ b/tests/auto/linguist/lupdate/testdata/good/backslashes/lupdatecmd
@@ -1,3 +1 @@
-# Add the command that lupdate should run here. If it can't find anything it will default to
TRANSLATION: ts\project.ts
-lupdate -silent project.pro
diff --git a/tests/auto/linguist/lupdate/testdata/good/backslashes/project.pro b/tests/auto/linguist/lupdate/testdata/good/backslashes/project.pro
index 3584c89..4698b2b 100644
--- a/tests/auto/linguist/lupdate/testdata/good/backslashes/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/backslashes/project.pro
@@ -1,19 +1,3 @@
-######################################################################
-# Automatically generated by qmake (2.01a) ma 22. jan 10:10:16 2007
-######################################################################
-
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
SOURCES += src\main.cpp
TRANSLATIONS = ts\project.ts
-
-
-!exists(ts) {
- win32: system(md ts)
- else: system(mkdir ts)
-}
diff --git a/tests/auto/linguist/lupdate/testdata/good/backslashes/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/backslashes/ts/project.ts.result
index d3a5fdf..d3a5fdf 100644
--- a/tests/auto/linguist/lupdate/testdata/good/backslashes/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/backslashes/ts/project.ts.result
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.pro b/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.pro
index 848ebda..7225608 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.pro
@@ -1,20 +1,7 @@
-TEMPLATE = app
-TARGET +=
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
SOURCES += main.cpp
+CONFIG+= console
TRANSLATIONS = project.ts
-CONFIG+= console
CODECFORTR = utf-8
CODECFORSRC = utf-8
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm $$TRANSLATIONS)
-}
-
-
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.pro b/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.pro
index 81273ee..64f3c85 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.pro
@@ -1,19 +1,6 @@
-TEMPLATE = app
-TARGET +=
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
SOURCES += main.cpp
+CONFIG+= console
TRANSLATIONS = project.ts
-CONFIG+= console
CODECFORTR = CP1251
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm $$TRANSLATIONS)
-}
-
-
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.pro b/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.pro
index 1d5b071..d5697eb 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.pro
@@ -1,15 +1,6 @@
-TEMPLATE = app
-
SOURCES += main.cpp
+CONFIG += console
TRANSLATIONS = project.ts
-CONFIG += console
CODECFORTR = CP1252
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm $$TRANSLATIONS)
-}
-
-
diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.pro b/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.pro
index f4975f2..c95939c 100644
--- a/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.pro
@@ -1,16 +1,7 @@
-TEMPLATE = app
-
SOURCES += main.cpp
+CONFIG += console
TRANSLATIONS = project.ts
-CONFIG += console
CODECFORSRC = CP1252
CODECFORTR = UTF-8
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm $$TRANSLATIONS)
-}
-
-
diff --git a/tests/auto/linguist/lupdate/testdata/good/heuristics/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/heuristics/expectedoutput.txt
new file mode 100644
index 0000000..093610d
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/heuristics/expectedoutput.txt
@@ -0,0 +1,6 @@
+*.*Function 'eval' is not implemented
+Updating 'project\.ts'\.\.\.
+ Found 3 source text\(s\) \(3 new and 0 already existing\)
+ Removed 5 obsolete entries
+ Number heuristic provided 1 translation\(s\)
+ Same-text heuristic provided 1 translation\(s\)
diff --git a/tests/auto/linguist/lupdate/testdata/good/heuristics/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/heuristics/lupdatecmd
new file mode 100644
index 0000000..6bda261
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/heuristics/lupdatecmd
@@ -0,0 +1,2 @@
+TRANSLATION: project.ts
+lupdate -verbose -disable-heuristic similartext -no-obsolete project.pro
diff --git a/tests/auto/linguist/lupdate/testlupdate.h b/tests/auto/linguist/lupdate/testdata/good/heuristics/main.cpp
index 0b67057..542c228 100644
--- a/tests/auto/linguist/lupdate/testlupdate.h
+++ b/tests/auto/linguist/lupdate/testdata/good/heuristics/main.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the Qt Linguist of the Qt Toolkit.
+** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -39,49 +39,24 @@
**
****************************************************************************/
-#ifndef TESTLUPDATE_H
-#define TESTLUPDATE_H
+// IMPORTANT!!!! If you want to add testdata to this file,
+// always add it to the end in order to not change the linenumbers of translations!!!
-#include <QObject>
-#include <QProcess>
-#include <QStringList>
+#define QTCORE <QtCore>
+#include QTCORE // Hidden from lupdate, but compiles
-class TestLUpdate : public QObject
-{
+class A: public QObject {
Q_OBJECT
+ void foo()
+ {
+ // number Heuristics
+ tr("version 2.0 now");
-public:
- TestLUpdate();
- virtual ~TestLUpdate();
+ // same text match
+ tr("this is the matched same text");
- void setWorkingDirectory( const QString &workDir);
- bool run( const QString &commandline);
- bool updateProFile( const QString &arguments);
- bool qmake();
- QStringList getErrorMessages() {
- return make_result;
+ // failed same text
+ tr("this is the non-matched same text");
}
- void clearResult() {
- make_result.clear();
- }
-private:
- QString m_cmdLupdate;
- QString m_cmdQMake;
- QString m_workDir;
- QProcess *childProc;
- QStringList env_list;
- QStringList make_result;
-
- bool child_show;
- bool qws_mode;
- bool exit_ok;
-
- bool runChild( bool showOutput, const QString &program, const QStringList &argList = QStringList());
- void addMakeResult( const QString &result );
- void childHasData();
-
-private slots:
- void childReady(int exitCode);
};
-#endif // TESTLUPDATE_H
diff --git a/tests/auto/linguist/lupdate/testdata/good/heuristics/project.pro b/tests/auto/linguist/lupdate/testdata/good/heuristics/project.pro
new file mode 100644
index 0000000..759bea0
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/heuristics/project.pro
@@ -0,0 +1,3 @@
+SOURCES = main.cpp
+
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/heuristics/project.ts.before b/tests/auto/linguist/lupdate/testdata/good/heuristics/project.ts.before
new file mode 100644
index 0000000..ce82810
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/heuristics/project.ts.before
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>A</name>
+ <message>
+ <location filename="main.cpp" line="53"/>
+ <source>version 1.0 now</source>
+ <translation>teraz wersja 1.0</translation>
+ </message>
+</context>
+<context>
+ <name>B</name>
+ <message>
+ <location filename="main.cpp" line="56"/>
+ <source>this is the matched same text</source>
+ <translation>der same-text-treffer</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="59"/>
+ <source>this is the non-matched same text</source>
+ <translation>same-text-reinfall variante eins</translation>
+ </message>
+</context>
+<context>
+ <name>C</name>
+ <message>
+ <location filename="main.cpp" line="56"/>
+ <source>this is the matched same text</source>
+ <translation>der same-text-treffer</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="59"/>
+ <source>this is the non-matched same text</source>
+ <translation>völlig andere variante des reinfalls mit same-text</translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/heuristics/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/heuristics/project.ts.result
new file mode 100644
index 0000000..402ad9a
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/heuristics/project.ts.result
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>A</name>
+ <message>
+ <location filename="main.cpp" line="53"/>
+ <source>version 2.0 now</source>
+ <translation type="unfinished">teraz wersja 1.0 {2.0 ?}</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="56"/>
+ <source>this is the matched same text</source>
+ <translation type="unfinished">der same-text-treffer</translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="59"/>
+ <source>this is the non-matched same text</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.pro b/tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.pro
index 7547a8d..759bea0 100644
--- a/tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.pro
@@ -1,12 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
SOURCES = main.cpp
-TRANSLATIONS += project.ts
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm $$TRANSLATIONS)
-}
-
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_ordering/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/lupdatecmd
index 91a4800..82b4b0d 100644
--- a/tests/auto/linguist/lupdate/testdata/good/merge_ordering/lupdatecmd
+++ b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/lupdatecmd
@@ -1,5 +1 @@
-# Add the command that lupdate should run here. If it can't find anything it will default to
-# 'lupdate project.pro -ts project.ts'
-
-# lupdate project.pro
-lupdate -silent -locations relative project.pro
+lupdate -locations relative project.pro
diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.pro b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.pro
index e79456f..6149858 100644
--- a/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.pro
@@ -1,14 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
SOURCES += foo.cpp
-TRANSLATIONS = project.ts
-
-# Copy the ts to a temp file because:
-# 1. The depot file is usually read-only
-# 2. We don't want to modify the original file, since then it won't be possible to run the test twice
-# without reverting the original file again.
-
-win32: system(copy /Y project.ts.before $$TRANSLATIONS)
-unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS)
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_versions/project.pro b/tests/auto/linguist/lupdate/testdata/good/merge_versions/project.pro
index 6c704c2..fa56972 100644
--- a/tests/auto/linguist/lupdate/testdata/good/merge_versions/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/merge_versions/project.pro
@@ -1,14 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
FORMS += project.ui
-TRANSLATIONS = project.ts
-
-# Copy the ts to a temp file because:
-# 1. The depot file is usually read-only
-# 2. We don't want to modify the original file, since then it won't be possible to run the test twice
-# without reverting the original file again.
-
-win32: system(copy /Y project.ts.before $$TRANSLATIONS)
-unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS)
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.pro b/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.pro
index f4faf2f..759bea0 100644
--- a/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.pro
@@ -1,14 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
SOURCES = main.cpp
-TRANSLATIONS = project.ts
-
-# Copy the ts to a temp file because:
-# 1. The depot file is usually read-only
-# 2. We don't want to modify the original file, since then it won't be possible to run the test twice
-# without reverting the original file again.
-
-win32: system(copy /Y project.ts.before $$TRANSLATIONS)
-unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS)
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp/project.pro b/tests/auto/linguist/lupdate/testdata/good/mergecpp/project.pro
index e988c0a..63f5d66 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergecpp/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp/project.pro
@@ -1,14 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
SOURCES += finddialog.cpp
-TRANSLATIONS = project.ts
-
-# Copy the ts to a temp file because:
-# 1. The depot file is usually read-only
-# 2. We don't want to modify the original file, since then it won't be possible to run the test twice
-# without reverting the original file again.
-
-win32: system(copy /Y project.ts.before $$TRANSLATIONS)
-unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS)
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/lupdatecmd
index d200143..500a822 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/lupdatecmd
+++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/lupdatecmd
@@ -1,5 +1 @@
-# Add the command that lupdate should run here. If it can't find anything it will default to
-# 'lupdate project.pro -ts project.ts'
-
-# lupdate project.pro
-lupdate -silent -noobsolete project.pro
+lupdate -noobsolete project.pro
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.pro b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.pro
index e988c0a..63f5d66 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.pro
@@ -1,14 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
SOURCES += finddialog.cpp
-TRANSLATIONS = project.ts
-
-# Copy the ts to a temp file because:
-# 1. The depot file is usually read-only
-# 2. We don't want to modify the original file, since then it won't be possible to run the test twice
-# without reverting the original file again.
-
-win32: system(copy /Y project.ts.before $$TRANSLATIONS)
-unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS)
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.pro b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.pro
index e988c0a..63f5d66 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.pro
@@ -1,14 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
SOURCES += finddialog.cpp
-TRANSLATIONS = project.ts
-
-# Copy the ts to a temp file because:
-# 1. The depot file is usually read-only
-# 2. We don't want to modify the original file, since then it won't be possible to run the test twice
-# without reverting the original file again.
-
-win32: system(copy /Y project.ts.before $$TRANSLATIONS)
-unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS)
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.pro b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.pro
index 28ba291..fa56972 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.pro
@@ -1,14 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
FORMS += project.ui
-TRANSLATIONS = project.ts
-
-# Copy the ts to a temp file because:
-# 1. The depot file is usually read-only
-# 2. We don't want to modify the original file, since then it won't be possible to run the test twice
-# without reverting the original file again.
-
-win32: system(copy /Y project.ts.before $$TRANSLATIONS)
-unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS)
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui_obsolete/project.pro b/tests/auto/linguist/lupdate/testdata/good/mergeui_obsolete/project.pro
index 28ba291..fa56972 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergeui_obsolete/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/mergeui_obsolete/project.pro
@@ -1,14 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
FORMS += project.ui
-TRANSLATIONS = project.ts
-
-# Copy the ts to a temp file because:
-# 1. The depot file is usually read-only
-# 2. We don't want to modify the original file, since then it won't be possible to run the test twice
-# without reverting the original file again.
-
-win32: system(copy /Y project.ts.before $$TRANSLATIONS)
-unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS)
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/multiple_locations/project.pro b/tests/auto/linguist/lupdate/testdata/good/multiple_locations/project.pro
index 4582705..bbabdfb 100644
--- a/tests/auto/linguist/lupdate/testdata/good/multiple_locations/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/multiple_locations/project.pro
@@ -1,13 +1,4 @@
-TEMPLATE = app
-LANGUAGE = C++
-
SOURCES += main.cpp
SOURCES += finddialog.cpp
-TRANSLATIONS += project.ts
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm $$TRANSLATIONS)
-}
-
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/namespaces/project.pro b/tests/auto/linguist/lupdate/testdata/good/namespaces/project.pro
index 56d472c..c96859b 100644
--- a/tests/auto/linguist/lupdate/testdata/good/namespaces/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/namespaces/project.pro
@@ -1,12 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
SOURCES += main.cpp
-TRANSLATIONS += project.ts
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm $$TRANSLATIONS)
-}
-
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/parse_special_chars/project.pro b/tests/auto/linguist/lupdate/testdata/good/parse_special_chars/project.pro
index cb18ea4..c96859b 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parse_special_chars/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/parse_special_chars/project.pro
@@ -1,12 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
SOURCES += main.cpp
-TRANSLATIONS += project.ts
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm $$TRANSLATIONS)
-}
-
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecontexts/project.pro b/tests/auto/linguist/lupdate/testdata/good/parsecontexts/project.pro
index 7547a8d..759bea0 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecontexts/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecontexts/project.pro
@@ -1,12 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
SOURCES = main.cpp
-TRANSLATIONS += project.ts
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm $$TRANSLATIONS)
-}
-
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.pro b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.pro
index 4582705..bbabdfb 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.pro
@@ -1,13 +1,4 @@
-TEMPLATE = app
-LANGUAGE = C++
-
SOURCES += main.cpp
SOURCES += finddialog.cpp
-TRANSLATIONS += project.ts
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm $$TRANSLATIONS)
-}
-
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt
index 8d057d8..e3543c9 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt
@@ -5,3 +5,4 @@
.*/lupdate/testdata/good/parsecpp2/main.cpp:61: Excess closing brace .*
.*/lupdate/testdata/good/parsecpp2/main.cpp:65: Excess closing brace .*
+
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.pro b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.pro
index 7547a8d..759bea0 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.pro
@@ -1,12 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
SOURCES = main.cpp
-TRANSLATIONS += project.ts
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm $$TRANSLATIONS)
-}
-
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsejava/project.pro b/tests/auto/linguist/lupdate/testdata/good/parsejava/project.pro
index 7e64c80..657b535 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsejava/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/parsejava/project.pro
@@ -1,12 +1,3 @@
-TEMPLATE = app
-LANGUAGE = Java
-
SOURCES += main.java
-TRANSLATIONS += project.ts
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm $$TRANSLATIONS)
-}
-
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/parseui/project.pro b/tests/auto/linguist/lupdate/testdata/good/parseui/project.pro
index bdc06e7..fa56972 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parseui/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/parseui/project.pro
@@ -1,13 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
FORMS += project.ui
-TRANSLATIONS = project.ts
-
-exists( $$TRANSLATIONS ) {
- win32 : system(del $$TRANSLATIONS)
- unix : system(rm $$TRANSLATIONS)
-}
-
-
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/prefix/project.pro b/tests/auto/linguist/lupdate/testdata/good/prefix/project.pro
index 7547a8d..759bea0 100644
--- a/tests/auto/linguist/lupdate/testdata/good/prefix/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/prefix/project.pro
@@ -1,12 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
SOURCES = main.cpp
-TRANSLATIONS += project.ts
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm $$TRANSLATIONS)
-}
-
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/preprocess/project.pro b/tests/auto/linguist/lupdate/testdata/good/preprocess/project.pro
index 012c7e0..c96859b 100644
--- a/tests/auto/linguist/lupdate/testdata/good/preprocess/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/preprocess/project.pro
@@ -1,12 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
SOURCES += main.cpp
-TRANSLATIONS += project.ts
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm -f $$TRANSLATIONS)
-}
-
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsing/project.pro b/tests/auto/linguist/lupdate/testdata/good/proparsing/project.pro
index 3078817..0e920f9 100644
--- a/tests/auto/linguist/lupdate/testdata/good/proparsing/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsing/project.pro
@@ -1,6 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
# Try to reference a variable that does not exist:
MYVAR=$$THIS_VARIABLE_IS_NOT_DEFINED
@@ -31,10 +28,4 @@ if (exists($$member($$(PATH), 0))) {
SOURCES += main_dependpath.cpp
}
-TRANSLATIONS += project.ts
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm -f $$TRANSLATIONS)
-}
-
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsing2/project.pro b/tests/auto/linguist/lupdate/testdata/good/proparsing2/project.pro
index 1d6895a..3dc4208 100644
--- a/tests/auto/linguist/lupdate/testdata/good/proparsing2/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsing2/project.pro
@@ -3,9 +3,6 @@
# It also tries to verify the behaviour of combining quoted and non-quoted elements with literals.
#
-TEMPLATE = app
-LANGUAGE = C++
-
QUOTED = $$quote(variable with spaces)
VERSIONAB = "a.b"
VAB = $$split(VERSIONAB, ".")
@@ -33,10 +30,4 @@ SOURCES += $$Q3
win32: SOURCES += $$system(type files-cc.txt)
unix: SOURCES += $$system(cat files-cc.txt)
-TRANSLATIONS += project.ts
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm $$TRANSLATIONS)
-}
-
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.pro
index 820b4fa..6bfe751 100644
--- a/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.pro
@@ -3,8 +3,3 @@ SOURCES += file*.cpp filter.cpp non-existing.cpp
include(sub/sub.pri)
TRANSLATIONS = project.ts
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm -f $$TRANSLATIONS)
-}
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingpri/project.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingpri/project.pro
index 3810a02..5e23538 100644
--- a/tests/auto/linguist/lupdate/testdata/good/proparsingpri/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingpri/project.pro
@@ -1,6 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
include(win/win.pri)
include(mac/mac.pri)
include(unix/unix.pri)
@@ -8,9 +5,5 @@ include (common/common.pri) # Important: keep the space before the '
include(relativity/relativity.pri)
message($$SOURCES)
-TRANSLATIONS = project.ts
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm $$TRANSLATIONS)
-}
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/project.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/project.pro
index 4de6622..88f2435 100644
--- a/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/project.pro
@@ -1,3 +1,2 @@
-TEMPLATE =subdirs
-
-SUBDIRS = sub1
+TEMPLATE = subdirs
+SUBDIRS = sub1
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/sub1/sub1.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/sub1/sub1.pro
index 1d50c2b..df18c5a 100644
--- a/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/sub1/sub1.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/sub1/sub1.pro
@@ -1,12 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
SOURCES += main.cpp
-TRANSLATIONS += ../project.ts
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm -f $$TRANSLATIONS)
-}
-
+TRANSLATIONS = ../project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/common/common.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/common/common.pro
index a8b3106..3f6c643 100644
--- a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/common/common.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/common/common.pro
@@ -1,5 +1,2 @@
-TEMPLATE = app
-LANGUAGE = C++
-
-SOURCES += main.cpp
+SOURCES += main.cpp
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/lupdatecmd
new file mode 100644
index 0000000..b7e12cc
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/lupdatecmd
@@ -0,0 +1 @@
+lupdate project.pro -ts project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/mac/mac.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/mac/mac.pro
index 87478bf..a1863b6 100644
--- a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/mac/mac.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/mac/mac.pro
@@ -1,5 +1 @@
-TEMPLATE = app
-LANGUAGE = C++
-
-SOURCES += main_mac.cpp
-
+SOURCES += main_mac.cpp
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/project.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/project.pro
index 668ecf4..f75a462 100644
--- a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/project.pro
@@ -1,7 +1,2 @@
TEMPLATE = subdirs
SUBDIRS = win mac unix common
-
-exists( project.ts ) {
- win32: system(del project.ts)
- unix: system(rm project.ts)
-}
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/unix/unix.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/unix/unix.pro
index d0ebec7..71b1a22 100644
--- a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/unix/unix.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/unix/unix.pro
@@ -1,5 +1 @@
-TEMPLATE = app
-LANGUAGE = C++
-
-SOURCES += main_unix.cpp
-
+SOURCES += main_unix.cpp
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/win/win.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/win/win.pro
index a9a9751..afd7197 100644
--- a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/win/win.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/win/win.pro
@@ -1,5 +1 @@
-TEMPLATE = app
-LANGUAGE = C++
-
-SOURCES += main_win.cpp
-
+SOURCES += main_win.cpp
diff --git a/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd
new file mode 100644
index 0000000..da6103f
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd
@@ -0,0 +1,2 @@
+TRANSLATION: translations/project.ts
+lupdate project.pro -ts translations/project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/main.cpp b/tests/auto/linguist/lupdate/testdata/good/reloutput/main.cpp
index 257b240..257b240 100644
--- a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/reloutput/main.cpp
diff --git a/tests/auto/linguist/lupdate/testdata/good/reloutput/project.pro b/tests/auto/linguist/lupdate/testdata/good/reloutput/project.pro
new file mode 100644
index 0000000..4e2e6ad
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/reloutput/project.pro
@@ -0,0 +1,3 @@
+SOURCES += main.cpp
+
+TRANSLATIONS = translations/project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/output_ts/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/reloutput/translations/project.ts.result
index e398701..e398701 100644
--- a/tests/auto/linguist/lupdate/testdata/output_ts/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/reloutput/translations/project.ts.result
diff --git a/tests/auto/linguist/lupdate/testdata/good/textsimilarity/project.pro b/tests/auto/linguist/lupdate/testdata/good/textsimilarity/project.pro
index 28ba291..fa56972 100644
--- a/tests/auto/linguist/lupdate/testdata/good/textsimilarity/project.pro
+++ b/tests/auto/linguist/lupdate/testdata/good/textsimilarity/project.pro
@@ -1,14 +1,3 @@
-TEMPLATE = app
-LANGUAGE = C++
-
FORMS += project.ui
-TRANSLATIONS = project.ts
-
-# Copy the ts to a temp file because:
-# 1. The depot file is usually read-only
-# 2. We don't want to modify the original file, since then it won't be possible to run the test twice
-# without reverting the original file again.
-
-win32: system(copy /Y project.ts.before $$TRANSLATIONS)
-unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS)
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/output_ts/lupdatecmd b/tests/auto/linguist/lupdate/testdata/output_ts/lupdatecmd
deleted file mode 100644
index 80319de..0000000
--- a/tests/auto/linguist/lupdate/testdata/output_ts/lupdatecmd
+++ /dev/null
@@ -1,5 +0,0 @@
-# Add the command that lupdate should run here. If it can't find anything it will default to
-# 'lupdate project.pro -ts project.ts'
-
-# lupdate project.pro
-lupdate toplevel/library/tools/tools.pro
diff --git a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/tools.pro b/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/tools.pro
deleted file mode 100644
index ec6c01d..0000000
--- a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/tools.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-TEMPLATE = app
-LANGUAGE = C++
-
-SOURCES += main.cpp
-
-TRANSLATIONS += translations/project.ts
-
-exists( $$TRANSLATIONS ) {
- win32: system(del $$TRANSLATIONS)
- unix: system(rm -f $$TRANSLATIONS)
-}
-
diff --git a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/translations/readme.txt b/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/translations/readme.txt
deleted file mode 100644
index 83adcd2..0000000
--- a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/translations/readme.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This is just a dummy file so that GIT creates this folder
-
diff --git a/tests/auto/linguist/lupdate/testlupdate.cpp b/tests/auto/linguist/lupdate/testlupdate.cpp
deleted file mode 100644
index 9e23a54..0000000
--- a/tests/auto/linguist/lupdate/testlupdate.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Linguist 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 Technology Preview License Agreement accompanying
-** this package.
-**
-** 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.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "testlupdate.h"
-#include <stdlib.h>
-#include <QtGui/QApplication>
-#include <QtCore/QProcess>
-#include <QtCore/QTimer>
-#include <QtCore/QDir>
-
-#ifdef Q_OS_WIN32
-# include <windows.h>
-#endif
-
-#include <QtTest/QtTest>
-
-
-TestLUpdate::TestLUpdate()
-{
- childProc = 0;
- QString binPath = QLibraryInfo::location(QLibraryInfo::BinariesPath);
- m_cmdLupdate = binPath + QLatin1String("/lupdate");
- m_cmdQMake = binPath + QLatin1String("/qmake");
-}
-
-TestLUpdate::~TestLUpdate()
-{
- if (childProc)
- delete childProc;
-}
-
-void TestLUpdate::setWorkingDirectory(const QString &workDir)
-{
- m_workDir = workDir;
- QDir::setCurrent(m_workDir);
-}
-
-void TestLUpdate::addMakeResult( const QString &result )
-{
- make_result.append( result );
-}
-
-bool TestLUpdate::runChild( bool showOutput, const QString &program, const QStringList &argList)
-{
- make_result.clear();
- exit_ok = FALSE;
- if (childProc)
- delete childProc;
-
- child_show = showOutput;
- if ( showOutput ) {
- QString S = argList.join(" ");
- addMakeResult( program + QLatin1String(" ") + S );
- }
-
- childProc = new QProcess();
- Q_ASSERT(childProc);
-
- childProc->setWorkingDirectory(m_workDir);
- connect(childProc, SIGNAL(finished(int)), this, SLOT(childReady(int)));
- childProc->setProcessChannelMode(QProcess::MergedChannels);
- if (argList.isEmpty()) {
- childProc->start( program, QIODevice::ReadWrite | QIODevice::Text );
- } else {
- childProc->start( program, argList, QIODevice::ReadWrite | QIODevice::Text );
- }
- bool ok;
-
- ok = childProc->waitForStarted();
-
- if (ok)
- ok = childProc->waitForFinished();
-
- if (!ok)
- addMakeResult( "Error executing '" + program + "'." );
-
- childReady(ok ? 0 : -1);
-
- return ok;
-}
-
-void TestLUpdate::childReady(int /*exitCode*/)
-{
- if (childProc != 0) {
- childHasData();
- exit_ok = childProc->state() == QProcess::NotRunning
- && childProc->exitStatus() == 0;
- childProc->deleteLater();
- }
- childProc = 0;
-}
-
-void TestLUpdate::childHasData()
-{
- //QByteArray ba = childProc->readAllStandardError();
- //qDebug() << "ERROR:" << ba;
- QString stdoutput = childProc->readAllStandardOutput();
- stdoutput = stdoutput.replace("\t", " ");
- if (child_show)
- addMakeResult(stdoutput);
-}
-
-bool TestLUpdate::run(const QString &commandline)
-{
- return runChild(true, m_cmdLupdate + QLatin1String(" ") + commandline);
-}
-
-
-bool TestLUpdate::updateProFile(const QString &arguments)
-{
- QStringList args = arguments.split(QChar(' '));
- return runChild( true, m_cmdLupdate, args );
-}
-
-bool TestLUpdate::qmake()
-{
- QStringList args;
- args << "-r";
- return runChild(true, m_cmdQMake, args);
-}
diff --git a/tests/auto/linguist/lupdate/tst_lupdate.cpp b/tests/auto/linguist/lupdate/tst_lupdate.cpp
index 0776914..568be37 100644
--- a/tests/auto/linguist/lupdate/tst_lupdate.cpp
+++ b/tests/auto/linguist/lupdate/tst_lupdate.cpp
@@ -39,7 +39,6 @@
**
****************************************************************************/
-#include "testlupdate.h"
#if CHECK_SIMTEXTH
#include "../shared/simtexth.h"
#endif
@@ -55,12 +54,11 @@ class tst_lupdate : public QObject
{
Q_OBJECT
public:
- tst_lupdate() { m_basePath = QDir::currentPath() + QLatin1String("/testdata/"); }
+ tst_lupdate();
private slots:
void good_data();
void good();
- void output_ts();
void commandline_data();
void commandline();
#if CHECK_SIMTEXTH
@@ -69,7 +67,7 @@ private slots:
#endif
private:
- TestLUpdate m_lupdate;
+ QString m_cmdLupdate;
QString m_basePath;
void doCompare(const QStringList &actual, const QString &expectedFn, bool err);
@@ -77,72 +75,149 @@ private:
};
+tst_lupdate::tst_lupdate()
+{
+ QString binPath = QLibraryInfo::location(QLibraryInfo::BinariesPath);
+ m_cmdLupdate = binPath + QLatin1String("/lupdate");
+ m_basePath = QDir::currentPath() + QLatin1String("/testdata/");
+}
+
+static bool prepareMatch(const QString &expect, QString *tmpl, int *require, int *accept)
+{
+ if (expect.startsWith(QLatin1Char('\\'))) {
+ *tmpl = expect.mid(1);
+ *require = *accept = 1;
+ } else if (expect.startsWith(QLatin1Char('?'))) {
+ *tmpl = expect.mid(1);
+ *require = 0;
+ *accept = 1;
+ } else if (expect.startsWith(QLatin1Char('*'))) {
+ *tmpl = expect.mid(1);
+ *require = 0;
+ *accept = INT_MAX;
+ } else if (expect.startsWith(QLatin1Char('+'))) {
+ *tmpl = expect.mid(1);
+ *require = 1;
+ *accept = INT_MAX;
+ } else if (expect.startsWith(QLatin1Char('{'))) {
+ int brc = expect.indexOf(QLatin1Char('}'), 1);
+ if (brc < 0)
+ return false;
+ *tmpl = expect.mid(brc + 1);
+ QString sub = expect.mid(1, brc - 1);
+ int com = sub.indexOf(QLatin1Char(','));
+ bool ok;
+ if (com < 0) {
+ *require = *accept = sub.toInt(&ok);
+ return ok;
+ } else {
+ *require = sub.left(com).toInt();
+ *accept = sub.mid(com + 1).toInt(&ok);
+ if (!ok)
+ *accept = INT_MAX;
+ return *accept >= *require;
+ }
+ } else {
+ *tmpl = expect;
+ *require = *accept = 1;
+ }
+ return true;
+}
+
void tst_lupdate::doCompare(const QStringList &actual, const QString &expectedFn, bool err)
{
QFile file(expectedFn);
- QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text));
- QStringList expected = QString(file.readAll()).trimmed().split('\n');
-
- int i = 0, ei = expected.size(), gi = actual.size();
- for (; ; i++) {
- if (i == gi) {
- if (i == ei)
- return;
- gi = 0;
- break;
- } else if (i == ei) {
- ei = 0;
+ QVERIFY2(file.open(QIODevice::ReadOnly | QIODevice::Text), qPrintable(expectedFn));
+ QStringList expected = QString(file.readAll()).split('\n');
+
+ int ei = 0, ai = 0, em = expected.size(), am = actual.size();
+ int oei = 0, oai = 0, oem = em, oam = am;
+ int require = 0, accept = 0;
+ QString tmpl;
+ forever {
+ if (!accept) {
+ oei = ei, oai = ai;
+ if (ei == em) {
+ if (ai == am)
+ return;
+ break;
+ }
+ if (!prepareMatch(expected.at(ei++), &tmpl, &require, &accept))
+ QFAIL(qPrintable(QString("Malformed expected %1 at %3:%2")
+ .arg(err ? "output" : "result").arg(ei).arg(expectedFn)));
+ }
+ if (ai == am) {
+ if (require <= 0) {
+ accept = 0;
+ continue;
+ }
break;
- } else {
- QString act = actual.at(i);
- act.remove('\r');
- if (err ? !QRegExp(expected.at(i)).exactMatch(act) :
- (act != expected.at(i))) {
- bool cond = true;
- while (cond) {
- act = actual.at(gi - 1);
- act.remove('\r');
- cond = (ei - 1) >= i && (gi - 1) >= i &&
- (err ? QRegExp(expected.at(ei - 1)).exactMatch(act) :
- (act == expected.at(ei - 1)));
- if (cond) {
- ei--, gi--;
+ }
+ if (err ? !QRegExp(tmpl).exactMatch(actual.at(ai)) : (actual.at(ai) != tmpl)) {
+ if (require <= 0) {
+ accept = 0;
+ continue;
+ }
+ ei--;
+ require = accept = 0;
+ forever {
+ if (!accept) {
+ oem = em, oam = am;
+ if (ei == em)
+ break;
+ if (!prepareMatch(expected.at(--em), &tmpl, &require, &accept))
+ QFAIL(qPrintable(QString("Malformed expected %1 at %3:%2")
+ .arg(err ? "output" : "result")
+ .arg(em + 1).arg(expectedFn)));
+ }
+ if (ai == am || (err ? !QRegExp(tmpl).exactMatch(actual.at(am - 1)) :
+ (actual.at(am - 1) != tmpl))) {
+ if (require <= 0) {
+ accept = 0;
+ continue;
}
+ break;
}
- break;
+ accept--;
+ require--;
+ am--;
}
+ break;
}
+ accept--;
+ require--;
+ ai++;
}
QByteArray diff;
- for (int j = qMax(0, i - 3); j < i; j++)
- diff += expected.at(j) + '\n';
+ for (int j = qMax(0, oai - 3); j < oai; j++)
+ diff += actual.at(j) + '\n';
diff += "<<<<<<< got\n";
- for (int j = i; j < gi; j++) {
+ for (int j = oai; j < oam; j++) {
diff += actual.at(j) + '\n';
- if (j >= i + 5) {
+ if (j >= oai + 5) {
diff += "...\n";
break;
}
}
diff += "=========\n";
- for (int j = i; j < ei; j++) {
+ for (int j = oei; j < oem; j++) {
diff += expected.at(j) + '\n';
- if (j >= i + 5) {
+ if (j >= oei + 5) {
diff += "...\n";
break;
}
}
diff += ">>>>>>> expected\n";
- for (int j = ei; j < qMin(ei + 3, expected.size()); j++)
- diff += expected.at(j) + '\n';
+ for (int j = oam; j < qMin(oam + 3, actual.size()); j++)
+ diff += actual.at(j) + '\n';
QFAIL(qPrintable((err ? "Output for " : "Result for ") + expectedFn + " does not meet expectations:\n" + diff));
}
void tst_lupdate::doCompare(const QString &actualFn, const QString &expectedFn, bool err)
{
QFile afile(actualFn);
- QVERIFY(afile.open(QIODevice::ReadOnly | QIODevice::Text));
- QStringList actual = QString(afile.readAll()).trimmed().split('\n');
+ QVERIFY2(afile.open(QIODevice::ReadOnly | QIODevice::Text), qPrintable(actualFn));
+ QStringList actual = QString(afile.readAll()).split('\n');
doCompare(actual, expectedFn, err);
}
@@ -167,20 +242,16 @@ void tst_lupdate::good()
QFETCH(QString, directory);
QString dir = m_basePath + "good/" + directory;
- QString expectedFile = dir + QLatin1String("/project.ts.result");
qDebug() << "Checking...";
- // qmake will delete the previous one, to ensure that we don't do any merging....
- QString generatedtsfile(QLatin1String("project.ts"));
+ QString generatedtsfile(dir + QLatin1String("/project.ts"));
- m_lupdate.setWorkingDirectory(dir);
- m_lupdate.qmake();
// look for a command
QString lupdatecmd;
QFile file(dir + "/lupdatecmd");
if (file.exists()) {
- QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text));
+ QVERIFY2(file.open(QIODevice::ReadOnly | QIODevice::Text), qPrintable(file.fileName()));
while (!file.atEnd()) {
QByteArray cmdstring = file.readLine().simplified();
if (cmdstring.startsWith('#'))
@@ -197,72 +268,39 @@ void tst_lupdate::good()
file.close();
}
- if (lupdatecmd.isEmpty()) {
- lupdatecmd = QLatin1String("project.pro -ts project.ts");
- }
- lupdatecmd.prepend("-silent ");
- m_lupdate.updateProFile(lupdatecmd);
-
- // If the file expectedoutput.txt exists, compare the
- // console output with the content of that file
- QFile outfile(dir + "/expectedoutput.txt");
- if (outfile.exists()) {
- QString errs = m_lupdate.getErrorMessages().at(1).trimmed();
- QStringList errslist = errs.split(QLatin1Char('\n'));
- doCompare(errslist, outfile.fileName(), true);
- if (QTest::currentTestFailed())
- return;
- }
-
- doCompare(generatedtsfile, expectedFile, false);
-}
-
-void tst_lupdate::output_ts()
-{
- QString dir = m_basePath + "output_ts";
- m_lupdate.setWorkingDirectory(dir);
-
- // look for a command
- QString lupdatecmd;
- QFile file(dir + "/lupdatecmd");
- if (file.exists()) {
- QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text));
- while (!file.atEnd()) {
- QByteArray cmdstring = file.readLine().simplified();
- if (cmdstring.startsWith('#'))
- continue;
- if (cmdstring.startsWith("lupdate")) {
- cmdstring.remove(0, 8);
- lupdatecmd.append(cmdstring);
- break;
- }
- }
- file.close();
- }
-
- QDir parsingDir(m_basePath + "output_ts");
-
- QString generatedtsfile =
- dir + QLatin1String("/toplevel/library/tools/translations/project.ts");
-
QFile::remove(generatedtsfile);
+ QString beforetsfile = generatedtsfile + QLatin1String(".before");
+ if (QFile::exists(beforetsfile))
+ QVERIFY2(QFile::copy(beforetsfile, generatedtsfile), qPrintable(beforetsfile));
+ if (lupdatecmd.isEmpty())
+ lupdatecmd = QLatin1String("project.pro");
lupdatecmd.prepend("-silent ");
- m_lupdate.qmake();
- m_lupdate.updateProFile(lupdatecmd);
+
+ QProcess proc;
+ proc.setWorkingDirectory(dir);
+ proc.setProcessChannelMode(QProcess::MergedChannels);
+ proc.start(m_cmdLupdate + ' ' + lupdatecmd, QIODevice::ReadWrite | QIODevice::Text);
+ QVERIFY2(proc.waitForFinished(5000), qPrintable(lupdatecmd));
+ QByteArray output = proc.readAll();
+ QVERIFY2(proc.exitStatus() == QProcess::NormalExit,
+ "\"lupdate " + lupdatecmd.toLatin1() + "\" crashed\n" + output);
+ QVERIFY2(!proc.exitCode(),
+ "\"lupdate " + lupdatecmd.toLatin1() + "\" exited with code " +
+ QByteArray::number(proc.exitCode()) + "\n" + proc.readAll());
// If the file expectedoutput.txt exists, compare the
// console output with the content of that file
QFile outfile(dir + "/expectedoutput.txt");
if (outfile.exists()) {
- QString errs = m_lupdate.getErrorMessages().at(1).trimmed();
- QStringList errslist = errs.split(QLatin1Char('\n'));
+ QStringList errslist = QString::fromLatin1(output).split(QLatin1Char('\n'));
doCompare(errslist, outfile.fileName(), true);
if (QTest::currentTestFailed())
return;
}
- doCompare(generatedtsfile, dir + QLatin1String("/project.ts.result"), false);
+ QString expectedFile = generatedtsfile + QLatin1String(".result");
+ doCompare(generatedtsfile, expectedFile, false);
}
void tst_lupdate::commandline_data()
@@ -285,14 +323,21 @@ void tst_lupdate::commandline()
QFETCH(QString, generatedtsfile);
QFETCH(QString, expectedtsfile);
- m_lupdate.setWorkingDirectory(m_basePath + currentPath);
QString generated =
m_basePath + currentPath + QLatin1Char('/') + generatedtsfile;
QFile gen(generated);
if (gen.exists())
QVERIFY(gen.remove());
- if (!m_lupdate.run("-silent " + commandline))
- qDebug() << m_lupdate.getErrorMessages().last();
+ QProcess proc;
+ proc.setWorkingDirectory(m_basePath + currentPath);
+ proc.setProcessChannelMode(QProcess::MergedChannels);
+ proc.start(m_cmdLupdate + " -silent " + commandline, QIODevice::ReadWrite | QIODevice::Text);
+ QVERIFY2(proc.waitForFinished(5000), qPrintable(commandline));
+ QVERIFY2(proc.exitStatus() == QProcess::NormalExit,
+ "\"lupdate -silent " + commandline.toLatin1() + "\" crashed\n" + proc.readAll());
+ QVERIFY2(!proc.exitCode(),
+ "\"lupdate -silent " + commandline.toLatin1() + "\" exited with code " +
+ QByteArray::number(proc.exitCode()) + "\n" + proc.readAll());
doCompare(generated, m_basePath + currentPath + QLatin1Char('/') + expectedtsfile, false);
}
diff --git a/tests/benchmarks/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/qnetworkreply/tst_qnetworkreply.cpp
index edaf545..6327123 100644
--- a/tests/benchmarks/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/benchmarks/qnetworkreply/tst_qnetworkreply.cpp
@@ -561,15 +561,15 @@ void tst_qnetworkreply::httpUploadPerformance()
generator.start();
time.start();
QTestEventLoop::instance().enterLoop(40);
+ qint64 elapsed = time.elapsed();
+ reader.exit();
+ reader.wait();
+ QVERIFY(reply->isFinished());
QCOMPARE(reply->error(), QNetworkReply::NoError);
QVERIFY(!QTestEventLoop::instance().timeout());
- qint64 elapsed = time.elapsed();
qDebug() << "tst_QNetworkReply::httpUploadPerformance" << elapsed << "msec, "
<< ((UploadSize/1024.0)/(elapsed/1000.0)) << " kB/sec";
-
- reader.exit();
- reader.wait();
}
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 46f2280..919e68f 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -2770,8 +2770,9 @@ void Configure::generateCachefile()
if (!dictionary["QT_LIBINFIX"].isEmpty())
configStream << "QT_LIBINFIX = " << dictionary["QT_LIBINFIX"] << endl;
+ configStream << "#Qt for Symbian FPU settings" << endl;
if(!dictionary["ARM_FPU_TYPE"].isEmpty()) {
- configStream<<"QMAKE_CXXFLAGS.ARMCC += --fpu "<< dictionary["ARM_FPU_TYPE"];
+ configStream<<"MMP_RULES += \"ARMFPU "<< dictionary["ARM_FPU_TYPE"]<< "\"";
}
configStream.flush();
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index 12c06b1..6bd9108 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -1732,7 +1732,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
plural = true;
}
}
- if (!pendingContext.isEmpty()) {
+ if (!pendingContext.isEmpty() && !prefix.startsWith(strColons)) {
QStringList unresolved;
if (!fullyQualify(namespaces, pendingContext, true, &functionContext, &unresolved)) {
functionContextUnresolved = unresolved.join(strColons);
diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp
index ecdb0e3..2129265 100644
--- a/tools/linguist/lupdate/main.cpp
+++ b/tools/linguist/lupdate/main.cpp
@@ -237,18 +237,12 @@ int main(int argc, char **argv)
Verbose | // verbose is on by default starting with Qt 4.2
HeuristicSameText | HeuristicSimilarText | HeuristicNumber;
int numFiles = 0;
- bool standardSyntax = true;
bool metTsFlag = false;
bool recursiveScan = true;
QString extensions = m_defaultExtensions;
QSet<QString> extensionsNameFilters;
- for (int i = 1; i < argc; ++i) {
- if (args.at(i) == QLatin1String("-ts"))
- standardSyntax = false;
- }
-
for (int i = 1; i < argc; ++i) {
QString arg = args.at(i);
if (arg == QLatin1String("-help")
@@ -375,8 +369,6 @@ int main(int argc, char **argv)
numFiles++;
- QString fullText;
-
codecForTr.clear();
codecForSource.clear();
diff --git a/tools/linguist/lupdate/merge.cpp b/tools/linguist/lupdate/merge.cpp
index 421f07d..fffdf9b 100644
--- a/tools/linguist/lupdate/merge.cpp
+++ b/tools/linguist/lupdate/merge.cpp
@@ -50,9 +50,6 @@
#include <QtCore/QTextCodec>
#include <QtCore/QVector>
-typedef QList<TranslatorMessage> TML;
-typedef QMap<QString, TranslatorMessage> TMM;
-
QT_BEGIN_NAMESPACE
@@ -63,7 +60,7 @@ static bool isDigitFriendly(QChar c)
static int numberLength(const QString &s, int i)
{
- if (i < s.size() || !s.at(i).isDigit())
+ if (i >= s.size() || !s.at(i).isDigit())
return 0;
int pos = i;
@@ -90,7 +87,7 @@ static QString zeroKey(const QString &key)
QString zeroed;
bool metSomething = false;
- for (int i = 0; i != key.size(); ++i) {
+ for (int i = 0; i < key.size(); ++i) {
int len = numberLength(key, i);
if (len > 0) {
i += len;
@@ -225,31 +222,36 @@ static QString translationAttempt(const QString &oldTranslation,
*/
int applyNumberHeuristic(Translator &tor)
{
- TMM translated, untranslated;
- TMM::Iterator t, u;
- TML all = tor.messages();
- TML::Iterator it;
+ QMap<QString, QPair<QString, QString> > translated;
+ QVector<bool> untranslated(tor.messageCount());
int inserted = 0;
- for (it = all.begin(); it != all.end(); ++it) {
- bool hasTranslation = it->isTranslated();
- if (it->type() == TranslatorMessage::Unfinished) {
+ for (int i = 0; i < tor.messageCount(); ++i) {
+ const TranslatorMessage &msg = tor.message(i);
+ bool hasTranslation = msg.isTranslated();
+ if (msg.type() == TranslatorMessage::Unfinished) {
if (!hasTranslation)
- untranslated.insert(it->context() + QLatin1Char('\n')
- + it->sourceText() + QLatin1Char('\n')
- + it->comment(), *it);
- } else if (hasTranslation && it->translations().count() == 1) {
- translated.insert(zeroKey(it->sourceText()), *it);
+ untranslated[i] = true;
+ } else if (hasTranslation && msg.translations().count() == 1) {
+ const QString &key = zeroKey(msg.sourceText());
+ if (!key.isEmpty())
+ translated.insert(key, qMakePair(msg.sourceText(), msg.translation()));
}
}
- for (u = untranslated.begin(); u != untranslated.end(); ++u) {
- t = translated.find(zeroKey((*u).sourceText()));
- if (t != translated.end() && !t.key().isEmpty()
- && t->sourceText() != u->sourceText()) {
- u->setTranslation(translationAttempt(t->translation(), t->sourceText(),
- u->sourceText()));
- inserted++;
+ for (int i = 0; i < tor.messageCount(); ++i) {
+ if (untranslated[i]) {
+ TranslatorMessage &msg = tor.message(i);
+ const QString &key = zeroKey(msg.sourceText());
+ if (!key.isEmpty()) {
+ QMap<QString, QPair<QString, QString> >::ConstIterator t =
+ translated.constFind(key);
+ if (t != translated.constEnd() && t->first != msg.sourceText()) {
+ msg.setTranslation(translationAttempt(t->second, t->first,
+ msg.sourceText()));
+ inserted++;
+ }
+ }
}
}
return inserted;
@@ -268,43 +270,42 @@ int applyNumberHeuristic(Translator &tor)
int applySameTextHeuristic(Translator &tor)
{
- TMM translated;
- TMM avoid;
- TMM::Iterator t;
- TML untranslated;
- TML::Iterator u;
- TML all = tor.messages();
- TML::Iterator it;
+ QMap<QString, QStringList> translated;
+ QMap<QString, bool> avoid; // Want a QTreeSet, in fact
+ QVector<bool> untranslated(tor.messageCount());
int inserted = 0;
- for (it = all.begin(); it != all.end(); ++it) {
- if (!it->isTranslated()) {
- if (it->type() == TranslatorMessage::Unfinished)
- untranslated.append(*it);
+ for (int i = 0; i < tor.messageCount(); ++i) {
+ const TranslatorMessage &msg = tor.message(i);
+ if (!msg.isTranslated()) {
+ if (msg.type() == TranslatorMessage::Unfinished)
+ untranslated[i] = true;
} else {
- QString key = it->sourceText();
- t = translated.find(key);
- if (t != translated.end()) {
+ const QString &key = msg.sourceText();
+ QMap<QString, QStringList>::ConstIterator t = translated.constFind(key);
+ if (t != translated.constEnd()) {
/*
The same source text is translated at least two
different ways. Do nothing then.
*/
- if (t->translations() != it->translations()) {
+ if (*t != msg.translations()) {
translated.remove(key);
- avoid.insert(key, *it);
+ avoid.insert(key, true);
}
} else if (!avoid.contains(key)) {
- translated.insert(key, *it);
+ translated.insert(key, msg.translations());
}
}
}
- for (u = untranslated.begin(); u != untranslated.end(); ++u) {
- QString key = u->sourceText();
- t = translated.find(key);
- if (t != translated.end()) {
- u->setTranslations(t->translations());
- ++inserted;
+ for (int i = 0; i < tor.messageCount(); ++i) {
+ if (untranslated[i]) {
+ TranslatorMessage &msg = tor.message(i);
+ QMap<QString, QStringList>::ConstIterator t = translated.constFind(msg.sourceText());
+ if (t != translated.constEnd()) {
+ msg.setTranslations(*t);
+ ++inserted;
+ }
}
}
return inserted;
diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp
index 83a182e..4331ce6 100644
--- a/tools/linguist/shared/translator.cpp
+++ b/tools/linguist/shared/translator.cpp
@@ -44,6 +44,10 @@
#include "simtexth.h"
#include <stdio.h>
+#ifdef Q_OS_WIN
+#include <io.h> // required for _setmode, to avoid _O_TEXT streams...
+#include <fcntl.h> // for _O_BINARY
+#endif
#include <QtCore/QDebug>
#include <QtCore/QDir>
@@ -207,6 +211,10 @@ bool Translator::load(const QString &filename, ConversionData &cd, const QString
QFile file;
if (filename.isEmpty() || filename == QLatin1String("-")) {
+#ifdef Q_OS_WIN
+ // QFile is broken for text files
+ ::_setmode(0, _O_BINARY);
+#endif
if (!file.open(stdin, QIODevice::ReadOnly)) {
cd.appendError(QString::fromLatin1("Cannot open stdin!? (%1)")
.arg(file.errorString()));
@@ -243,6 +251,10 @@ bool Translator::save(const QString &filename, ConversionData &cd, const QString
{
QFile file;
if (filename.isEmpty() || filename == QLatin1String("-")) {
+#ifdef Q_OS_WIN
+ // QFile is broken for text files
+ ::_setmode(1, _O_BINARY);
+#endif
if (!file.open(stdout, QIODevice::WriteOnly)) {
cd.appendError(QString::fromLatin1("Cannot open stdout!? (%1)")
.arg(file.errorString()));
diff --git a/translations/qt_de.ts b/translations/qt_de.ts
index ff0dc5d..d916733 100644
--- a/translations/qt_de.ts
+++ b/translations/qt_de.ts
@@ -7958,6 +7958,34 @@ Bitte wählen Sie einen anderen Dateinamen.</translation>
</message>
</context>
<context>
+ <name>QXmlPatternistCLI</name>
+ <message>
+ <location filename="../src/xmlpatterns/api/qcoloringmessagehandler.cpp" line="+87"/>
+ <source>Warning in %1, at line %2, column %3: %4</source>
+ <translation>Fehler in %1, bei Zeile %2, Spalte %3: %4</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Warning in %1: %2</source>
+ <translation>Warnung in %1: %2</translation>
+ </message>
+ <message>
+ <location line="+16"/>
+ <source>Unknown location</source>
+ <translation>unbekannt</translation>
+ </message>
+ <message>
+ <location line="+14"/>
+ <source>Error %1 in %2, at line %3, column %4: %5</source>
+ <translation>Fehler %1 in %2, bei Zeile %3, Spalte %4: %5</translation>
+ </message>
+ <message>
+ <location line="+8"/>
+ <source>Error %1 in %2: %3</source>
+ <translation>Fehler %1 in %2: %3</translation>
+ </message>
+</context>
+<context>
<name>QXmlStream</name>
<message>
<location filename="../src/corelib/xml/qxmlstream.cpp" line="+611"/>