From e9c8a4cf013906a54b1b05796d6007d878e85398 Mon Sep 17 00:00:00 2001 From: Frederik Schwarzer Date: Mon, 11 May 2009 15:55:59 +0200 Subject: typos in docs: double "the" --- doc/src/accessible.qdoc | 2 +- doc/src/deployment.qdoc | 2 +- doc/src/examples/codeeditor.qdoc | 2 +- doc/src/examples/containerextension.qdoc | 2 +- doc/src/examples/fortuneserver.qdoc | 2 +- doc/src/examples/ftp.qdoc | 4 ++-- doc/src/examples/icons.qdoc | 2 +- doc/src/examples/musicplayerexample.qdoc | 2 +- doc/src/examples/qobjectxmlmodel.qdoc | 2 +- doc/src/examples/tabdialog.qdoc | 2 +- doc/src/examples/tooltips.qdoc | 2 +- doc/src/examples/transformations.qdoc | 2 +- doc/src/examples/trollprint.qdoc | 2 +- doc/src/licenses.qdoc | 2 +- doc/src/mac-differences.qdoc | 2 +- doc/src/phonon-api.qdoc | 2 +- doc/src/q3valuelist.qdoc | 2 +- doc/src/qalgorithms.qdoc | 2 +- doc/src/qtdesigner.qdoc | 2 +- doc/src/qtscriptdebugger-manual.qdoc | 2 +- doc/src/stylesheet.qdoc | 8 ++++---- doc/src/tech-preview/known-issues.html | 2 +- doc/src/timers.qdoc | 4 ++-- doc/src/xquery-introduction.qdoc | 2 +- 24 files changed, 29 insertions(+), 29 deletions(-) diff --git a/doc/src/accessible.qdoc b/doc/src/accessible.qdoc index 090da86..ad9f4f1 100644 --- a/doc/src/accessible.qdoc +++ b/doc/src/accessible.qdoc @@ -527,7 +527,7 @@ on plugins, consult the plugins \l{How to Create Qt Plugins}{overview document}. - You can omit the the first macro unless you want the plugin + You can omit the first macro unless you want the plugin to be statically linked with the application. \section2 Implementing Interface Factories diff --git a/doc/src/deployment.qdoc b/doc/src/deployment.qdoc index bcfa93d..446c91b 100644 --- a/doc/src/deployment.qdoc +++ b/doc/src/deployment.qdoc @@ -1247,7 +1247,7 @@ \snippet doc/src/snippets/code/doc_src_deployment.qdoc 48 Then we update the source code in \c tools/plugandpaint/main.cpp - to look for the the new plugins. After constructing the + to look for the new plugins. After constructing the QApplication, we add the following code: \snippet doc/src/snippets/code/doc_src_deployment.qdoc 49 diff --git a/doc/src/examples/codeeditor.qdoc b/doc/src/examples/codeeditor.qdoc index 669ab45..d218d0d 100644 --- a/doc/src/examples/codeeditor.qdoc +++ b/doc/src/examples/codeeditor.qdoc @@ -67,7 +67,7 @@ QTextEdit because it is optimized for handling plain text. See the QPlainTextEdit class description for details. - QPlainTextEdit lets us add selections in addition to the the + QPlainTextEdit lets us add selections in addition to the selection the user can make with the mouse or keyboard. We use this functionality to highlight the current line. More on this later. diff --git a/doc/src/examples/containerextension.qdoc b/doc/src/examples/containerextension.qdoc index a4fbcea..6d29cf6 100644 --- a/doc/src/examples/containerextension.qdoc +++ b/doc/src/examples/containerextension.qdoc @@ -305,7 +305,7 @@ MultiPageWidget class \l {designer/containerextension/multipagewidget.cpp}{implementation}). Finally, we implicitly force an update of the page's property - sheet by calling the the + sheet by calling the QDesignerPropertySheetExtension::setChanged() function. \snippet examples/designer/containerextension/multipagewidgetplugin.cpp 4 diff --git a/doc/src/examples/fortuneserver.qdoc b/doc/src/examples/fortuneserver.qdoc index e6a7f85..848a3a3 100644 --- a/doc/src/examples/fortuneserver.qdoc +++ b/doc/src/examples/fortuneserver.qdoc @@ -45,7 +45,7 @@ The Fortune Server example shows how to create a server for a simple network service. It is intended to be run alongside the - \l{network/fortuneclient}{Fortune Client} example or the the + \l{network/fortuneclient}{Fortune Client} example or the \l{network/blockingfortuneclient}{Blocking Fortune Client} example. \image fortuneserver-example.png Screenshot of the Fortune Server example diff --git a/doc/src/examples/ftp.qdoc b/doc/src/examples/ftp.qdoc index 9cc9cd1..7a74a37 100644 --- a/doc/src/examples/ftp.qdoc +++ b/doc/src/examples/ftp.qdoc @@ -172,7 +172,7 @@ no entries were found (in which case our \c addToList() function would not have been called). - Let's continue with the the \c addToList() slot: + Let's continue with the \c addToList() slot: \snippet examples/network/ftp/ftpwindow.cpp 10 @@ -190,7 +190,7 @@ \snippet examples/network/ftp/ftpwindow.cpp 12 - \c cdToParent() is invoked when the the user requests to go to the + \c cdToParent() is invoked when the user requests to go to the parent directory of the one displayed in the file list. After changing the directory, we QFtp::List its contents. diff --git a/doc/src/examples/icons.qdoc b/doc/src/examples/icons.qdoc index 750ef2e..a81ddb9 100644 --- a/doc/src/examples/icons.qdoc +++ b/doc/src/examples/icons.qdoc @@ -479,7 +479,7 @@ QTableWidget::openPersistentEditor() function to create comboboxes for the mode and state columns of the items. - Due to the the connection between the table widget's \l + Due to the connection between the table widget's \l {QTableWidget::itemChanged()}{itemChanged()} signal and the \c changeIcon() slot, the new image is automatically converted into a pixmap and made part of the set of pixmaps available to the icon diff --git a/doc/src/examples/musicplayerexample.qdoc b/doc/src/examples/musicplayerexample.qdoc index d23c1f1..9f04bf6 100644 --- a/doc/src/examples/musicplayerexample.qdoc +++ b/doc/src/examples/musicplayerexample.qdoc @@ -154,7 +154,7 @@ \snippet examples/phonon/musicplayer/mainwindow.cpp 5 - We move on to the the slots of \c MainWindow, starting with \c + We move on to the slots of \c MainWindow, starting with \c addFiles(): \snippet examples/phonon/musicplayer/mainwindow.cpp 6 diff --git a/doc/src/examples/qobjectxmlmodel.qdoc b/doc/src/examples/qobjectxmlmodel.qdoc index ce1dab6..37c66bc 100644 --- a/doc/src/examples/qobjectxmlmodel.qdoc +++ b/doc/src/examples/qobjectxmlmodel.qdoc @@ -71,7 +71,7 @@ The query engine can only traverse two dimensional trees, because an XML document is always a two dimensional tree. If we want to add the QMetaObject tree to the node model, we have to somehow flatten it - into the the same plane as the QObject tree. This requires that the + into the same plane as the QObject tree. This requires that the node model class must build an auxiliary data structure and make it part of the two dimensional QObject node model. How to do this is explained in \l{Including The QMetaObject Tree}. diff --git a/doc/src/examples/tabdialog.qdoc b/doc/src/examples/tabdialog.qdoc index c9500af..5394b82 100644 --- a/doc/src/examples/tabdialog.qdoc +++ b/doc/src/examples/tabdialog.qdoc @@ -91,7 +91,7 @@ \snippet examples/dialogs/tabdialog/tabdialog.cpp 1 \snippet examples/dialogs/tabdialog/tabdialog.cpp 3 - We arrange the the tab widget above the buttons in the dialog: + We arrange the tab widget above the buttons in the dialog: \snippet examples/dialogs/tabdialog/tabdialog.cpp 4 diff --git a/doc/src/examples/tooltips.qdoc b/doc/src/examples/tooltips.qdoc index 5daa2b2..78b350b 100644 --- a/doc/src/examples/tooltips.qdoc +++ b/doc/src/examples/tooltips.qdoc @@ -353,7 +353,7 @@ Whenever the user creates a new shape item, we want the new item to appear at a random position, and we use the \c randomItemPosition() function to calculate such a position. We - make sure that the item appears within the the visible area of the + make sure that the item appears within the visible area of the \c SortingBox widget, using the widget's current width and heigth when calculating the random coordinates. diff --git a/doc/src/examples/transformations.qdoc b/doc/src/examples/transformations.qdoc index eabb803..58c8b80 100644 --- a/doc/src/examples/transformations.qdoc +++ b/doc/src/examples/transformations.qdoc @@ -208,7 +208,7 @@ After transforming the coordinate system, we draw the \c RenderArea's shape, and then we restore the painter state using - the the QPainter::restore() function (i.e. popping the saved state off + the QPainter::restore() function (i.e. popping the saved state off the stack). \snippet examples/painting/transformations/renderarea.cpp 7 diff --git a/doc/src/examples/trollprint.qdoc b/doc/src/examples/trollprint.qdoc index 38251ee..489012e 100644 --- a/doc/src/examples/trollprint.qdoc +++ b/doc/src/examples/trollprint.qdoc @@ -142,7 +142,7 @@ We can easily determine which file must be changed because the translator's "context" is in fact the class name for the class where the texts that must be changed appears. In this case the file is \c - printpanel.cpp, where the there are four lines to change. Add the + printpanel.cpp, where there are four lines to change. Add the second argument "two-sided" in the appropriate \c tr() calls to the first pair of radio buttons: diff --git a/doc/src/licenses.qdoc b/doc/src/licenses.qdoc index 1c3f6d2..a11c071 100644 --- a/doc/src/licenses.qdoc +++ b/doc/src/licenses.qdoc @@ -45,7 +45,7 @@ \ingroup licensing \brief Information about other licenses used for Qt components and third-party code. - Qt contains some code that is not provided under the the + Qt contains some code that is not provided under the \l{GNU General Public License (GPL)}, \l{GNU Lesser General Public License (LGPL)} or the \l{Qt Commercial Editions}{Qt Commercial License Agreement}, but rather under diff --git a/doc/src/mac-differences.qdoc b/doc/src/mac-differences.qdoc index 573e62d..5849850 100644 --- a/doc/src/mac-differences.qdoc +++ b/doc/src/mac-differences.qdoc @@ -128,7 +128,7 @@ If you want to build a new dynamic library combining the Qt 4 dynamic libraries, you need to introduce the \c{ld -r} flag. Then - relocation information is stored in the the output file, so that + relocation information is stored in the output file, so that this file could be the subject of another \c ld run. This is done by setting the \c -r flag in the \c .pro file, and the \c LFLAGS settings. diff --git a/doc/src/phonon-api.qdoc b/doc/src/phonon-api.qdoc index 501b5a5..dd37fe2 100644 --- a/doc/src/phonon-api.qdoc +++ b/doc/src/phonon-api.qdoc @@ -2973,7 +2973,7 @@ \value ToggledHint If this hint is set it means that - the the control has only two states: zero and non-zero + the control has only two states: zero and non-zero (see isToggleControl()). \value LogarithmicHint diff --git a/doc/src/q3valuelist.qdoc b/doc/src/q3valuelist.qdoc index be315c2..e3681af 100644 --- a/doc/src/q3valuelist.qdoc +++ b/doc/src/q3valuelist.qdoc @@ -108,7 +108,7 @@ pointing to the removed member become invalid. Inserting into the list does not invalidate any iterator. For convenience, the function last() returns a reference to the last item in the list, - and first() returns a reference to the the first item. If the + and first() returns a reference to the first item. If the list is empty(), both last() and first() have undefined behavior (your application will crash or do unpredictable things). Use last() and first() with caution, for example: diff --git a/doc/src/qalgorithms.qdoc b/doc/src/qalgorithms.qdoc index b33c250..90289f9 100644 --- a/doc/src/qalgorithms.qdoc +++ b/doc/src/qalgorithms.qdoc @@ -59,7 +59,7 @@ If STL is available on all your target platforms, you can use the STL algorithms instead of their Qt counterparts. One reason why - you might want to use the the STL algorithms is that STL provides + you might want to use the STL algorithms is that STL provides dozens and dozens of algorithms, whereas Qt only provides the most important ones, making no attempt to duplicate functionality that is already provided by the C++ standard. diff --git a/doc/src/qtdesigner.qdoc b/doc/src/qtdesigner.qdoc index 7e3b619..9699c5b 100644 --- a/doc/src/qtdesigner.qdoc +++ b/doc/src/qtdesigner.qdoc @@ -632,7 +632,7 @@ /*! \fn void QDesignerContainerExtension::setCurrentIndex(int index) - Sets the the currently selected page in the container to be the + Sets the currently selected page in the container to be the page at the given \a index in the extension's list of pages. \sa currentIndex() diff --git a/doc/src/qtscriptdebugger-manual.qdoc b/doc/src/qtscriptdebugger-manual.qdoc index 3dfe879..75d87f8 100644 --- a/doc/src/qtscriptdebugger-manual.qdoc +++ b/doc/src/qtscriptdebugger-manual.qdoc @@ -367,7 +367,7 @@ \section3 continue Continues execution normally, i.e, gives the execution control over - the script back the the QScriptEngine. + the script back to the QScriptEngine. \section3 eval diff --git a/doc/src/stylesheet.qdoc b/doc/src/stylesheet.qdoc index c0d13da..7d4b05d 100644 --- a/doc/src/stylesheet.qdoc +++ b/doc/src/stylesheet.qdoc @@ -332,7 +332,7 @@ respect to the reference element. Once positioned, they are treated the same as widgets and can be styled - using the the \l{box model}. + using the \l{box model}. See the \l{List of Sub-Controls} below for a list of supported sub-controls, and \l{Customizing the QPushButton's Menu Indicator @@ -671,7 +671,7 @@ \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin} properties. - Once positioned, sub-controls can be styled using the the \l{box model}. + Once positioned, sub-controls can be styled using the \l{box model}. \note With complex widgets such as QComboBox and QScrollBar, if one property or sub-control is customized, \bold{all} the other properties or @@ -1154,7 +1154,7 @@ \l{#pane-sub}{::pane} subcontrol. The left and right corners are styled using the \l{#left-corner-sub}{::left-corner} and \l{#right-corner-sub}{::right-corner} respectively. - The position of the the tab bar is controlled using the + The position of the tab bar is controlled using the \l{#tab-bar-sub}{::tab-bar} subcontrol. By default, the subcontrols have positions of a QTabWidget in @@ -1254,7 +1254,7 @@ the \l{#menu-button-sub}{::menu-button} subcontrol is used to draw the menu button. \l{#menu-arrow-sub}{::menu-arrow} subcontrol is used to draw the menu arrow inside the menu-button. By default, it is - positioned in the center of the Contents rectangle of the the + positioned in the center of the Contents rectangle of the menu-button subcontrol. When the QToolButton displays arrows, the \l{#up-arrow-sub}{::up-arrow}, diff --git a/doc/src/tech-preview/known-issues.html b/doc/src/tech-preview/known-issues.html index 05df69e..885104e 100644 --- a/doc/src/tech-preview/known-issues.html +++ b/doc/src/tech-preview/known-issues.html @@ -16,7 +16,7 @@

Known Issues: Qt 4.0.0 Technology Preview 1

- This is the list of known and reported issues for the the Qt 4.0.0 + This is the list of known and reported issues for the Qt 4.0.0 Technology Preview 1. This list is updated daily.



diff --git a/doc/src/timers.qdoc b/doc/src/timers.qdoc index 4f54343..1b48d7d 100644 --- a/doc/src/timers.qdoc +++ b/doc/src/timers.qdoc @@ -62,7 +62,7 @@ In multithreaded applications, you can use the timer mechanism in any thread that has an event loop. To start an event loop from a - non-GUI thread, use QThread::exec(). Qt uses the the object's + non-GUI thread, use QThread::exec(). Qt uses the object's \l{QObject::thread()}{thread affinity} to determine which thread will deliver the QTimerEvent. Because of this, you must start and stop all timers in the object's thread; it is not possible to @@ -105,7 +105,7 @@ In multithreaded applications, you can use QTimer in any thread that has an event loop. To start an event loop from a non-GUI - thread, use QThread::exec(). Qt uses the the timer's + thread, use QThread::exec(). Qt uses the timer's \l{QObject::thread()}{thread affinity} to determine which thread will emit the \l{QTimer::}{timeout()} signal. Because of this, you must start and stop the timer in its thread; it is not possible to diff --git a/doc/src/xquery-introduction.qdoc b/doc/src/xquery-introduction.qdoc index 37a45ac..fe541e2 100644 --- a/doc/src/xquery-introduction.qdoc +++ b/doc/src/xquery-introduction.qdoc @@ -347,7 +347,7 @@ has a more detailed section on the shorthand form, which it calls the \l{http://www.w3.org/TR/xquery/#abbrev} {abbreviated syntax}. More examples of path expressions written in the shorthand form are found there. There is also a section listing examples of path expressions -written in the the \l{http://www.w3.org/TR/xquery/#unabbrev} {longhand +written in the \l{http://www.w3.org/TR/xquery/#unabbrev} {longhand form}. \target Name Tests -- cgit v0.12 From 17e1bca1ce366395f8331e16aa96b7176ca1abac Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 11 May 2009 15:21:14 -0400 Subject: Optimize rendering in the GL engine By using REPLACE we don't have to clean the stencil on every draw, effectively optimizing the rendering by 200%. --- src/opengl/qpaintengine_opengl.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index aee351d..4259a5c 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -2233,7 +2233,7 @@ void QOpenGLPaintEnginePrivate::fillVertexArray(Qt::FillRule fillRule) // Enable color writes. glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glStencilMask(0); + glStencilMask(stencilMask); setGradientOps(cbrush, QRectF(QPointF(min_x, min_y), QSizeF(max_x - min_x, max_y - min_y))); @@ -2245,12 +2245,14 @@ void QOpenGLPaintEnginePrivate::fillVertexArray(Qt::FillRule fillRule) // Enable stencil func. glStencilFunc(GL_NOTEQUAL, 0, stencilMask); + glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE); composite(rect); } else { DEBUG_ONCE qDebug() << "QOpenGLPaintEnginePrivate: Drawing polygon using stencil method (no fragment programs)"; // Enable stencil func. glStencilFunc(GL_NOTEQUAL, 0, stencilMask); + glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE); #ifndef QT_OPENGL_ES glBegin(GL_QUADS); glVertex2f(min_x, min_y); @@ -2261,24 +2263,6 @@ void QOpenGLPaintEnginePrivate::fillVertexArray(Qt::FillRule fillRule) #endif } - glStencilMask(~0); - glStencilFunc(GL_ALWAYS, 0, 0); - glStencilOp(GL_ZERO, GL_ZERO, GL_ZERO); - - // clear all stencil values to 0 - glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); - -#ifndef QT_OPENGL_ES - glBegin(GL_QUADS); - glVertex2f(min_x, min_y); - glVertex2f(max_x, min_y); - glVertex2f(max_x, max_y); - glVertex2f(min_x, max_y); - glEnd(); -#endif - - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - // Disable stencil writes. glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); glStencilMask(0); -- cgit v0.12 From ad679a7993042f1df8da8c2d90d325be3cf0113d Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Fri, 15 May 2009 18:51:54 +1000 Subject: Fix syntax error in demos.pro. Reviewed-by: Lincoln Ramsay --- demos/demos.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/demos.pro b/demos/demos.pro index 9248ab8..6084550 100644 --- a/demos/demos.pro +++ b/demos/demos.pro @@ -30,7 +30,7 @@ contains(QT_BUILD_PARTS, tools):{ wince*: SUBDIRS += demos_sqlbrowser } } -contains(QT_CONFIG, phonon)!static:SUBDIRS += demos_mediaplayer +contains(QT_CONFIG, phonon):!static:SUBDIRS += demos_mediaplayer contains(QT_CONFIG, webkit):contains(QT_CONFIG, svg):SUBDIRS += demos_browser # install -- cgit v0.12 From 9c3f5040bc9b80619ebe167c352ac8f0394f9b41 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 15 May 2009 11:43:09 +0200 Subject: Cleaning bug in custom layout example. The example was using deleteAllItems() to delete items from the layout. This method is now part of the QT3_SUPPORT and shold not be used if not needed. Replaced by deleting all items one by one. Task-number: 220656 Rev-by: janarve --- doc/src/layout.qdoc | 6 +++--- doc/src/snippets/code/doc_src_layout.qdoc | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/src/layout.qdoc b/doc/src/layout.qdoc index 196999b..d97fcfc 100644 --- a/doc/src/layout.qdoc +++ b/doc/src/layout.qdoc @@ -343,9 +343,9 @@ \snippet doc/src/snippets/code/doc_src_layout.qdoc 4 The layout takes over responsibility of the items added. Since QLayoutItem - does not inherit QObject, we must delete the items manually. The function - QLayout::deleteAllItems() uses \c{takeAt()} defined above to delete all the - items in the layout. + does not inherit QObject, we must delete the items manually. In the + destructor, we remove each item from the list using \c{takeAt()}, and + then delete it. \snippet doc/src/snippets/code/doc_src_layout.qdoc 5 diff --git a/doc/src/snippets/code/doc_src_layout.qdoc b/doc/src/snippets/code/doc_src_layout.qdoc index fedcf0c..60f36b0 100644 --- a/doc/src/snippets/code/doc_src_layout.qdoc +++ b/doc/src/snippets/code/doc_src_layout.qdoc @@ -67,7 +67,9 @@ void CardLayout::addItem(QLayoutItem *item) //! [5] CardLayout::~CardLayout() { - deleteAllItems(); + QLayoutItem *item; + while ((item = takeAt(0))) + delete item; } //! [5] @@ -121,4 +123,4 @@ QSize CardLayout::minimumSize() const } return s + n*QSize(spacing(), spacing()); } -//! [7] \ No newline at end of file +//! [7] -- cgit v0.12 From d216c0fd62a879fd1eb84e087f70c7f542d75d58 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 14 May 2009 11:21:25 +0200 Subject: HTTP authentication: return error if authentication cannot be handled return error upon receiving an unknown authentication method (e.g. WSSE); before we were just silently returning. Reviewed-by: Thiago Macieira --- src/network/access/qhttpnetworkconnection.cpp | 20 +++++++--- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 52 ++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 5 deletions(-) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index f558f2b..ae518df 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -643,10 +643,21 @@ void QHttpNetworkConnectionPrivate::handleStatus(QAbstractSocket *socket, QHttpN switch (statusCode) { case 401: case 407: - handleAuthenticateChallenge(socket, reply, (statusCode == 407), resend); - if (resend) { - eraseData(reply); - sendRequest(socket); + if (handleAuthenticateChallenge(socket, reply, (statusCode == 407), resend)) { + if (resend) { + eraseData(reply); + sendRequest(socket); + } + } else { + int i = indexOf(socket); + emit channels[i].reply->headerChanged(); + emit channels[i].reply->readyRead(); + QNetworkReply::NetworkError errorCode = (statusCode == 407) + ? QNetworkReply::ProxyAuthenticationRequiredError + : QNetworkReply::AuthenticationRequiredError; + reply->d_func()->errorString = errorDetail(errorCode, socket); + emit q->error(errorCode, reply->d_func()->errorString); + emit channels[i].reply->finished(); } break; default: @@ -749,7 +760,6 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket // authentication is cancelled, send the current contents to the user. emit channels[i].reply->headerChanged(); emit channels[i].reply->readyRead(); - emit channels[i].reply->finished(); QNetworkReply::NetworkError errorCode = isProxy ? QNetworkReply::ProxyAuthenticationRequiredError diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 4be0863..bb199b9 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -217,6 +217,8 @@ private Q_SLOTS: void httpProxyCommands_data(); void httpProxyCommands(); void proxyChange(); + void authorizationError_data(); + void authorizationError(); }; QT_BEGIN_NAMESPACE @@ -3012,5 +3014,55 @@ void tst_QNetworkReply::proxyChange() QVERIFY(int(reply3->error()) > 0); } +void tst_QNetworkReply::authorizationError_data() +{ + + QTest::addColumn("url"); + QTest::addColumn("errorSignalCount"); + QTest::addColumn("finishedSignalCount"); + QTest::addColumn("error"); + QTest::addColumn("httpStatusCode"); + QTest::addColumn("httpBody"); + + QTest::newRow("unknown-authorization-method") << "http://" + QtNetworkSettings::serverName() + + "/cgi-bin/http-unknown-authentication-method.cgi?401-authorization-required" << 1 << 1 + << int(QNetworkReply::AuthenticationRequiredError) << 401 << "authorization required"; + QTest::newRow("unknown-proxy-authorization-method") << "http://" + QtNetworkSettings::serverName() + + "/cgi-bin/http-unknown-authentication-method.cgi?407-proxy-authorization-required" << 1 << 1 + << int(QNetworkReply::ProxyAuthenticationRequiredError) << 407 + << "authorization required"; +} + +void tst_QNetworkReply::authorizationError() +{ + QFETCH(QString, url); + QNetworkRequest request(url); + QNetworkReplyPtr reply = manager.get(request); + + QCOMPARE(reply->error(), QNetworkReply::NoError); + + qRegisterMetaType("QNetworkReply::NetworkError"); + QSignalSpy errorSpy(reply, SIGNAL(error(QNetworkReply::NetworkError))); + QSignalSpy finishedSpy(reply, SIGNAL(finished())); + // now run the request: + connect(reply, SIGNAL(finished()), + &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(!QTestEventLoop::instance().timeout()); + + QFETCH(int, errorSignalCount); + QCOMPARE(errorSpy.count(), errorSignalCount); + QFETCH(int, finishedSignalCount); + QCOMPARE(finishedSpy.count(), finishedSignalCount); + QFETCH(int, error); + QCOMPARE(reply->error(), QNetworkReply::NetworkError(error)); + + QFETCH(int, httpStatusCode); + QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), httpStatusCode); + + QFETCH(QString, httpBody); + QCOMPARE(QString(reply->readAll()), httpBody); +} + QTEST_MAIN(tst_QNetworkReply) #include "tst_qnetworkreply.moc" -- cgit v0.12 From 3875cd2b0a81c190939ea2803a2efbe890ae38ec Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 15 May 2009 14:53:23 +0200 Subject: Cocoa: Window flickers when resized with a QTabWidget Seems like we were not using the correct functions for setting the max/min size on a cocoa window. The version we used before included the unified toolbar, which is wrong. The new one does not. Task-number: 252642 Reviewed-by: Trenton Schulz --- src/gui/kernel/qwidget_mac.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 0e021dc..f863428 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -4035,8 +4035,8 @@ void QWidgetPrivate::applyMaxAndMinSizeOnWindow() NSSize max = NSMakeSize(SF(extra->maxw), SF(extra->maxh)); NSSize min = NSMakeSize(SF(extra->minw), SF(extra->minh)); #undef SF - [qt_mac_window_for(q) setMinSize:min]; - [qt_mac_window_for(q) setMaxSize:max]; + [qt_mac_window_for(q) setContentMinSize:min]; + [qt_mac_window_for(q) setContentMaxSize:max]; #endif } -- cgit v0.12 From a830e5f22a42d00b0b92544cfcb56c79b2c3b6cd Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Fri, 15 May 2009 15:20:35 +0200 Subject: Doc: Updated description of QMainWindow::unifiedTitleAndToolBarOnMac to include info on Cocoa. Task-number: 252658 Reviewed-by: Trenton Schulz --- src/gui/widgets/qmainwindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 502c1e9..558ba42 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -1408,10 +1408,10 @@ bool QMainWindow::event(QEvent *event) This property is false by default and only has any effect on Mac OS X 10.4 or higher. - If set to true, then the top toolbar area is replaced with a Carbon - HIToolbar and all toolbars in the top toolbar area are moved to that. Any - toolbars added afterwards will also be added to the Carbon HIToolbar. This - means a couple of things. + If set to true, then the top toolbar area is replaced with a Carbon HIToolbar + or a Cocoa NSToolbar (depending on whether Qt was built with Carbon or Cocoa). + All toolbars in the top toolbar area and any toolbars added afterwards are + moved to that. This means a couple of things. \list \i QToolBars in this toolbar area are not movable and you cannot drag other -- cgit v0.12 From 4573bc08a280be8f8dfd4659146b6d4b1afc185a Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Fri, 15 May 2009 15:38:35 +0200 Subject: Initialize variable to avoid valgrind error. For some reason it's only sometimes hit and cannot be deterministically reproduced. Task-number: 253722 Reviewed-by: TrustMe --- src/xmlpatterns/expr/qxsltsimplecontentconstructor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xmlpatterns/expr/qxsltsimplecontentconstructor.cpp b/src/xmlpatterns/expr/qxsltsimplecontentconstructor.cpp index ef77c76..104c5cc 100644 --- a/src/xmlpatterns/expr/qxsltsimplecontentconstructor.cpp +++ b/src/xmlpatterns/expr/qxsltsimplecontentconstructor.cpp @@ -105,7 +105,7 @@ Item XSLTSimpleContentConstructor::evaluateSingleton(const DynamicContext::Ptr & QString result; bool previousIsText = false; - bool discard; + bool discard = false; if(next) { -- cgit v0.12 From b3db2368b63f3d7f0a8abbb0620232d8aa079ad7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 15 May 2009 17:01:51 +0200 Subject: Adapted uic test-baseline to the icon generation change 251248) Task-number: 251248 --- tests/auto/uic/baseline/languagesdialog.ui.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/auto/uic/baseline/languagesdialog.ui.h b/tests/auto/uic/baseline/languagesdialog.ui.h index a0b9cae..fbe57ca 100644 --- a/tests/auto/uic/baseline/languagesdialog.ui.h +++ b/tests/auto/uic/baseline/languagesdialog.ui.h @@ -1,8 +1,8 @@ /******************************************************************************** ** Form generated from reading ui file 'languagesdialog.ui' ** -** Created: Mon Jun 16 17:57:32 2008 -** by: Qt User Interface Compiler version 4.5.0 +** Created: Fri May 15 16:58:03 2009 +** by: Qt User Interface Compiler version 4.5.2 ** ** WARNING! All changes made in this file will be lost when recompiling ui file! ********************************************************************************/ @@ -57,7 +57,7 @@ public: upButton->setObjectName(QString::fromUtf8("upButton")); upButton->setEnabled(false); QIcon icon; - icon.addPixmap(QPixmap(QString::fromUtf8(":/images/up.png")), QIcon::Normal, QIcon::Off); + icon.addFile(QString::fromUtf8(":/images/up.png"), QSize(), QIcon::Normal, QIcon::Off); upButton->setIcon(icon); hboxLayout->addWidget(upButton); @@ -66,7 +66,7 @@ public: downButton->setObjectName(QString::fromUtf8("downButton")); downButton->setEnabled(false); QIcon icon1; - icon1.addPixmap(QPixmap(QString::fromUtf8(":/images/down.png")), QIcon::Normal, QIcon::Off); + icon1.addFile(QString::fromUtf8(":/images/down.png"), QSize(), QIcon::Normal, QIcon::Off); downButton->setIcon(icon1); hboxLayout->addWidget(downButton); @@ -75,7 +75,7 @@ public: removeButton->setObjectName(QString::fromUtf8("removeButton")); removeButton->setEnabled(false); QIcon icon2; - icon2.addPixmap(QPixmap(QString::fromUtf8(":/images/editdelete.png")), QIcon::Normal, QIcon::Off); + icon2.addFile(QString::fromUtf8(":/images/editdelete.png"), QSize(), QIcon::Normal, QIcon::Off); removeButton->setIcon(icon2); hboxLayout->addWidget(removeButton); @@ -84,7 +84,7 @@ public: openFileButton->setObjectName(QString::fromUtf8("openFileButton")); openFileButton->setEnabled(true); QIcon icon3; - icon3.addPixmap(QPixmap(QString::fromUtf8(":/images/mac/fileopen.png")), QIcon::Normal, QIcon::Off); + icon3.addFile(QString::fromUtf8(":/images/mac/fileopen.png"), QSize(), QIcon::Normal, QIcon::Off); openFileButton->setIcon(icon3); hboxLayout->addWidget(openFileButton); -- cgit v0.12 From 97d0f8f43db98e1c5ae49bd32dfc027e6d3a1349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Mon, 18 May 2009 09:59:06 +0200 Subject: Fixed a bug which implicitly closed perspective transformed poly lines. When the end point of a line in a path is clipped, only closed paths should have the closing line. Task-number: 253663 Reviewed-by: Samuel --- src/gui/painting/qtransform.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index 2383272..cec2d16 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -1355,7 +1355,8 @@ static inline QHomogeneousCoordinate mapHomogeneous(const QTransform &transform, return c; } -static inline bool lineTo_clipped(QPainterPath &path, const QTransform &transform, const QPointF &a, const QPointF &b, bool needsMoveTo) +static inline bool lineTo_clipped(QPainterPath &path, const QTransform &transform, const QPointF &a, const QPointF &b, + bool needsMoveTo, bool needsLineTo = true) { QHomogeneousCoordinate ha = mapHomogeneous(transform, a); QHomogeneousCoordinate hb = mapHomogeneous(transform, b); @@ -1388,7 +1389,8 @@ static inline bool lineTo_clipped(QPainterPath &path, const QTransform &transfor if (needsMoveTo) path.moveTo(ha.toPoint()); - path.lineTo(hb.toPoint()); + if (needsLineTo) + path.lineTo(hb.toPoint()); return true; } @@ -1455,7 +1457,7 @@ static QPainterPath mapProjective(const QTransform &transform, const QPainterPat } if (path.elementCount() > 0 && lastMoveTo != last) - lineTo_clipped(result, transform, last, lastMoveTo, needsMoveTo); + lineTo_clipped(result, transform, last, lastMoveTo, needsMoveTo, false); return result; } -- cgit v0.12 From 8dfb09c26d228388fba5318b6f61b4edbf67cdc2 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 18 May 2009 10:55:52 +0200 Subject: Updated German translations for 4.5.2 --- translations/assistant_de.qm | Bin 20332 -> 18688 bytes translations/assistant_de.ts | 110 +++++++------ translations/designer_de.qm | Bin 152455 -> 151189 bytes translations/designer_de.ts | 12 +- translations/linguist_de.qm | Bin 47074 -> 45915 bytes translations/linguist_de.ts | 365 ++++++++++++++++++++++--------------------- translations/qt_de.qm | Bin 181913 -> 181348 bytes translations/qt_de.ts | 110 ++++++------- translations/qt_help_de.qm | Bin 9381 -> 9583 bytes translations/qt_help_de.ts | 2 +- 10 files changed, 300 insertions(+), 299 deletions(-) diff --git a/translations/assistant_de.qm b/translations/assistant_de.qm index 54146f6..5b31aea 100644 Binary files a/translations/assistant_de.qm and b/translations/assistant_de.qm differ diff --git a/translations/assistant_de.ts b/translations/assistant_de.ts index 0411ef1..9b0d628 100644 --- a/translations/assistant_de.ts +++ b/translations/assistant_de.ts @@ -163,7 +163,7 @@ CentralWidget - + Add new page Neue Seite hinzufügen @@ -173,38 +173,38 @@ Aktuelle Seite schließen - + Print Document Drucken - + unknown unbekannt - + Add New Page Neue Seite hinzufügen - + Close This Page Aktuelle Seite schließen - + Close Other Pages Andere Seiten schließen - + Add Bookmark for this Page... Lesezeichen für diese Seite hinzufügen... - + Search Suchen @@ -242,17 +242,17 @@ FindWidget - + Previous Vorherige - + Next Nächste - + Case Sensitive Gross/ Kleinschreibung beachten @@ -298,7 +298,7 @@ HelpViewer - + Help Hilfe @@ -329,12 +329,12 @@ Link in neuem Tab öffnen - + Open Link in New Tab Link in neuem Tab öffnen - + Unable to launch external application. Fehler beim Starten der externen Anwendung. @@ -463,38 +463,37 @@ MainWindow - + Index Index - - + + Contents Inhalt - - + + Bookmarks Lesezeichen - - + Search Suchen - - - + + + Qt Assistant Qt Assistant - - + + Unfiltered Ohne Filter @@ -718,7 +717,7 @@ Navigationsleiste - + Toolbars Werkzeugleisten @@ -743,7 +742,7 @@ Adresse: - + Could not find the associated content item. Der zugehörige Inhaltseintrag konnte nicht gefunden werden. @@ -769,12 +768,12 @@ Über %1 - + Updating search index Suchindex wird aufgebaut - + Looking for Qt Documentation... Suche nach Qt Dokumentationen... @@ -862,46 +861,45 @@ Von Helpserver herunterladen... - - - + + Add Documentation Dokumentation hinzufügen - + Qt Compressed Help Files (*.qch) Komprimierte Hilfe Dateien (*.qch) - + The specified file is not a valid Qt Help File! Die angegebene Datei ist keine Qt Hilfe Datei! - + The namespace %1 is already registered! Der Namespace %1 ist bereits registriert! - + Remove Documentation - + Dokumentation entfernen Some documents currently opened in Assistant reference the documentation you are attempting to remove. Removing the documentation will close those documents. - + Einige der gegenwärtig geöffneten Dokumente stammen aus der Dokumentation, die Sie gerade zu löschen versuchen. Sie werden beim Löschen geschlossen. Cancel - Abbrechen + Abbrechen OK - OK + OK @@ -1000,22 +998,22 @@ Options - + Einstellungen Current Page - + Aktuelle Seite Restore to default - + Vorgabe wiederherstellen Homepage - + Startseite @@ -1025,7 +1023,7 @@ Neuer Ordner - + The specified collection file does not exist! Die angegeben Katalogdatei (collection file) konnte nicht gefunden werden! @@ -1073,10 +1071,10 @@ Missing filter argument! - + Das Filter-Argument fehlt! - + Unknown option: %1 Unbekannte Option: %1 @@ -1087,7 +1085,7 @@ Qt Assistant - + Could not register documentation file %1 @@ -1115,9 +1113,9 @@ Reason: Dokumentation erfolgreich entfernt. - + Cannot load sqlite database driver! - + Der Datenbanktreiber für SQLite kann nicht geladen werden! @@ -1147,7 +1145,7 @@ Reason: SearchWidget - + &Copy &Kopieren @@ -1157,20 +1155,18 @@ Reason: &Link Adresse kopieren - - + Open Link in New Tab Link in neuem Tab öffnen - + Select All Alles markieren - Open Link - Link öffnen + Link öffnen diff --git a/translations/designer_de.qm b/translations/designer_de.qm index d51c51d..f9b0a03 100644 Binary files a/translations/designer_de.qm and b/translations/designer_de.qm differ diff --git a/translations/designer_de.ts b/translations/designer_de.ts index 4cd9914..002fc8d 100644 --- a/translations/designer_de.ts +++ b/translations/designer_de.ts @@ -339,7 +339,7 @@ ate the goose who was loose. Change signal-slot connection - + Signale-Slotverbindung ändern @@ -1384,7 +1384,7 @@ ate the goose who was loose. Plugin Information - Plugins + Plugins @@ -4026,7 +4026,7 @@ Möchten Sie sie überschreiben? Go to slot... - Slot anzeigen... + Slot anzeigen... @@ -5963,14 +5963,14 @@ Please select another name. Detailansicht - + Object: %1 Class: %2 Objekt: %1 Klasse: %2 - + Sorting Sortiert @@ -5980,7 +5980,7 @@ Klasse: %2 Farbige Hervorhebung - + Configure Property Editor Anzeige der Eigenschaften konfigurieren diff --git a/translations/linguist_de.qm b/translations/linguist_de.qm index f411122..a39c3bf 100644 Binary files a/translations/linguist_de.qm and b/translations/linguist_de.qm differ diff --git a/translations/linguist_de.ts b/translations/linguist_de.ts index 712f75d..cb8e4d2 100644 --- a/translations/linguist_de.ts +++ b/translations/linguist_de.ts @@ -6,7 +6,7 @@ (New Entry) - + (Neuer Eintrag) @@ -29,7 +29,7 @@ Batch Translation of '%1' - Qt Linguist - + Automatische Übersetzung von '%1' - Qt Linguist @@ -57,62 +57,62 @@ Qt Linguist - Batch Translation - Qt Linguist - Automatische Übersetzung + Qt Linguist - Automatische Übersetzung Options - Optionen + Optionen Set translated entries to finished - Markiere Übersetzung als erledigt + Markiere Übersetzung als erledigt Retranslate entries with existing translation - + Einträge mit bereits existierender Übersetzung neu übersetzen Note that the modified entries will be reset to unfinished if 'Set translated entries to finished' above is unchecked. - + Beachten Sie, dass die geänderten Einträge in den Status 'unerledigt' zurückgesetzt werden, wenn 'Markiere Übersetzung als erledigt' deaktiviert ist. Translate also finished entries - + Erledigte Einträge übersetzen Phrase book preference - Wörterbücher + Wörterbücher Move up - Nach oben + Nach oben Move down - Nach unten + Nach unten The batch translator will search through the selected phrase books in the order given above. - + Der automatische Übersetzer wird in der angegebenen Reihenfolge durch die ausgewählten Wörterbücher gehen. &Run - &Ausführen + &Ausführen Cancel - Abbrechen + Abbrechen @@ -120,38 +120,39 @@ <qt>Duplicate messages found in '%1': - + <qt>Mehrfach vorhandene Meldungen in '%1': <p>[more duplicates omitted] - + <p>[weitere mehrfach vorhandene Nachrichten weggelassen] <p>* Context: %1<br>* Source: %2 - + <p>* Kontext: %1<br>* Quelle: %2 <br>* Comment: %3 - + <br>* Kommentar: %3 Linguist does not know the plural rules for '%1'. Will assume a single universal form. - + Die Regeln zur Pluralbildung der Sprache '%1' sind in Linguist nicht definiert. +Es wird mit einer einfachen Universalform gearbeitet. Cannot create '%2': %1 - + '%2' kann nicht erzeugt werden: %1 Universal Form - + Universalform @@ -239,7 +240,7 @@ Will assume a single universal form. Translation does not contain the necessary %n place marker. - + Der erforderliche Platzhalter (%n) fehlt in der Übersetzung. @@ -311,37 +312,37 @@ Will assume a single universal form. Find - + Suchen &Find what: - + &Suchmuster: &Source texts - + &Quelltexte &Translations - + &Übersetzungen &Match case - + &Groß-/Kleinschreibung beachten &Comments - + &Kommentare Ignore &accelerators - + Tastenkürzel &ignorieren @@ -612,102 +613,102 @@ p, li { white-space: pre-wrap; } Previous unfinished item. - + Vorherige Unerledigte Move to the previous unfinished item. - + Gehe zum vorangehenden unerledigten Eintrag. Next unfinished item. - + Nächste Unerledigte Move to the next unfinished item. - + Gehe zum nächsten unerledigten Eintrag. Move to previous item. - + Gehe zum vorigen Eintrag. Move to the previous item. - + Gehe zum vorigen Eintrag. Next item. - + Nächster EIntrag. Move to the next item. - + Gehe zum nächsten Eintrag. Mark item as done and move to the next unfinished item. - + Markiere Eintrag als erledigt und gehe zum nächsten unerledigten Eintrag. Mark this item as done and move to the next unfinished item. - + Markiert diesen Eintrag als erledigt und geht zum nächsten unerledigten Eintrag. Copy from source text - + Übernehme &Ursprungstext Toggle the validity check of accelerators. - + Schalte Prüfung der Tastenkürzel um. Toggle the validity check of accelerators, i.e. whether the number of ampersands in the source and translation text is the same. If the check fails, a message is shown in the warnings window. - + Schalte Prüfung der Tastenkürzel um; das heisst, die Übereinstimmung der kaufmännischen Und-Zeichen in Quelle und Übersetzung. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt. Toggle the validity check of ending punctuation. - + Schalte Prüfung der Satzendezeichen am Ende des Textes um. Toggle the validity check of ending punctuation. If the check fails, a message is shown in the warnings window. - + Schaltet die Prüfung der Satzendezeichen am Ende des Textes um. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt. Toggle checking that phrase suggestions are used. If the check fails, a message is shown in the warnings window. - + Schaltet die Prüfung der Verwendung der Wörterbuchvorschläge um. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt. Toggle the validity check of place markers. - + Schaltet die Prüfung der Platzhalter um. Toggle the validity check of place markers, i.e. whether %1, %2, ... are used consistently in the source text and translation text. If the check fails, a message is shown in the warnings window. - + Schaltet die Prüfung der Platzhalter um; das heisst, ob %1, %2,... in Quelltext und Übersetzung übereinstimmend verwendet werden. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt. Open Read-O&nly... - + Schr&eibgeschützt öffnen... &Save All - + &Alles Speichern @@ -767,22 +768,22 @@ p, li { white-space: pre-wrap; } Recently Opened &Files - + Zu&letzt bearbeitete Dateien Save - + Speichern Print a list of all the translation units in the current translation source file. - + Liste aller Übersetzungseinheiten in der aktuellen Übersetzungsdatei drucken. Undo the last editing operation performed on the current translation. - + Mache die letzte Änderung an der Übersetzung rückgängig. @@ -902,12 +903,12 @@ p, li { white-space: pre-wrap; } Close - Schließen + Schließen &Close All - + A&lle schließen @@ -1170,49 +1171,49 @@ p, li { white-space: pre-wrap; } Source text - Ursprungstext + Ursprungstext Index - Index + Index Context - Kontext + Kontext Items - Einträge + Einträge This panel lists the source contexts. - Dieser Bereich zeigt die Kontexte an. + Dieser Bereich zeigt die Kontexte an. Strings - Zeichenketten + Zeichenketten Phrases and guesses - Wörterbuch und Vorschläge + Wörterbuch und Vorschläge Sources and Forms - + Quelldateien und Formulare Warnings - Warnungen + Hinweise @@ -1223,120 +1224,124 @@ p, li { white-space: pre-wrap; } Loading... - Lade... + Lade... Loading File - Qt Linguist - + Laden - Qt Linguist The file '%1' does not seem to be related to the currently open file(s) '%2'. Close the open file(s) first? - + Die Datei '%1' scheint nicht zu den bereits geöffneten Dateien '%2' zu passen. + +Sollen die bereits geöffneten Dateien vorher geschlossen werden? The file '%1' does not seem to be related to the file '%2' which is being loaded as well. Skip loading the first named file? - + Die Datei '%1' scheint nicht zu der Datei '%2' zu passen, die ebenfalls geladen wird. + +Soll die erstgenannte Datei übersprungen werden? %n translation unit(s) loaded. - - - + + Eine Übersetzungseinheit geladen. + %n Übersetzungseinheiten geladen. Related files (%1);; - + Verwandte Dateien (%1);; Open Translation Files - + Übersetzungsdateien öffnen File saved. - Datei gespeichert. + Datei gespeichert. Release - Freigeben + Freigeben Qt message files for released applications (*.qm) All files (*) - Qt Nachrichtendateien (*.qm) + Qt Nachrichtendateien (*.qm) Alle Dateien (*) File created. - Datei erzeugt. + Datei erzeugt. Printing... - Drucke... + Drucke... Context: %1 - Kontext: %1 + Kontext: %1 finished - erledigt + erledigt unresolved - ungelöst + ungelöst obsolete - veraltet + veraltet Printing... (page %1) - Drucke... (Seite %1) + Drucke... (Seite %1) Printing completed - Drucken beendet + Drucken beendet Printing aborted - Drucken abgebrochen + Drucken abgebrochen Search wrapped. - Suche beginnt von oben. + Suche beginnt von oben. @@ -1356,7 +1361,7 @@ Alle Dateien (*) Cannot find the string '%1'. - Kann Zeichenkette '%1' nicht finden. + Kann Zeichenkette '%1' nicht finden. Translated %n entries to '%1' @@ -1368,59 +1373,59 @@ Alle Dateien (*) Search And Translate in '%1' - Qt Linguist - + Suchen und übersetzen '%1' - Qt Linguist Translate - Qt Linguist - + Übersetzung - Qt Linguist Translated %n entry(s) - - - + + Ein Eintrag übersetzt + %n Einträge übersetzt No more occurrences of '%1'. Start over? - + Keine weiteren Fundstellen von '%1'. Von vorn beginnen? Create New Phrase Book - Erzeugen eines neuen Wörterbuchs + Erzeugen eines neuen Wörterbuchs Qt phrase books (*.qph) All files (*) - Qt Wörterbücher (*.qph) + Qt Wörterbücher (*.qph) Alle Dateien (*) Phrase book created. - Wörterbuch erzeugt. + Wörterbuch erzeugt. Open Phrase Book - Öffne Wörterbuch + Öffne Wörterbuch Qt phrase books (*.qph);;All files (*) - Qt Wörterbücher (*.qph);;Alle Dateien (*) + Qt Wörterbücher (*.qph);;Alle Dateien (*) %n phrase(s) loaded. - + Ein Wörterbucheintrag geladen. %n Wörterbucheinträge geladen. @@ -1430,32 +1435,32 @@ Alle Dateien (*) Add to phrase book - Hinzufügen zum Wörterbuch + Hinzufügen zum Wörterbuch No appropriate phrasebook found. - + Es wurde kein geeignetes Wörterbuch gefunden. Adding entry to phrasebook %1 - + Eintrag zu Wörterbuch %1 hinzufügen Select phrase book to add to - Zu welchem Wörterbuch soll der Eintrag hinzugefügt werden? + Zu welchem Wörterbuch soll der Eintrag hinzugefügt werden? Unable to launch Qt Assistant (%1) - Kann Qt Assistant nicht starten (%1) + Kann Qt Assistant nicht starten (%1) Version %1 - Version %1 + Version %1 Open Source Edition @@ -1464,17 +1469,17 @@ Alle Dateien (*) <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist is a tool for adding translations to Qt applications.</p><p>%2</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</p> - <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist ist ein Werkzeug zum Übersetzen von Qt Anwendungen.</p><p>%2</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</p> + <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist ist ein Werkzeug zum Übersetzen von Qt Anwendungen.</p><p>%2</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</p> Do you want to save the modified files? - + Möchten Sie die geänderten Dateien speichern? Do you want to save '%1'? - Wollen Sie '%1' speichern? + Möchten Sie '%1' speichern? @@ -1490,99 +1495,99 @@ Alle Dateien (*) No untranslated translation units left. - + Es wurden alle Übersetzungseinheiten abgearbeitet. &Window - &Fenster + &Fenster Minimize - Minimieren + Minimieren Ctrl+M - Ctrl+M + Display the manual for %1. - Zeige Handbuch für %1 an. + Zeige Handbuch für %1 an. Display information about %1. - Zeige Informationen über %1 an. + Zeige Informationen über %1 an. &Save '%1' - + '%1' &Speichern Save '%1' &As... - + Speichere '%1' &unter... Release '%1' - + '%1' freigeben Release '%1' As... - + Gebe '%1'frei unter ... &Close '%1' - + '%1' &Schließen &Close - &Schließen + &Schließen Save All - + Alles speichern &Release All - + Alles f&reigeben Close All - Alle schließen + Alle schließen Translation File &Settings for '%1'... - + Einstellungen der Übersetzungs&datei für '%1'... &Batch Translation of '%1'... - + &Automatische Übersetzung von '%1'... Search And &Translate in '%1'... - + Suchen und &Übersetzen in '%1'... Search And &Translate... - + Suchen und &Übersetzen... @@ -1617,37 +1622,37 @@ Alle Dateien (*) Cannot read from phrase book '%1'. - Kann Wörterbuch '%1' nicht lesen. + Kann Wörterbuch '%1' nicht lesen. Close this phrase book. - Schließe dieses Wörterbuch. + Schließe dieses Wörterbuch. Enables you to add, modify, or delete entries in this phrase book. - + Erlaubt das Hinzufügen, Ändern und Entfernen von Einträgen aus dem Wörterbuch. Print the entries in this phrase book. - + Drucke die Einträge des Wörterbuchs. Cannot create phrase book '%1'. - Kann Wörterbuch '%1' nicht erzeugen. + Kann Wörterbuch '%1' nicht erzeugen. Do you want to save phrase book '%1'? - + Möchten Sie das Wörterbuch '%1' speichern? All - + Alle @@ -1704,27 +1709,27 @@ Alle Dateien (*) German - Deutsch + Deutsch Japanese - Japanisch + Japanisch French - Französisch + Französisch Polish - Polnisch + Polnisch Chinese - Chinesisch + Chinesisch @@ -1732,59 +1737,59 @@ Alle Dateien (*) Dieser Bereich erlaubt die Darstellung und Änderung der Übersetzung eines Textes. - + Source text - Ursprungstext + Ursprungstext This area shows the source text. - Dieser Bereich zeigt den Ursprungstext. + Dieser Bereich zeigt den Ursprungstext. Source text (Plural) - + Ursprungstext (Plural) This area shows the plural form of the source text. - + Dieser Bereich zeigt die Pluralform des Ursprungstexts. Developer comments - + Hinweise des Entwicklers This area shows a comment that may guide you, and the context in which the text occurs. - Dieser Bereich zeigt eventuelle Kommentare und den Kontext, in dem der Text auftritt. + Dieser Bereich zeigt eventuelle Kommentare und den Kontext, in dem der Text auftritt. Here you can enter comments for your own use. They have no effect on the translated applications. - + Hier können Sie Hinweise für den eigenen Gebrauch eintragen. Diese haben keinen Einflusse auf die Übersetzung. %1 translation (%2) - Übersetzung %1 (%2) + Übersetzung %1 (%2) This is where you can enter or modify the translation of the above source text. - + Hier können Sie die Übersetzung des Ursprungstextes eingeben bzw. ändern. %1 translation - Übersetzung %1 + Übersetzung %1 %1 translator comments - + %1 Hinweise des Übersetzers @@ -1839,22 +1844,22 @@ Zeile: %2 Completion status for %1 - + Bearbeitungsstand von %1 <file header> - + <Dateikopf> <context comment> - + <Kontexthinweis> <unnamed context> - + <unbenannter Kontext> @@ -1867,7 +1872,7 @@ Zeile: %2 MsgEdit - + This is the right panel of the main window. @@ -1912,7 +1917,7 @@ Zeile: %2 This window allows you to add, modify, or delete entries in a phrase book. - + Dieses Fenster erlaubt das Hinzufügen, Ändern und Entfernen von Einträgen aus dem Wörterbuch. @@ -1952,22 +1957,22 @@ Zeile: %2 &New Entry - + &Neuer Eintrag Click here to remove the entry from the phrase book. - + Entferne den Eintrag aus dem Wörterbuch. &Remove Entry - + &Entferne Eintrag Settin&gs... - + &Einstellungen... &New Phrase @@ -2053,12 +2058,12 @@ Zeile: %2 Translation files (%1);; - + Übersetzungsdateien (%1);; All files (*) - + Alle Dateien (*) @@ -2074,57 +2079,57 @@ Zeile: %2 C++ source files - + C++-Quelltextdateien' Java source files - + Java-Quelltextdateien GNU Gettext localization files - + GNU-Gettext Übersetzungsdateien Qt Script source files - + Qt-Skript-Quelltextdateien Qt translation sources (format 1.1) - + Qt-Übersetzungsdateien (Formatversion 1.1) Qt translation sources (format 2.0) - + Qt-Übersetzungsdateien (Formatversion 2.0) Qt translation sources (latest format) - + Qt Übersetzungsdateien (aktuelles Format) Qt Designer form files - + Qt Designer Formulardateien Qt Jambi form files - + Qt Jambi Formulardateien XLIFF localization files - + XLIFF Übersetzungsdateien Qt Linguist 'Phrase Book' - + Qt Linguist-Wörterbuch @@ -2223,7 +2228,7 @@ Zeile: %2 Close - Schließen + Schließen @@ -2727,27 +2732,27 @@ Alle Dateien (*) Settings for '%1' - Qt Linguist - + Einstellungen für '%1' - Qt Linguist Source language - + Ursprungssprache Language - Sprache + Sprache Country/Region - Land/Region + Land/Region Target language - Zielsprache + Zielsprache diff --git a/translations/qt_de.qm b/translations/qt_de.qm index 5d68bf7..9ea09a7 100644 Binary files a/translations/qt_de.qm and b/translations/qt_de.qm differ diff --git a/translations/qt_de.ts b/translations/qt_de.ts index 70cf6f3..33f9ea8 100644 --- a/translations/qt_de.ts +++ b/translations/qt_de.ts @@ -22,7 +22,7 @@ CloseButton - + Close Tab Schließen @@ -186,7 +186,7 @@ Bitte prüfen Sie die Gstreamer-Installation und stellen Sie sicher, dass das Pa Q3FileDialog - + Copy or Move a File Datei kopieren oder verschieben @@ -203,7 +203,7 @@ Bitte prüfen Sie die Gstreamer-Installation und stellen Sie sicher, dass das Pa - + Cancel Abbrechen @@ -886,7 +886,7 @@ nach QApplication - + QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. LTR @@ -1170,7 +1170,7 @@ nach QDialogButtonBox - + OK @@ -1392,7 +1392,7 @@ nach Cannot remove source file - + Die Quelldatei kann nicht entfernt werden @@ -1418,8 +1418,8 @@ nach QFileDialog - - + + All Files (*) Alle Dateien (*) @@ -1448,7 +1448,7 @@ nach Datei - + Open Öffnen @@ -1458,26 +1458,26 @@ nach Speichern unter - + - + &Open &Öffnen - + &Save S&peichern - + Recent Places Zuletzt besucht - + &Rename &Umbenennen @@ -1492,17 +1492,17 @@ nach &Versteckte Dateien anzeigen - + New Folder Neues Verzeichnis - + Find Directory Verzeichnis suchen - + Directories Verzeichnisse @@ -1512,13 +1512,13 @@ nach Alle Dateien (*.*) - - + + Directory: Verzeichnis: - + %1 already exists. Do you want to replace it? Die Datei %1 existiert bereits. @@ -1552,7 +1552,7 @@ Stellen Sie sicher, dass der Dateiname richtig ist. - + %1 Directory not found. Please verify the correct directory name was given. @@ -1588,7 +1588,7 @@ Möchten sie die Datei trotzdem löschen? Unbekannt - + Show Anzeigen @@ -1604,19 +1604,19 @@ Möchten sie die Datei trotzdem löschen? &Neues Verzeichnis - + &Choose &Auswählen - + Remove Löschen - - + + File &name: Datei&name: @@ -1698,7 +1698,7 @@ Möchten sie die Datei trotzdem löschen? Änderungsdatum - + My Computer Mein Computer @@ -2161,7 +2161,7 @@ Möchten sie die Datei trotzdem löschen? QHttp - + Connection refused Verbindung verweigert @@ -2253,7 +2253,7 @@ Möchten sie die Datei trotzdem löschen? Unknown authentication method - + Unbekannte Authentifizierungsmethode @@ -2365,7 +2365,7 @@ Möchten sie die Datei trotzdem löschen? QIBaseDriver - + Error opening database Die Datenbankverbindung konnte nicht geöffnet werden @@ -2643,7 +2643,7 @@ Möchten sie die Datei trotzdem löschen? QLocalServer - + %1: Name error %1: Fehlerhafter Name @@ -2738,7 +2738,7 @@ Möchten sie die Datei trotzdem löschen? QMYSQLDriver - + Unable to open database ' Die Datenbankverbindung konnte nicht geöffnet werden ' @@ -2766,12 +2766,12 @@ Möchten sie die Datei trotzdem löschen? QMYSQLResult - + Unable to fetch data Es konnten keine Daten abgeholt werden - + Unable to execute query Die Abfrage konnte nicht ausgeführt werden @@ -2781,13 +2781,13 @@ Möchten sie die Datei trotzdem löschen? Das Ergebnis konnte nicht gespeichert werden - + Unable to prepare statement Der Befehl konnte nicht initialisiert werden - + Unable to reset statement Der Befehl konnte nicht zurückgesetzt werden @@ -2813,7 +2813,7 @@ Möchten sie die Datei trotzdem löschen? Die Ergebnisse des Befehls konnten nicht gespeichert werden - + Unable to execute next query Die folgende Abfrage kann nicht ausgeführt werden @@ -2971,7 +2971,7 @@ Möchten sie die Datei trotzdem löschen? <p>Dieses Programm verwendet Qt-Version %1.</p> - + Show Details... Details einblenden... @@ -2981,7 +2981,7 @@ Möchten sie die Datei trotzdem löschen? Details ausblenden... - + <h3>About Qt</h3><p>This program uses Qt version %1.</p><p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt is available under three different licensing options designed to accommodate the needs of our various users.</p>Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.</p><p>Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.</p><p>Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.</p><p>Please see <a href="http://www.qtsoftware.com/products/licensing">www.qtsoftware.com/products/licensing</a> for an overview of Qt licensing.</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>Qt is a Nokia product. See <a href="http://www.qtsoftware.com/qt/">www.qtsoftware.com/qt</a> for more information.</p> @@ -3310,7 +3310,7 @@ Möchten sie die Datei trotzdem löschen? QODBCDriver - + Unable to connect Es kann keine Verbindung aufgebaut werden @@ -3444,7 +3444,7 @@ Möchten sie die Datei trotzdem löschen? QPPDOptionsModel - + Name Name @@ -4009,7 +4009,7 @@ Bitte wählen Sie einen anderen Dateinamen. Benutzerdefiniert - + &Options >> &Einstellungen >> @@ -4030,7 +4030,7 @@ Bitte wählen Sie einen anderen Dateinamen. Druck in Postscript-Datei - + Local file Lokale Datei @@ -4040,7 +4040,7 @@ Bitte wählen Sie einen anderen Dateinamen. Schreiben der Datei %1 - + &Print &Drucken @@ -4373,7 +4373,7 @@ Bitte wählen Sie einen anderen Dateinamen. No program defined - + Es wurde kein Programm angegeben @@ -5985,7 +5985,7 @@ Bitte wählen Sie einen anderen Dateinamen. %1 (%2x%3 Pixel) - + Bad HTTP request Ungültige HTTP-Anforderung @@ -6077,15 +6077,15 @@ Bitte wählen Sie einen anderen Dateinamen. JavaScript Confirm - %1 - JavaScript-Bestätigung - %1 + JavaScript-Bestätigung - %1 JavaScript Prompt - %1 - JavaScript-Eingabeaufforderung - %1 + JavaScript-Eingabeaufforderung - %1 - + Move the cursor to the next character Positionsmarke auf folgendes Zeichen setzen @@ -6147,7 +6147,7 @@ Bitte wählen Sie einen anderen Dateinamen. Select all - + Alles auswählen @@ -6222,12 +6222,12 @@ Bitte wählen Sie einen anderen Dateinamen. Insert a new paragraph - + Neuen Abschnitt einfügen Insert a new line - + Neue Zeile einfügen @@ -6241,7 +6241,7 @@ Bitte wählen Sie einen anderen Dateinamen. QWidget - + * * @@ -6787,7 +6787,7 @@ Bitte wählen Sie einen anderen Dateinamen. %1 ist kein gültiger regulärer Ausdruck: %2 - + It will not be possible to retrieve %1. %1 kann nicht bestimmt werden. @@ -7508,7 +7508,7 @@ Bitte wählen Sie einen anderen Dateinamen. In a namespace constructor, the value for a namespace cannot be an empty string. - + Im Konstruktor eines Namensraums darf der Wert des Namensraumes keine leere Zeichenkette sein. diff --git a/translations/qt_help_de.qm b/translations/qt_help_de.qm index e28a97e..e3d8d87 100644 Binary files a/translations/qt_help_de.qm and b/translations/qt_help_de.qm differ diff --git a/translations/qt_help_de.ts b/translations/qt_help_de.ts index ed8a3c3..8f67ec3 100644 --- a/translations/qt_help_de.ts +++ b/translations/qt_help_de.ts @@ -39,7 +39,7 @@ Cannot load sqlite database driver! - + Der Datenbanktreiber für SQLite kann nicht geladen werden! -- cgit v0.12 From 44d0dbcc350ddd2ab3459aea78628409a1aef0d5 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Mon, 18 May 2009 10:48:11 +0200 Subject: Fix QSoundServer on Big-Endian machines. Task-number: 253619 Reviewed-by: Paul --- src/gui/embedded/qsoundqss_qws.cpp | 40 +++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/src/gui/embedded/qsoundqss_qws.cpp b/src/gui/embedded/qsoundqss_qws.cpp index c72ea91..283bbd3 100644 --- a/src/gui/embedded/qsoundqss_qws.cpp +++ b/src/gui/embedded/qsoundqss_qws.cpp @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -335,7 +336,13 @@ public: virtual int readySamples(int) = 0; int getSample(int off, int bps) { - return (bps == 1) ? (data[out+off] - 128) * 128 : ((short*)data)[(out/2)+off]; + + // + // 16-bit audio data is converted to native endian so that it can be scaled + // Yes, this is ugly on a BigEndian machine + // Perhaps it shouldn't be scaled at all + // + return (bps == 1) ? (data[out+off] - 128) * 128 : qToLittleEndian(((short*)data)[(out/2)+off]); } int add(int* mixl, int* mixr, int count) @@ -547,7 +554,7 @@ public: wavedata_remaining = 0; mFinishedRead = true; } else if ( qstrncmp(chunk.id,"data",4) == 0 ) { - wavedata_remaining = chunk.size; + wavedata_remaining = qToLittleEndian( chunk.size ); //out = max = sound_buffer_size; @@ -572,10 +579,23 @@ public: //qDebug("couldn't ready chunkdata"); mFinishedRead = true; } + #define WAVE_FORMAT_PCM 1 - else if ( chunkdata.formatTag != WAVE_FORMAT_PCM ) { - //qDebug("WAV file: UNSUPPORTED FORMAT %d",chunkdata.formatTag); - mFinishedRead = true; + else + { + /* + ** Endian Fix the chuck data + */ + chunkdata.formatTag = qToLittleEndian( chunkdata.formatTag ); + chunkdata.channels = qToLittleEndian( chunkdata.channels ); + chunkdata.samplesPerSec = qToLittleEndian( chunkdata.samplesPerSec ); + chunkdata.avgBytesPerSec = qToLittleEndian( chunkdata.avgBytesPerSec ); + chunkdata.blockAlign = qToLittleEndian( chunkdata.blockAlign ); + chunkdata.wBitsPerSample = qToLittleEndian( chunkdata.wBitsPerSample ); + if ( chunkdata.formatTag != WAVE_FORMAT_PCM ) { + qWarning("WAV file: UNSUPPORTED FORMAT %d",chunkdata.formatTag); + mFinishedRead = true; + } } } else { // ignored chunk @@ -1166,9 +1186,15 @@ bool QWSSoundServerPrivate::openDevice() if (ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &v)) qWarning("Could not set fragments to %08x",v); #ifdef QT_QWS_SOUND_16BIT - v=AFMT_S16_LE; if (ioctl(fd, SNDCTL_DSP_SETFMT, &v)) + // + // Use native endian + // Since we have manipulated the data volume the data + // is now in native format, even though its stored + // as little endian in the WAV file + // + v=AFMT_S16_NE; if (ioctl(fd, SNDCTL_DSP_SETFMT, &v)) qWarning("Could not set format %d",v); - if (AFMT_S16_LE != v) + if (AFMT_S16_NE != v) qDebug("Want format %d got %d", AFMT_S16_LE, v); #else v=AFMT_U8; if (ioctl(fd, SNDCTL_DSP_SETFMT, &v)) -- cgit v0.12 From 7133b932ac2af6e5a09323f09ee8024d0042bce3 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 18 May 2009 11:00:10 +0200 Subject: Made it possible to set string properties using QDesignerFormWindowCursor::setProperty. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensure the text does not get clobbered by the subproperty handling. Reviewed-by: Kai Köhne Task-number: 253278 --- tools/designer/src/lib/shared/qdesigner_propertycommand.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp b/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp index ff3b50b..94e8044 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp +++ b/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp @@ -316,6 +316,10 @@ Qt::Alignment variantToAlignment(const QVariant & q) // find changed subproperties of a variant unsigned compareSubProperties(const QVariant & q1, const QVariant & q2, qdesigner_internal::SpecialProperty specialProperty) { + // Do not clobber new value in the comparison function in + // case someone sets a QString on a PropertySheetStringValue. + if (q1.type() != q2.type()) + return SubPropertyAll; switch (q1.type()) { case QVariant::Rect: return compareSubProperties(q1.toRect(), q2.toRect()); -- cgit v0.12 From 76504e5e5ee51665ddd37d36e220c9266d84aa53 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 18 May 2009 11:06:06 +0200 Subject: Fixed a bug caused by forms with a sizepolicy of 'Fixed' on the main container. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restore 4.4 behaviour by using a QStackedLayout as the layout containing the actual form (as was in 4.4). The difference in behaviour was caused by insertion of an additional widget with a QVBoxLayout which is supposed to ease setting of inheritable properties (style, etc). Reviewed-by: Kai Köhne Task-number: 253236 --- tools/designer/src/components/formeditor/formwindow_widgetstack.cpp | 6 +++++- tools/designer/src/components/formeditor/formwindow_widgetstack.h | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/designer/src/components/formeditor/formwindow_widgetstack.cpp b/tools/designer/src/components/formeditor/formwindow_widgetstack.cpp index 7270628..58127b0 100644 --- a/tools/designer/src/components/formeditor/formwindow_widgetstack.cpp +++ b/tools/designer/src/components/formeditor/formwindow_widgetstack.cpp @@ -57,16 +57,20 @@ using namespace qdesigner_internal; FormWindowWidgetStack::FormWindowWidgetStack(QObject *parent) : QObject(parent), m_formContainer(new QWidget), - m_formContainerLayout(new QVBoxLayout), + m_formContainerLayout(new QStackedLayout), m_layout(new QStackedLayout) { m_layout->setMargin(0); m_layout->setSpacing(0); m_layout->setStackingMode(QStackedLayout::StackAll); + // We choose a QStackedLayout as immediate layout for + // the form windows as it ignores the sizePolicy of + // its child (for example, Fixed would cause undesired side effects). m_formContainerLayout->setMargin(0); m_formContainer->setObjectName(QLatin1String("formContainer")); m_formContainer->setLayout(m_formContainerLayout); + m_formContainerLayout->setStackingMode(QStackedLayout::StackAll); // System settings might have different background colors, autofill them // (affects for example mainwindow status bars) m_formContainer->setAutoFillBackground(true); diff --git a/tools/designer/src/components/formeditor/formwindow_widgetstack.h b/tools/designer/src/components/formeditor/formwindow_widgetstack.h index 92323c5..f21c4f0 100644 --- a/tools/designer/src/components/formeditor/formwindow_widgetstack.h +++ b/tools/designer/src/components/formeditor/formwindow_widgetstack.h @@ -51,7 +51,6 @@ QT_BEGIN_NAMESPACE class QDesignerFormWindowToolInterface; class QStackedLayout; -class QVBoxLayout; class QWidget; namespace qdesigner_internal { @@ -92,7 +91,7 @@ protected: private: QList m_tools; QWidget *m_formContainer; - QVBoxLayout *m_formContainerLayout; + QStackedLayout *m_formContainerLayout; QStackedLayout *m_layout; }; -- cgit v0.12 From cfcf72970cd58282aff9aac76f421915d287dc09 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 18 May 2009 11:27:13 +0200 Subject: Wrote Designer/uic changelog for 4.5.2. --- dist/changes-4.5.2 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index a772bf7..3180b7c 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -78,7 +78,17 @@ Qt for Windows CE - Designer - + * [248769] Fixed a bug affecting the display of keyboard shortcuts in + the detailed view of the action editor. + * [251092] Fixed a bug preventing entering local file names for QUrl-type + properties on Windows. + * [251691] Fixed dynamic re-translation of table headers. + * [252251] Improved readability of the property editor when using the + KDE Obsidian Coast theme. + * [253236] Fixed a regression bug triggered by forms with a size policy + of 'Fixed' on the main cointainer. + * [253278] Made it possible to set QString-type properties using + QDesignerFormWindowCursor::setProperty(). - Linguist - Linguist GUI @@ -95,7 +105,8 @@ Qt for Windows CE - uic - + * [252333] Fixed a regression crash triggered by using icons with + different pixmaps for QIcon states. - uic3 -- cgit v0.12 From 7008bfe80e0466ed2978b39e7e698bbd52fb690f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Mon, 18 May 2009 13:05:14 +0200 Subject: Fixed the SVG parser to handle CSS properties with multiple values. CSS properties with more than 1 value was ignored. E.g. the 'stroke-dasharray' attribute is specified by a comma separates list of numbers. This was previously ignored because the CSS parser split it into a value array. Task-number: 253614 Reviewed-by: Kim --- src/svg/qsvghandler.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 433a3ad..6a897e8 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -1673,10 +1673,19 @@ static void parseCSStoXMLAttrs(const QVector &declarations, const QCss::Declaration &decl = declarations.at(i); if (decl.d->property.isEmpty()) continue; - if (decl.d->values.count() != 1) - continue; QCss::Value val = decl.d->values.first(); - QString valueStr = val.toString(); + QString valueStr; + if (decl.d->values.count() != 1) { + for (int i=0; ivalues.count(); ++i) { + const QString &value = decl.d->values[i].toString(); + if (value.isEmpty()) + valueStr += QLatin1Char(','); + else + valueStr += value; + } + } else { + valueStr = val.toString(); + } if (val.type == QCss::Value::Uri) { valueStr.prepend(QLatin1String("url(")); valueStr.append(QLatin1Char(')')); -- cgit v0.12 From 6f81986c3e5022fb6a873c6d60bede460bf6a4dd Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 18 May 2009 14:33:03 +0200 Subject: Fix incorrect signal referred to in the docs Fix the documentation to state sortIndicatorChanged() should be used and not sectionClicked() for connecting to the sortByColumn() slot as the sortByColumn() takes two parameters, not one. Reviewed-by: Kavindra Palaraja --- doc/src/model-view-programming.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/model-view-programming.qdoc b/doc/src/model-view-programming.qdoc index bf0c1c8..8874cfa 100644 --- a/doc/src/model-view-programming.qdoc +++ b/doc/src/model-view-programming.qdoc @@ -249,7 +249,7 @@ provide an API that allows you to sort your model data programmatically. In addition, you can enable interactive sorting (i.e. allowing the users to sort the data by clicking the view's - headers), by connecting the QHeaderView::sectionClicked() signal + headers), by connecting the QHeaderView::sortIndicatorChanged() signal to the QTableView::sortByColumn() slot or the QTreeView::sortByColumn() slot, respectively. -- cgit v0.12 From 0ff3bb25df3626a8112def75fc3ff048c70ebdb2 Mon Sep 17 00:00:00 2001 From: jasplin Date: Mon, 18 May 2009 14:30:09 +0200 Subject: Fixed crash in QWizard running on old Windows systems. When compiling the QWizard on a Windows system where QT_NO_STYLE_WINDOWSVISTA is not set and running the app on an old system that has no Vista support, the app would crash in the paint event of the Vista Back button. In this scenario, the Vista Back button is not needed (i.e. the regular Back button next to the Next button is used), so the fix is simply to avoid instanciating it altogether. Reviewed-by: janarve Task-number: 252662 --- src/gui/dialogs/qwizard.cpp | 4 ++-- src/gui/dialogs/qwizard_win.cpp | 5 ++++- src/gui/dialogs/qwizard_win_p.h | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/dialogs/qwizard.cpp b/src/gui/dialogs/qwizard.cpp index 32395c4..298f23f 100644 --- a/src/gui/dialogs/qwizard.cpp +++ b/src/gui/dialogs/qwizard.cpp @@ -1465,7 +1465,7 @@ void QWizardPrivate::handleAeroStyleChange() return; // prevent recursion inHandleAeroStyleChange = true; - vistaHelper->backButton()->disconnect(); + vistaHelper->disconnectBackButton(); q->removeEventFilter(vistaHelper); if (isVistaThemeEnabled()) { @@ -1491,7 +1491,7 @@ void QWizardPrivate::handleAeroStyleChange() q->setMouseTracking(true); // ### original value possibly different q->unsetCursor(); // ### ditto antiFlickerWidget->move(0, 0); - vistaHelper->backButton()->hide(); + vistaHelper->hideBackButton(); vistaHelper->setTitleBarIconAndCaptionVisible(true); } diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp index 64696de..8aad4af 100644 --- a/src/gui/dialogs/qwizard_win.cpp +++ b/src/gui/dialogs/qwizard_win.cpp @@ -239,9 +239,11 @@ void QVistaBackButton::paintEvent(QPaintEvent *) QVistaHelper::QVistaHelper(QWizard *wizard) : pressed(false) , wizard(wizard) + , backButton_(0) { is_vista = resolveSymbols(); - backButton_ = new QVistaBackButton(wizard); + if (is_vista) + backButton_ = new QVistaBackButton(wizard); } QVistaHelper::~QVistaHelper() @@ -310,6 +312,7 @@ void QVistaHelper::drawTitleBar(QPainter *painter) QRect(0, 0, wizard->width(), titleBarSize() + topOffset()), painter->paintEngine()->getDC()); + Q_ASSERT(backButton_); const int btnTop = backButton_->mapToParent(QPoint()).y(); const int btnHeight = backButton_->size().height(); const int verticalCenter = (btnTop + btnHeight / 2); diff --git a/src/gui/dialogs/qwizard_win_p.h b/src/gui/dialogs/qwizard_win_p.h index cbb3b17..148be26 100644 --- a/src/gui/dialogs/qwizard_win_p.h +++ b/src/gui/dialogs/qwizard_win_p.h @@ -94,6 +94,8 @@ public: void resizeEvent(QResizeEvent *event); void paintEvent(QPaintEvent *event); QVistaBackButton *backButton() const { return backButton_; } + void disconnectBackButton() { if (backButton_) backButton_->disconnect(); } + void hideBackButton() { if (backButton_) backButton_->hide(); } void setWindowPosHack(); QColor basicWindowFrameColor(); enum VistaState { VistaAero, VistaBasic, Classic, Dirty }; -- cgit v0.12 From 6c16cb557205c8cf33bcf0493b3d9436c6f43236 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Mon, 18 May 2009 14:39:14 +0200 Subject: QCalendarWidget::setDateTextFormat() reset the format is the date is invalid According to the documentation, QCalendarWidget::setDateTextFormat() should reset the format if the date is not valid. New tests included for the formating of this widget. Task-number: 252943 Reviewed-by: Olivier --- src/gui/widgets/qcalendarwidget.cpp | 2 +- tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp | 53 ++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qcalendarwidget.cpp b/src/gui/widgets/qcalendarwidget.cpp index 92c12a5..4436c04 100644 --- a/src/gui/widgets/qcalendarwidget.cpp +++ b/src/gui/widgets/qcalendarwidget.cpp @@ -2791,7 +2791,7 @@ QTextCharFormat QCalendarWidget::dateTextFormat(const QDate &date) const void QCalendarWidget::setDateTextFormat(const QDate &date, const QTextCharFormat &format) { Q_D(QCalendarWidget); - if ( date.isNull() && !format.isValid() ) + if (date.isNull()) d->m_model->m_dateFormats.clear(); else d->m_model->m_dateFormats[date] = format; diff --git a/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp b/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp index 67a822f..617832b 100644 --- a/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp +++ b/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp @@ -47,6 +47,8 @@ #include #include #include +#include +#include //TESTED_CLASS= @@ -68,6 +70,11 @@ public slots: private slots: void getSetCheck(); void buttonClickCheck(); + + void setTextFormat(); + void resetTextFormat(); + + void setWeekdayFormat(); }; // Testing get/set functions @@ -215,6 +222,52 @@ void tst_QCalendarWidget::buttonClickCheck() } +void tst_QCalendarWidget::setTextFormat() +{ + QCalendarWidget calendar; + QTextCharFormat format; + format.setFontItalic(true); + format.setForeground(Qt::green); + + const QDate date(1984, 10, 20); + calendar.setDateTextFormat(date, format); + QCOMPARE(calendar.dateTextFormat(date), format); +} + +void tst_QCalendarWidget::resetTextFormat() +{ + QCalendarWidget calendar; + QTextCharFormat format; + format.setFontItalic(true); + format.setForeground(Qt::green); + + const QDate date(1984, 10, 20); + calendar.setDateTextFormat(date, format); + + calendar.setDateTextFormat(QDate(), QTextCharFormat()); + QCOMPARE(calendar.dateTextFormat(date), QTextCharFormat()); +} + +void tst_QCalendarWidget::setWeekdayFormat() +{ + QCalendarWidget calendar; + + QTextCharFormat format; + format.setFontItalic(true); + format.setForeground(Qt::green); + + calendar.setWeekdayTextFormat(Qt::Wednesday, format); + + // check the format of the a given month + for (int i = 1; i <= 31; ++i) { + const QDate date(1984, 10, i); + const Qt::DayOfWeek dayOfWeek = static_cast(date.dayOfWeek()); + if (dayOfWeek == Qt::Wednesday) + QCOMPARE(calendar.weekdayTextFormat(dayOfWeek), format); + else + QVERIFY(calendar.weekdayTextFormat(dayOfWeek) != format); + } +} tst_QCalendarWidget::tst_QCalendarWidget() { -- cgit v0.12 From 3c40b1af35319f1fd1b10c97b954adff3abbe9b0 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 15 May 2009 13:54:44 +0200 Subject: Fix race condition in ~QObject while using QOrderedMutexLocker::relock we might unlock our mutex protecting the 'senders' list for a short moment. Another thread may then modify or remove element on the list. Therefore, we need to recheck the consistency of the list once we did that. Also, we cannot call removeSender because that will remove every connections, making impossible for another object destroyed in the same time to clean up the senders list, so call derefSender instead. Reviewed-by: Brad --- src/corelib/kernel/qobject.cpp | 30 ++++------ src/corelib/kernel/qobject_p.h | 1 - tests/auto/qobjectrace/tst_qobjectrace.cpp | 89 ++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 20 deletions(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 05015c0..f1a1eb5 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -345,18 +345,6 @@ void QObjectPrivate::derefSender(QObject *sender, int signal) // Q_ASSERT_X(false, "QObjectPrivate::derefSender", "sender not found"); } -void QObjectPrivate::removeSender(QObject *sender, int signal) -{ - for (int i = 0; i < senders.count(); ++i) { - Sender &s = senders[i]; - if (s.sender == sender && s.signal == signal) { - senders.removeAt(i); - return; - } - } - // Q_ASSERT_X(false, "QObjectPrivate::removeSender", "sender not found"); -} - QObjectPrivate::Sender *QObjectPrivate::setCurrentSender(QObject *receiver, Sender *sender) { @@ -790,7 +778,7 @@ QObject::~QObject() bool needToUnlock = QOrderedMutexLocker::relock(locker.mutex(), m); c = &connectionList[i]; if (c->receiver) - c->receiver->d_func()->removeSender(this, signal); + c->receiver->d_func()->derefSender(this, signal); if (needToUnlock) m->unlock(); @@ -811,18 +799,22 @@ QObject::~QObject() } // disconnect all senders - for (int i = 0; i < d->senders.count(); ++i) { + for (int i = 0; i < d->senders.count(); ) { QObjectPrivate::Sender *s = &d->senders[i]; - if (!s->sender) - continue; QMutex *m = &s->sender->d_func()->threadData->mutex; bool needToUnlock = QOrderedMutexLocker::relock(locker.mutex(), m); - s = &d->senders[i]; - if (s->sender) - s->sender->d_func()->removeReceiver(s->signal, this); + if (m < locker.mutex()) { + if (i >= d->senders.count() || s != &d->senders[i]) { + if (needToUnlock) + m->unlock(); + continue; + } + } + s->sender->d_func()->removeReceiver(s->signal, this); if (needToUnlock) m->unlock(); + ++i; } d->senders.clear(); diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index b324334..0eed938 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -163,7 +163,6 @@ public: QList senders; void refSender(QObject *sender, int signal); void derefSender(QObject *sender, int signal); - void removeSender(QObject *sender, int signal); static Sender *setCurrentSender(QObject *receiver, Sender *sender); diff --git a/tests/auto/qobjectrace/tst_qobjectrace.cpp b/tests/auto/qobjectrace/tst_qobjectrace.cpp index 0c88f29..fcfd528 100644 --- a/tests/auto/qobjectrace/tst_qobjectrace.cpp +++ b/tests/auto/qobjectrace/tst_qobjectrace.cpp @@ -50,6 +50,7 @@ class tst_QObjectRace: public QObject Q_OBJECT private slots: void moveToThreadRace(); + void destroyRace(); }; class RaceObject : public QObject @@ -147,5 +148,93 @@ void tst_QObjectRace::moveToThreadRace() delete object; } + +class MyObject : public QObject +{ Q_OBJECT + public slots: + void slot1() { emit signal1(); } + void slot2() { emit signal2(); } + void slot3() { emit signal3(); } + void slot4() { emit signal4(); } + void slot5() { emit signal5(); } + void slot6() { emit signal6(); } + void slot7() { emit signal7(); } + signals: + void signal1(); + void signal2(); + void signal3(); + void signal4(); + void signal5(); + void signal6(); + void signal7(); +}; + + + +class DestroyThread : public QThread +{ + Q_OBJECT + QObject **objects; + int number; + +public: + void setObjects(QObject **o, int n) + { + objects = o; + number = n; + for(int i = 0; i < number; i++) + objects[i]->moveToThread(this); + } + + void run() { + for(int i = 0; i < number; i++) + delete objects[i]; + } +}; + +void tst_QObjectRace::destroyRace() +{ + enum { ThreadCount = 10, ObjectCountPerThread = 733, + ObjectCount = ThreadCount * ObjectCountPerThread }; + + const char *_slots[] = { SLOT(slot1()) , SLOT(slot2()) , SLOT(slot3()), + SLOT(slot4()) , SLOT(slot5()) , SLOT(slot6()), + SLOT(slot7()) }; + + const char *_signals[] = { SIGNAL(signal1()), SIGNAL(signal2()), SIGNAL(signal3()), + SIGNAL(signal4()), SIGNAL(signal5()), SIGNAL(signal6()), + SIGNAL(signal7()) }; + + QObject *objects[ObjectCount]; + for (int i = 0; i < ObjectCount; ++i) + objects[i] = new MyObject; + + + for (int i = 0; i < ObjectCount * 11; ++i) { + connect(objects[(i*13) % ObjectCount], _signals[(2*i)%7], + objects[((i+2)*17) % ObjectCount], _slots[(3*i+2)%7] ); + connect(objects[((i+6)*23) % ObjectCount], _signals[(5*i+4)%7], + objects[((i+8)*41) % ObjectCount], _slots[(i+6)%7] ); + } + + DestroyThread *threads[ThreadCount]; + for (int i = 0; i < ThreadCount; ++i) { + threads[i] = new DestroyThread; + threads[i]->setObjects(objects + i*ObjectCountPerThread, ObjectCountPerThread); + } + + for (int i = 0; i < ThreadCount; ++i) + threads[i]->start(); + + QVERIFY(threads[0]->wait(TwoMinutes)); + // the other threads should finish pretty quickly now + for (int i = 1; i < ThreadCount; ++i) + QVERIFY(threads[i]->wait(3000)); + + for (int i = 0; i < ThreadCount; ++i) + delete threads[i]; +} + + QTEST_MAIN(tst_QObjectRace) #include "tst_qobjectrace.moc" -- cgit v0.12 From e8ac2b958d92319da7c725f0c30f8ba5fe06497b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 18 May 2009 14:59:14 +0200 Subject: QCss: font-family handle fallback font specs if one specify more than one parameter in font-family, e.g., font-family: Verdana, Arial Qt should fallback on the second font if the first cannot be found. QFont::setFamily handle the case when the family name contains a comas, so we do not need to handle that specially in the css parser code. Task-number: 252311 Reviewed-by: Thomas Zander --- doc/src/stylesheet.qdoc | 4 ---- src/gui/text/qcssparser.cpp | 19 ++++++++++++------- tests/auto/qcssparser/tst_cssparser.cpp | 13 +++++++++---- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/doc/src/stylesheet.qdoc b/doc/src/stylesheet.qdoc index c0d13da..f895918 100644 --- a/doc/src/stylesheet.qdoc +++ b/doc/src/stylesheet.qdoc @@ -1872,10 +1872,6 @@ \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 54 - \note If you specify more than one parameter in \c font-family, - e.g., \c{font-family: Verdana, Arial}, Qt will only use the first - font. If it cannot be found, Qt uses the system fallbacks instead. - \row \o \c font-size \o \l{#Font Size}{Font Size} diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index 8214e54..38621c1 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -1161,13 +1161,20 @@ static bool setFontWeightFromValue(const Value &value, QFont *font) return true; } -static bool setFontFamilyFromValues(const QVector &values, QFont *font) +/** \internal + * parse the font family from the values (starting from index \a start) + * and set it the \a font + * \returns true if a family was extracted. + */ +static bool setFontFamilyFromValues(const QVector &values, QFont *font, int start = 0) { QString family; - for (int i = 0; i < values.count(); ++i) { + for (int i = start; i < values.count(); ++i) { const Value &v = values.at(i); - if (v.type == Value::TermOperatorComma) - break; + if (v.type == Value::TermOperatorComma) { + family += QLatin1Char(','); + continue; + } const QString str = v.variant.toString(); if (str.isEmpty()) break; @@ -1221,9 +1228,7 @@ static void parseShorthandFontProperty(const QVector &values, QFont *font } if (i < values.count()) { - QString fam = values.at(i).variant.toString(); - if (!fam.isEmpty()) - font->setFamily(fam); + setFontFamilyFromValues(values, font, i); } } diff --git a/tests/auto/qcssparser/tst_cssparser.cpp b/tests/auto/qcssparser/tst_cssparser.cpp index ab6bad6..7c4fac1 100644 --- a/tests/auto/qcssparser/tst_cssparser.cpp +++ b/tests/auto/qcssparser/tst_cssparser.cpp @@ -123,7 +123,7 @@ static void debug(const QVector &symbols, int index = -1) qDebug() << "failure at index" << index; } -static void debug(const QCss::Parser &p) { debug(p.symbols); } +//static void debug(const QCss::Parser &p) { debug(p.symbols); } void tst_CssParser::scanner() { @@ -1473,7 +1473,12 @@ void tst_CssParser::extractFontFamily_data() QTest::newRow("quoted-family-name") << "font-family: 'Times New Roman'" << QString("Times New Roman"); QTest::newRow("unquoted-family-name") << "font-family: Times New Roman" << QString("Times New Roman"); QTest::newRow("unquoted-family-name2") << "font-family: Times New Roman" << QString("Times New Roman"); - QTest::newRow("multiple") << "font-family: Times New Roman , foobar, 'baz'" << QString("Times New Roman"); + QTest::newRow("multiple") << "font-family: Times New Roman , foobar, 'baz'" << QString("Times New Roman"); + QTest::newRow("multiple2") << "font-family: invalid, Times New Roman " << QString("Times New Roman"); + QTest::newRow("invalid") << "font-family: invalid" << QFont().family(); + QTest::newRow("shorthand") << "font: 12pt Times New Roman" << QString("Times New Roman"); + QTest::newRow("shorthand multiple quote") << "font: 12pt invalid, \"Times New Roman\" " << QString("Times New Roman"); + QTest::newRow("shorthand multiple") << "font: 12pt invalid, Times New Roman " << QString("Times New Roman"); } void tst_CssParser::extractFontFamily() @@ -1497,8 +1502,8 @@ void tst_CssParser::extractFontFamily() int adjustment = 0; QFont fnt; extractor.extractFont(&fnt, &adjustment); - - QTEST(fnt.family(), "expectedFamily"); + QFontInfo info(fnt); + QTEST(info.family(), "expectedFamily"); } void tst_CssParser::extractBorder_data() -- cgit v0.12 From 5c25207628fbcc94e92b129ac7660af14613ad85 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Mon, 18 May 2009 15:00:59 +0200 Subject: Adding change details in to Qt 3 to Qt 4 porting guide Adding details about QCloseEvents being acceptet by default in Qt 4 opposed to Qt 3 Task-number: 192607 Rev-by: msorvig --- doc/src/porting4-overview.qdoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/src/porting4-overview.qdoc b/doc/src/porting4-overview.qdoc index b0146a6..462f849 100644 --- a/doc/src/porting4-overview.qdoc +++ b/doc/src/porting4-overview.qdoc @@ -364,4 +364,10 @@ In Qt 4.2 and later, \l{Qt Style Sheets} can be used to implement many common modifications to existing styles, and this may be sufficient for Qt 3 applications. + + \section2 Events + In Qt 3, QCloseEvents were not accepted by default. In Qt 4, + the event handler QWidget::closeEvent() receives QCloseEvents, + and accepts them by default closing the application. To avoid + this, please reimplement QWidget::closeEvent(). */ -- cgit v0.12 From 4bdee921aaaeb0ed150f0a9041a92566499a7936 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 18 May 2009 16:45:41 +0200 Subject: Fix compilation after merge --- src/network/access/qhttpnetworkconnection.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 161e6e9..43fbb16 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -723,6 +723,7 @@ void QHttpNetworkConnectionPrivate::handleStatus(QAbstractSocket *socket, QHttpN // proxy or server connections.. channels[i].resendCurrent = true; QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection); + } } else { int i = indexOf(socket); emit channels[i].reply->headerChanged(); -- cgit v0.12 From f5322311fa5f93e995d4c9dc35c778b11413abf5 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 18 May 2009 16:49:08 +0200 Subject: Fix compilation with strict iterators --- src/corelib/tools/qmap.h | 2 +- tests/auto/qmap/tst_qmap.cpp | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index 5f13e5a..32c8d17 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -990,7 +990,7 @@ Q_INLINE_TEMPLATE int QMultiMap::remove(const Key &key, const T &value) { int n = 0; typename QMap::iterator i(find(key)); - typename QMap::const_iterator end(QMap::constEnd()); + typename QMap::iterator end(QMap::end()); while (i != end && !qMapLessThanKey(key, i.key())) { if (i.value() == value) { i = erase(i); diff --git a/tests/auto/qmap/tst_qmap.cpp b/tests/auto/qmap/tst_qmap.cpp index 99efc80..68ac8d6 100644 --- a/tests/auto/qmap/tst_qmap.cpp +++ b/tests/auto/qmap/tst_qmap.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#define QT_STRICT_ITERATORS #include #include @@ -400,7 +401,7 @@ void tst_QMap::operator_eq() QVERIFY(a == b); QVERIFY(!(a != b)); - + a.insert(1,1); b.insert(1,1); QVERIFY(a == b); @@ -422,7 +423,7 @@ void tst_QMap::operator_eq() b.insert(-1, -1); QVERIFY(a != b); - QVERIFY(!(a == b)); + QVERIFY(!(a == b)); } { @@ -468,7 +469,7 @@ void tst_QMap::operator_eq() b.insert("willy", 1); QVERIFY(a != b); QVERIFY(!(a == b)); - } + } } void tst_QMap::empty() @@ -523,9 +524,9 @@ void tst_QMap::find() map1.insertMulti(4, compareString); } - QMap::const_iterator it=map1.find(4); + QMap::const_iterator it=map1.constFind(4); - for(i = 9; i > 2 && it != map1.end() && it.key() == 4; --i) { + for(i = 9; i > 2 && it != map1.constEnd() && it.key() == 4; --i) { compareString = testString.arg(i); QVERIFY(it.value() == compareString); ++it; @@ -546,9 +547,9 @@ void tst_QMap::constFind() map1.insert(1,"Mensch"); map1.insert(1,"Mayer"); map1.insert(2,"Hej"); - + QVERIFY(map1.constFind(4) == map1.constEnd()); - + QVERIFY(map1.constFind(1).value() == "Mayer"); QVERIFY(map1.constFind(2).value() == "Hej"); @@ -677,7 +678,7 @@ void tst_QMap::iterators() cstlIt--; QVERIFY(cstlIt.value() == "Teststring 3"); - for(cstlIt = map.begin(), i = 1; cstlIt != map.constEnd(), i < 100; ++cstlIt, ++i) + for(cstlIt = map.constBegin(), i = 1; cstlIt != map.constEnd(), i < 100; ++cstlIt, ++i) QVERIFY(cstlIt.value() == testString.arg(i)); //Java-Style iterators -- cgit v0.12 From a860dfbd20ac99492bb30c646b672e72283bb810 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Mon, 18 May 2009 16:54:01 +0200 Subject: Add src/corelib/kernel/qpointer.cpp to src/corelib/kernel/kernel.pri Makes it possible to find it when using QtCreator :) --- src/corelib/kernel/kernel.pri | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri index d90ecae..68649a6 100644 --- a/src/corelib/kernel/kernel.pri +++ b/src/corelib/kernel/kernel.pri @@ -53,7 +53,8 @@ SOURCES += \ kernel/qvariant.cpp \ kernel/qcoreglobaldata.cpp \ kernel/qsharedmemory.cpp \ - kernel/qsystemsemaphore.cpp + kernel/qsystemsemaphore.cpp \ + kernel/qpointer.cpp win32 { SOURCES += \ -- cgit v0.12 From ba7e2d913deb4adeef071002e3518f43949e6a08 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Tue, 19 May 2009 13:33:21 +1000 Subject: Fixed incorrect pass/fail semantics for xpass/xfail when using xunitxml testlib logger. In the testlib plain logger, xfail is considered a pass and xpass considered a fail. xunitxml had the opposite behavior; change it to be the same. Autotest: included --- src/testlib/qtestlogger.cpp | 21 +++++++++++++++------ tests/auto/selftests/expected_xunit.txt | 13 ++++++++++++- tests/auto/selftests/xunit/tst_xunit.cpp | 29 +++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 7 deletions(-) diff --git a/src/testlib/qtestlogger.cpp b/src/testlib/qtestlogger.cpp index 2249e8a..46af232 100644 --- a/src/testlib/qtestlogger.cpp +++ b/src/testlib/qtestlogger.cpp @@ -180,7 +180,7 @@ void QTestLogger::addIncident(IncidentTypes type, const char *description, switch (type) { case QAbstractTestLogger::XPass: - ++passCounter; + ++failureCounter; typeBuf = "xpass"; break; case QAbstractTestLogger::Pass: @@ -188,7 +188,7 @@ void QTestLogger::addIncident(IncidentTypes type, const char *description, typeBuf = "pass"; break; case QAbstractTestLogger::XFail: - ++failureCounter; + ++passCounter; typeBuf = "xfail"; break; case QAbstractTestLogger::Fail: @@ -200,7 +200,8 @@ void QTestLogger::addIncident(IncidentTypes type, const char *description, break; } - if (type == QAbstractTestLogger::Fail || type == QAbstractTestLogger::XFail) { + if (type == QAbstractTestLogger::Fail || type == QAbstractTestLogger::XPass + || ((format != TLF_XunitXml) && (type == QAbstractTestLogger::XFail))) { QTestElement *failureElement = new QTestElement(QTest::LET_Failure); failureElement->addAttribute(QTest::AI_Result, typeBuf); if(file) @@ -230,10 +231,10 @@ void QTestLogger::addIncident(IncidentTypes type, const char *description, if (!strcmp(oldResult, "pass")) { overwrite = true; } - else if (!strcmp(oldResult, "xpass")) { - overwrite = (type == QAbstractTestLogger::XFail || type == QAbstractTestLogger::Fail); - } else if (!strcmp(oldResult, "xfail")) { + overwrite = (type == QAbstractTestLogger::XPass || type == QAbstractTestLogger::Fail); + } + else if (!strcmp(oldResult, "xpass")) { overwrite = (type == QAbstractTestLogger::Fail); } if (overwrite) { @@ -251,6 +252,14 @@ void QTestLogger::addIncident(IncidentTypes type, const char *description, QTest::qt_snprintf(buf, sizeof(buf), "%i", line); currentLogElement->addAttribute(QTest::AI_Line, buf); + + /* + Since XFAIL does not add a failure to the testlog in xunitxml, add a message, so we still + have some information about the expected failure. + */ + if (format == TLF_XunitXml && type == QAbstractTestLogger::XFail) { + QTestLogger::addMessage(QAbstractTestLogger::Info, description, file, line); + } } void QTestLogger::addBenchmarkResult(const QBenchmarkResult &result) diff --git a/tests/auto/selftests/expected_xunit.txt b/tests/auto/selftests/expected_xunit.txt index 875dda6..cb74491 100644 --- a/tests/auto/selftests/expected_xunit.txt +++ b/tests/auto/selftests/expected_xunit.txt @@ -1,5 +1,5 @@ - + @@ -20,10 +20,21 @@ + + + + + + + + + ]]> + + diff --git a/tests/auto/selftests/xunit/tst_xunit.cpp b/tests/auto/selftests/xunit/tst_xunit.cpp index dbe9fec..c3c90ab 100644 --- a/tests/auto/selftests/xunit/tst_xunit.cpp +++ b/tests/auto/selftests/xunit/tst_xunit.cpp @@ -53,6 +53,9 @@ private slots: void testFunc2(); void testFunc3(); void testFunc4(); + void testFunc5(); + void testFunc6(); + void testFunc7(); }; tst_Xunit::tst_Xunit() @@ -81,6 +84,32 @@ void tst_Xunit::testFunc4() QFAIL("a forced failure!"); } +/* + Note there are two testfunctions which give expected failures. + This is so we can test that expected failures don't add to failure + counts and unexpected passes do. If we had one xfail and one xpass + testfunction, we couldn't test which one of them adds to the failure + count. +*/ + +void tst_Xunit::testFunc5() +{ + QEXPECT_FAIL("", "this failure is expected", Abort); + QVERIFY(false); +} + +void tst_Xunit::testFunc6() +{ + QEXPECT_FAIL("", "this failure is also expected", Abort); + QVERIFY(false); +} + +void tst_Xunit::testFunc7() +{ + QEXPECT_FAIL("", "this pass is unexpected", Abort); + QVERIFY(true); +} + QTEST_APPLESS_MAIN(tst_Xunit) #include "tst_xunit.moc" -- cgit v0.12 From d6127efabb74e2004608f53d0be3b7c4a6df768d Mon Sep 17 00:00:00 2001 From: jasplin Date: Tue, 19 May 2009 08:11:19 +0200 Subject: Fixed typo. Reviewed-by: TrustMe --- src/network/access/qhttp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/access/qhttp.cpp b/src/network/access/qhttp.cpp index 96ccc91..2002641 100644 --- a/src/network/access/qhttp.cpp +++ b/src/network/access/qhttp.cpp @@ -1446,7 +1446,7 @@ QString QHttpRequestHeader::toString() const that indicates if the request finished with an error. To make an HTTP request you must set up suitable HTTP headers. The - following example demonstrates, how to request the main HTML page + following example demonstrates how to request the main HTML page from the Trolltech home page (i.e., the URL \c http://qtsoftware.com/index.html): -- cgit v0.12 From 9f9ede616079998f8ba7bf6fd446f39ce74b0400 Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Mon, 18 May 2009 16:04:15 +0200 Subject: Modernize the output of qdoc a bit. Now we have explicit columns we cann make our docs look a bit better using some simple css additions. This adds light backgrounds in targetted places to make the text more readable. --- tools/qdoc3/test/classic.css | 64 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css index 6cf7377..3704a15 100644 --- a/tools/qdoc3/test/classic.css +++ b/tools/qdoc3/test/classic.css @@ -1,7 +1,29 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +BODY,TD { + font-size: 90%; +} +H1 { + text-align: center; + font-size: 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 100%; +} + h3.fn,span.fn { - margin-left: 1cm; - text-indent: -1cm; + background-color: #d5e1e8; + border-width: 1px; + border-style: solid; + border-color: #84b0c7; + font-weight: bold; + -moz-border-radius: 8px 8px 8px 8px; + padding: 6px 0px 6px 10px; } a:link @@ -56,6 +78,44 @@ body color: black } +table td.memItemLeft { + width: 200px; + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +table td.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} + table tr.odd { background: #f0f0f0; color: black; -- cgit v0.12