diff options
-rwxr-xr-x | bin/syncqt | 6 | ||||
-rw-r--r-- | src/3rdparty/webkit/.tag | 2 | ||||
-rw-r--r-- | src/3rdparty/webkit/VERSION | 2 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp | 2 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/ChangeLog | 15 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp | 8 | ||||
-rw-r--r-- | src/corelib/tools/qbytearray.cpp | 5 | ||||
-rw-r--r-- | src/gui/widgets/qcommandlinkbutton.cpp | 18 | ||||
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt | 3 | ||||
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp | 13 | ||||
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result | 12 | ||||
-rw-r--r-- | tools/linguist/lupdate/cpp.cpp | 16 |
12 files changed, 87 insertions, 15 deletions
@@ -834,12 +834,12 @@ foreach (@modules_to_sync) { # write forwarding headers to include/Qt if ("$lib" ne "phonon" && "$subdir" =~ /^$basedir\/src/) { my $file_name = "$out_basedir/include/Qt/$header"; + my $file_op = '>'; my $header_content = ''; if (exists $colliding_headers{$file_name}) { - $file_name = ">>$file_name"; + $file_op = '>>'; } else { $colliding_headers{$file_name} = 1; - $file_name = ">$file_name"; my $warning_msg = 'Inclusion of header files from include/Qt is deprecated.'; $header_content = "#ifndef QT_NO_QT_INCLUDE_WARN\n" . " #if defined(__GNUC__)\n" . @@ -850,7 +850,7 @@ foreach (@modules_to_sync) { "#endif\n\n"; } $header_content .= '#include "' . "../$lib/$header" . "\"\n"; - open HEADERFILE, $file_name; + open HEADERFILE, $file_op, $file_name or die "unable to open '$file_name' : $!\n"; print HEADERFILE $header_content; close HEADERFILE; } diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag index 24cf142..aa30784 100644 --- a/src/3rdparty/webkit/.tag +++ b/src/3rdparty/webkit/.tag @@ -1 +1 @@ -2f598e9b7b376d851fe089bc1dc729bcf0393a06 +38d650efc92427cd6452f6685d3c40d22428cdb7 diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 924b120..980e01a 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from and has the sha1 checksum - 2f598e9b7b376d851fe089bc1dc729bcf0393a06 + 38d650efc92427cd6452f6685d3c40d22428cdb7 diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp index 7a25646..c4d240c 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp @@ -442,6 +442,8 @@ QRectF QGraphicsWebViewPrivate::graphicsItemVisibleRect() const #if ENABLE(TILED_BACKING_STORE) void QGraphicsWebViewPrivate::updateTiledBackingStoreScale() { + if (!page) + return; WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page->mainFrame())->tiledBackingStore(); if (!backingStore) return; diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index 69a431f..8fb929e 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,18 @@ +2010-06-28 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] QGraphicsWebView crash when calling setScale() before setUrl() + https://bugs.webkit.org/show_bug.cgi?id=40000 + + Check 'page' before dereference in _q_scaleChanged() + Autotest included. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::_q_scaleChanged): + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (tst_QGraphicsWebView::crashOnSetScaleBeforeSetUrl): + 2010-06-24 Simon Hausmann <simon.hausmann@nokia.com> Unreviewed Symbian build fix. diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp index e06524d..a04ff17 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp @@ -34,6 +34,7 @@ private slots: void crashOnViewlessWebPages(); void microFocusCoordinates(); void focusInputTypes(); + void crashOnSetScaleBeforeSetUrl(); }; void tst_QGraphicsWebView::qgraphicswebview() @@ -132,6 +133,13 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages() delete page; } +void tst_QGraphicsWebView::crashOnSetScaleBeforeSetUrl() +{ + QGraphicsWebView* webView = new QGraphicsWebView; + webView->setScale(2.0); + delete webView; +} + void tst_QGraphicsWebView::microFocusCoordinates() { QWebPage* page = new QWebPage; diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 05d38f6..b46af1f 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -1805,6 +1805,11 @@ QByteArray &QByteArray::replace(int pos, int len, const QByteArray &after) /*! \fn QByteArray &QByteArray::replace(int pos, int len, const char *after) \overload + + Replaces \a len bytes from index position \a pos with the zero terminated + string \a after. + + Notice: this can change the lenght of the byte array. */ QByteArray &QByteArray::replace(int pos, int len, const char *after) { diff --git a/src/gui/widgets/qcommandlinkbutton.cpp b/src/gui/widgets/qcommandlinkbutton.cpp index e8fe299..d3b5869 100644 --- a/src/gui/widgets/qcommandlinkbutton.cpp +++ b/src/gui/widgets/qcommandlinkbutton.cpp @@ -118,7 +118,7 @@ public: int topMargin() const { return 10; } int leftMargin() const { return 7; } int rightMargin() const { return 4; } - int bottomMargin() const { return 4; } + int bottomMargin() const { return 10; } QString description; QColor currentColor; @@ -174,8 +174,15 @@ QFont QCommandLinkButtonPrivate::descriptionFont() const QRect QCommandLinkButtonPrivate::titleRect() const { Q_Q(const QCommandLinkButton); - return q->rect().adjusted(textOffset(), topMargin(), - -rightMargin(), 0); + QRect r = q->rect().adjusted(textOffset(), topMargin(), -rightMargin(), 0); + if (description.isEmpty()) + { + QFontMetrics fm(titleFont()); + r.setTop(r.top() + qMax(0, (q->icon().actualSize(q->iconSize()).height() + - fm.height()) / 2)); + } + + return r; } QRect QCommandLinkButtonPrivate::descriptionRect() const @@ -254,7 +261,7 @@ QSize QCommandLinkButton::minimumSizeHint() const Q_D(const QCommandLinkButton); QSize size = sizeHint(); int minimumHeight = qMax(d->descriptionOffset() + d->bottomMargin(), - iconSize().height() + d->topMargin()); + icon().actualSize(iconSize()).height() + d->topMargin()); size.setHeight(minimumHeight); return size; } @@ -328,7 +335,8 @@ int QCommandLinkButton::heightForWidth(int width) const int heightWithoutDescription = d->descriptionOffset() + d->bottomMargin(); // find the width available for the description area return qMax(heightWithoutDescription + d->descriptionHeight(width), - iconSize().height() + d->topMargin() + d->bottomMargin()); + icon().actualSize(iconSize()).height() + d->topMargin() + + d->bottomMargin()); } /*! \reimp */ diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt index 195c0e6..d4ebe49 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt @@ -2,3 +2,6 @@ .*/lupdate/testdata/good/parsecpp2/main.cpp:55: Excess closing brace .* .*/lupdate/testdata/good/parsecpp2/main.cpp:61: Excess closing brace .* .*/lupdate/testdata/good/parsecpp2/main.cpp:65: Excess closing brace .* +.*/lupdate/testdata/good/parsecpp2/main.cpp:120: //% cannot be used with tr\(\) / QT_TR_NOOP\(\)\. Ignoring +.*/lupdate/testdata/good/parsecpp2/main.cpp:123: //% cannot be used with translate\(\) / QT_TRANSLATE_NOOP\(\)\. Ignoring +.*/lupdate/testdata/good/parsecpp2/main.cpp:126: Discarding unconsumed meta data diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp index feb885c..06e6fe0 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp @@ -112,3 +112,16 @@ void ToBeUsed::caller() { tr("NameSpace::ToBeUsed"); } + + + +// QTBUG-11818 +//% "Foo" +QObject::tr("Hello World"); +QObject::tr("Hello World"); +//% "Bar" +QApplication::translate("QObject", "Hello World"); +QApplication::translate("QObject", "Hello World"); +//% "Baz" +clear = me; +QObject::tr("Hello World"); diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result index 6f48e27..806f56f 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result @@ -10,6 +10,18 @@ </message> </context> <context> + <name>QObject</name> + <message> + <location filename="main.cpp" line="120"/> + <location filename="main.cpp" line="121"/> + <location filename="main.cpp" line="123"/> + <location filename="main.cpp" line="124"/> + <location filename="main.cpp" line="127"/> + <source>Hello World</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>TopLevel</name> <message> <location filename="main.cpp" line="82"/> diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp index b3e7e84..609bd3d 100644 --- a/tools/linguist/lupdate/cpp.cpp +++ b/tools/linguist/lupdate/cpp.cpp @@ -1761,7 +1761,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) if (!tor) goto case_default; if (!sourcetext.isEmpty()) - yyMsg() << "//%% cannot be used with tr() / QT_TR_NOOP(). Ignoring\n"; + yyMsg() << "//% cannot be used with tr() / QT_TR_NOOP(). Ignoring\n"; utf8 = (yyTok == Tok_trUtf8); line = yyLineNo; yyTok = getToken(); @@ -1858,6 +1858,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) gotctx: recordMessage(line, context, text, comment, extracomment, msgid, extra, utf8, plural); } + sourcetext.clear(); // Will have warned about that already extracomment.clear(); msgid.clear(); extra.clear(); @@ -1867,7 +1868,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) if (!tor) goto case_default; if (!sourcetext.isEmpty()) - yyMsg() << "//%% cannot be used with translate() / QT_TRANSLATE_NOOP(). Ignoring\n"; + yyMsg() << "//% cannot be used with translate() / QT_TRANSLATE_NOOP(). Ignoring\n"; utf8 = (yyTok == Tok_translateUtf8); line = yyLineNo; yyTok = getToken(); @@ -1913,6 +1914,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) } recordMessage(line, context, text, comment, extracomment, msgid, extra, utf8, plural); } + sourcetext.clear(); // Will have warned about that already extracomment.clear(); msgid.clear(); extra.clear(); @@ -2079,9 +2081,13 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) case Tok_Semicolon: prospectiveContext.clear(); prefix.clear(); - extracomment.clear(); - msgid.clear(); - extra.clear(); + if (!sourcetext.isEmpty() || !extracomment.isEmpty() || !msgid.isEmpty() || !extra.isEmpty()) { + yyMsg() << "Discarding unconsumed meta data\n"; + sourcetext.clear(); + extracomment.clear(); + msgid.clear(); + extra.clear(); + } yyTokColonSeen = false; yyTok = getToken(); break; |