summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/platforms/supported-platforms.qdoc6
-rw-r--r--mkspecs/features/testcase.prf4
-rw-r--r--src/corelib/kernel/qtranslator.cpp18
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp57
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp5
-rw-r--r--src/gui/kernel/qwidget_x11.cpp28
-rw-r--r--src/gui/styles/qmacstyle_mac.mm101
-rw-r--r--src/gui/styles/qwindowsvistastyle.cpp1
-rw-r--r--src/imports/shaders/shadereffect.cpp4
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/qtbug_22125.qml44
-rw-r--r--tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp41
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp39
-rw-r--r--tests/auto/qtranslator/i18n/hellotr_en.qmbin0 -> 230 bytes
-rw-r--r--tests/auto/qtranslator/tst_qtranslator.cpp40
-rw-r--r--tools/qdoc3/qdoc3.pro5
16 files changed, 343 insertions, 51 deletions
diff --git a/doc/src/platforms/supported-platforms.qdoc b/doc/src/platforms/supported-platforms.qdoc
index a3fc390..55ba94b 100644
--- a/doc/src/platforms/supported-platforms.qdoc
+++ b/doc/src/platforms/supported-platforms.qdoc
@@ -416,9 +416,11 @@
\o Compilers
\row \o Ubuntu Linux 10.04 (32-bit)
\o As provided by Ubuntu
+ \row \o Microsoft Windows XP SP3 (32-bit)
+ \o MSVC 2008
\row \o Microsoft Windows 7 (32-bit)
\o MSVC 2008
- \row \o Microsoft Windows 7 (64-bit)
+ \row \o Microsoft Windows 7 (32-bit)
\o MSVC 2010 SP1
\row \o Apple Mac OS X 10.6 "Snow Leopard" (64-bit)
\o As provided by Apple
@@ -440,6 +442,8 @@
\o As provided by Ubuntu
\row \o Ubuntu Linux 10.04 (32-bit)
\o Intel Compiler [version 12]
+ \row \o Apple Mac OS X 10.6 "Snow Leopard" Cocoa (32-bit)
+ \o As provided by Apple
\endtable
\section1 Tier 3 Platforms (Not Supported by Nokia)
diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf
index 7a7c9e3..eb0aa9f 100644
--- a/mkspecs/features/testcase.prf
+++ b/mkspecs/features/testcase.prf
@@ -38,6 +38,10 @@ embedded: check.commands += -qws
# Allow for custom arguments to tests
check.commands += $(TESTARGS)
+
+# If the test is marked as insignificant, discard the exit code
+insignificant_test:check.commands = -$${check.commands}
+
QMAKE_EXTRA_TARGETS *= check
!debug_and_release|build_pass {
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index dfc90e8..692c78c 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -408,13 +408,26 @@ bool QTranslator::load(const QString & filename, const QString & directory,
Q_D(QTranslator);
d->clear();
+ QString fname = filename;
QString prefix;
if (QFileInfo(filename).isRelative()) {
#ifdef Q_OS_SYMBIAN
- if (directory.isEmpty())
+ //TFindFile doesn't like path in the filename
+ QString dir(directory);
+ int slash = filename.lastIndexOf(QLatin1Char('/'));
+ slash = qMax(slash, filename.lastIndexOf(QLatin1Char('\\')));
+ if (slash >=0) {
+ //so move the path component into the directory prefix
+ if (dir.isEmpty())
+ dir = filename.left(slash + 1);
+ else
+ dir = dir + QLatin1Char('/') + filename.left(slash + 1);
+ fname = fname.mid(slash + 1);
+ }
+ if (dir.isEmpty())
prefix = QCoreApplication::applicationDirPath();
else
- prefix = QFileInfo(directory).absoluteFilePath(); //TFindFile doesn't like dirty paths
+ prefix = QFileInfo(dir).absoluteFilePath(); //TFindFile doesn't like dirty paths
if (prefix.length() > 2 && prefix.at(1) == QLatin1Char(':') && prefix.at(0).isLetter())
prefix[0] = QLatin1Char('Y');
#else
@@ -428,7 +441,6 @@ bool QTranslator::load(const QString & filename, const QString & directory,
QString nativePrefix = QDir::toNativeSeparators(prefix);
#endif
- QString fname = filename;
QString realname;
QString delims;
delims = search_delimiters.isNull() ? QString::fromLatin1("_.") : search_delimiters;
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
index 3557425..b23ac73 100644
--- a/src/declarative/util/qdeclarativepixmapcache.cpp
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -90,8 +90,9 @@ public:
~QDeclarativePixmapReply();
QDeclarativePixmapData *data;
- QDeclarativePixmapReader *reader;
+ QDeclarativeEngine *engineForReader; // always access reader inside readerMutex.
QSize requestSize;
+ QUrl url;
bool loading;
int redirectCount;
@@ -147,6 +148,7 @@ public:
void cancel(QDeclarativePixmapReply *rep);
static QDeclarativePixmapReader *instance(QDeclarativeEngine *engine);
+ static QDeclarativePixmapReader *existingInstance(QDeclarativeEngine *engine);
protected:
void run();
@@ -176,6 +178,7 @@ private:
static int downloadProgress;
static int threadNetworkRequestDone;
static QHash<QDeclarativeEngine *,QDeclarativePixmapReader*> readers;
+public:
static QMutex readerMutex;
};
@@ -326,6 +329,22 @@ QDeclarativePixmapReader::~QDeclarativePixmapReader()
readers.remove(engine);
readerMutex.unlock();
+ mutex.lock();
+ // manually cancel all outstanding jobs.
+ foreach (QDeclarativePixmapReply *reply, jobs) {
+ delete reply;
+ }
+ jobs.clear();
+ QList<QDeclarativePixmapReply*> activeJobs = replies.values();
+ foreach (QDeclarativePixmapReply *reply, activeJobs) {
+ if (reply->loading) {
+ cancelled.append(reply);
+ reply->data = 0;
+ }
+ }
+ if (threadObject) threadObject->processJobs();
+ mutex.unlock();
+
eventLoopQuitHack->deleteLater();
wait();
}
@@ -433,9 +452,8 @@ void QDeclarativePixmapReader::processJobs()
if (!jobs.isEmpty() && replies.count() < IMAGEREQUEST_MAX_REQUEST_COUNT) {
QDeclarativePixmapReply *runningJob = jobs.takeLast();
runningJob->loading = true;
-
- QUrl url = runningJob->data->url;
- QSize requestSize = runningJob->data->requestSize;
+ QUrl url = runningJob->url;
+ QSize requestSize = runningJob->requestSize;
locker.unlock();
processJob(runningJob, url, requestSize);
locker.relock();
@@ -459,7 +477,6 @@ void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob, c
errorCode = QDeclarativePixmapReply::Loading;
errorStr = QDeclarativePixmap::tr("Failed to get image from provider: %1").arg(url.toString());
}
-
mutex.lock();
if (!cancelled.contains(runningJob)) runningJob->postReply(errorCode, errorStr, readSize, image);
mutex.unlock();
@@ -487,10 +504,8 @@ void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob, c
QNetworkRequest req(url);
req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
QNetworkReply *reply = networkAccessManager()->get(req);
-
QMetaObject::connect(reply, replyDownloadProgress, runningJob, downloadProgress);
QMetaObject::connect(reply, replyFinished, threadObject, threadNetworkRequestDone);
-
replies.insert(reply, runningJob);
}
}
@@ -498,22 +513,27 @@ void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob, c
QDeclarativePixmapReader *QDeclarativePixmapReader::instance(QDeclarativeEngine *engine)
{
- readerMutex.lock();
+ // XXX NOTE: must be called within readerMutex locking.
QDeclarativePixmapReader *reader = readers.value(engine);
if (!reader) {
reader = new QDeclarativePixmapReader(engine);
readers.insert(engine, reader);
}
- readerMutex.unlock();
return reader;
}
+QDeclarativePixmapReader *QDeclarativePixmapReader::existingInstance(QDeclarativeEngine *engine)
+{
+ // XXX NOTE: must be called within readerMutex locking.
+ return readers.value(engine, 0);
+}
+
QDeclarativePixmapReply *QDeclarativePixmapReader::getImage(QDeclarativePixmapData *data)
{
mutex.lock();
QDeclarativePixmapReply *reply = new QDeclarativePixmapReply(data);
- reply->reader = this;
+ reply->engineForReader = engine;
jobs.append(reply);
// XXX
if (threadObject) threadObject->processJobs();
@@ -692,7 +712,7 @@ void QDeclarativePixmapStore::flushCache()
}
QDeclarativePixmapReply::QDeclarativePixmapReply(QDeclarativePixmapData *d)
-: data(d), reader(0), requestSize(d->requestSize), loading(false), redirectCount(0)
+: data(d), engineForReader(0), requestSize(d->requestSize), url(d->url), loading(false), redirectCount(0)
{
if (finishedIndex == -1) {
finishedIndex = QDeclarativePixmapReply::staticMetaObject.indexOfSignal("finished()");
@@ -750,8 +770,14 @@ void QDeclarativePixmapData::release()
if (refCount == 0) {
if (reply) {
- reply->reader->cancel(reply);
+ QDeclarativePixmapReply *cancelReply = reply;
+ reply->data = 0;
reply = 0;
+ QDeclarativePixmapReader::readerMutex.lock();
+ QDeclarativePixmapReader *reader = QDeclarativePixmapReader::existingInstance(cancelReply->engineForReader);
+ if (reader)
+ reader->cancel(cancelReply);
+ QDeclarativePixmapReader::readerMutex.unlock();
}
if (pixmapStatus == QDeclarativePixmap::Ready) {
@@ -1013,13 +1039,12 @@ void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const
if (!engine)
return;
- QDeclarativePixmapReader *reader = QDeclarativePixmapReader::instance(engine);
-
d = new QDeclarativePixmapData(url, requestSize);
if (options & QDeclarativePixmap::Cache)
d->addToCache();
-
- d->reply = reader->getImage(d);
+ QDeclarativePixmapReader::readerMutex.lock();
+ d->reply = QDeclarativePixmapReader::instance(engine)->getImage(d);
+ QDeclarativePixmapReader::readerMutex.unlock();
} else {
d = *iter;
d->addref();
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 73e8eed..9ea0b83 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1157,7 +1157,6 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q
if (q_ptr == fsi || q_ptr->isAncestorOf(fsi)) {
parentFocusScopeItem = fsi;
p->d_ptr->focusScopeItem = 0;
- fsi->d_ptr->focusScopeItemChange(false);
}
break;
}
@@ -1261,6 +1260,10 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q
if (!inDestructor && (transformData || (newParent && newParent->d_ptr->transformData)))
transformChanged();
+ // Reparenting is finished, now safe to notify the previous focusScopeItem about changes
+ if (parentFocusScopeItem)
+ parentFocusScopeItem->d_ptr->focusScopeItemChange(false);
+
// Restore the sub focus chain.
if (subFocusItem) {
subFocusItem->d_ptr->setSubFocus(newParent);
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 98c33da..c3362ae 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -1336,40 +1336,12 @@ QPoint QWidgetPrivate::mapFromGlobal(const QPoint &pos) const
QPoint QWidget::mapToGlobal(const QPoint &pos) const
{
Q_D(const QWidget);
- QPoint offset = data->crect.topLeft();
- const QWidget *w = this;
- const QWidget *p = w->parentWidget();
- while (!w->isWindow() && p) {
- w = p;
- p = p->parentWidget();
- offset += w->data->crect.topLeft();
- }
-
- const QWidgetPrivate *wd = w->d_func();
- QTLWExtra *tlw = wd->topData();
- if (!tlw->embedded)
- return pos + offset;
-
return d->mapToGlobal(pos);
}
QPoint QWidget::mapFromGlobal(const QPoint &pos) const
{
Q_D(const QWidget);
- QPoint offset = data->crect.topLeft();
- const QWidget *w = this;
- const QWidget *p = w->parentWidget();
- while (!w->isWindow() && p) {
- w = p;
- p = p->parentWidget();
- offset += w->data->crect.topLeft();
- }
-
- const QWidgetPrivate *wd = w->d_func();
- QTLWExtra *tlw = wd->topData();
- if (!tlw->embedded)
- return pos - offset;
-
return d->mapFromGlobal(pos);
}
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 8f0e602..4d6252f 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -4552,6 +4552,107 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
rect.setTop(rect.top() + SIZE(6 /* AHIG */, 3 /* guess */, 2 /* AHIG */));
}
break;
+#ifndef QT_NO_DOCKWIDGET
+ case SE_DockWidgetCloseButton:
+ case SE_DockWidgetFloatButton:
+ case SE_DockWidgetTitleBarText:
+ case SE_DockWidgetIcon: {
+ int iconSize = proxy()->pixelMetric(PM_SmallIconSize, opt, widget);
+ int buttonMargin = proxy()->pixelMetric(PM_DockWidgetTitleBarButtonMargin, opt, widget);
+ QRect srect = opt->rect;
+
+ const QStyleOptionDockWidget *dwOpt
+ = qstyleoption_cast<const QStyleOptionDockWidget*>(opt);
+ bool canClose = dwOpt == 0 ? true : dwOpt->closable;
+ bool canFloat = dwOpt == 0 ? false : dwOpt->floatable;
+ const QStyleOptionDockWidgetV2 *v2
+ = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(opt);
+ bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar;
+
+ // If this is a vertical titlebar, we transpose and work as if it was
+ // horizontal, then transpose again.
+ if (verticalTitleBar) {
+ QSize size = srect.size();
+ size.transpose();
+ srect.setSize(size);
+ }
+
+ do {
+ int right = srect.right();
+ int left = srect.left();
+
+ QRect closeRect;
+ if (canClose) {
+ QSize sz = standardIcon(QStyle::SP_TitleBarCloseButton,
+ opt, widget).actualSize(QSize(iconSize, iconSize));
+ sz += QSize(buttonMargin, buttonMargin);
+ if (verticalTitleBar)
+ sz.transpose();
+ closeRect = QRect(left,
+ srect.center().y() - sz.height()/2,
+ sz.width(), sz.height());
+ left = closeRect.right() + 1;
+ }
+ if (sr == SE_DockWidgetCloseButton) {
+ rect = closeRect;
+ break;
+ }
+
+ QRect floatRect;
+ if (canFloat) {
+ QSize sz = standardIcon(QStyle::SP_TitleBarNormalButton,
+ opt, widget).actualSize(QSize(iconSize, iconSize));
+ sz += QSize(buttonMargin, buttonMargin);
+ if (verticalTitleBar)
+ sz.transpose();
+ floatRect = QRect(left,
+ srect.center().y() - sz.height()/2,
+ sz.width(), sz.height());
+ left = floatRect.right() + 1;
+ }
+ if (sr == SE_DockWidgetFloatButton) {
+ rect = floatRect;
+ break;
+ }
+
+ QRect iconRect;
+ if (const QDockWidget *dw = qobject_cast<const QDockWidget*>(widget)) {
+ QIcon icon;
+ if (dw->isFloating())
+ icon = dw->windowIcon();
+ if (!icon.isNull()
+ && icon.cacheKey() != QApplication::windowIcon().cacheKey()) {
+ QSize sz = icon.actualSize(QSize(rect.height(), rect.height()));
+ if (verticalTitleBar)
+ sz.transpose();
+ iconRect = QRect(right - sz.width(), srect.center().y() - sz.height()/2,
+ sz.width(), sz.height());
+ right = iconRect.left() - 1;
+ }
+ }
+ if (sr == SE_DockWidgetIcon) {
+ rect = iconRect;
+ break;
+ }
+
+ QRect textRect = QRect(left, srect.top(),
+ right - left, srect.height());
+ if (sr == SE_DockWidgetTitleBarText) {
+ rect = textRect;
+ break;
+ }
+ } while (false);
+
+ if (verticalTitleBar) {
+ rect = QRect(srect.left() + rect.top() - srect.top(),
+ srect.top() + srect.right() - rect.right(),
+ rect.height(), rect.width());
+ } else {
+ rect = visualRect(opt->direction, srect, rect);
+ }
+ break;
+ }
+#endif
default:
rect = QWindowsStyle::subElementRect(sr, opt, widget);
break;
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp
index 5525468..8051014 100644
--- a/src/gui/styles/qwindowsvistastyle.cpp
+++ b/src/gui/styles/qwindowsvistastyle.cpp
@@ -2508,6 +2508,7 @@ QWindowsVistaStylePrivate::QWindowsVistaStylePrivate() :
QWindowsVistaStylePrivate::~QWindowsVistaStylePrivate()
{
+ qDeleteAll(animations);
delete m_treeViewHelper;
}
diff --git a/src/imports/shaders/shadereffect.cpp b/src/imports/shaders/shadereffect.cpp
index f40d6b8..a5164e2 100644
--- a/src/imports/shaders/shadereffect.cpp
+++ b/src/imports/shaders/shadereffect.cpp
@@ -61,6 +61,7 @@ ShaderEffect::~ShaderEffect()
void ShaderEffect::prepareBufferedDraw(QPainter *painter)
{
+#ifndef QT_NO_DYNAMIC_CAST
// This workaround needed because QGraphicsEffect seems to always utilize default painters worldtransform
// instead of the active painters worldtransform.
const ShaderEffectBuffer *effectBuffer = dynamic_cast<ShaderEffectBuffer*> (painter->device());
@@ -70,6 +71,9 @@ void ShaderEffect::prepareBufferedDraw(QPainter *painter)
} else {
savedWorldTransform = painter->worldTransform();
}
+#else
+ Q_UNUSED(painter);
+#endif
}
void ShaderEffect::draw (QPainter *painter)
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 15fda34..b9db7fe 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -788,6 +788,7 @@ void QHttpNetworkConnectionChannel::detectPipeliningSupport()
&& (!serverHeaderField.contains("Netscape-Enterprise/3."))
// this is adpoted from the knowledge of the Nokia 7.x browser team (DEF143319)
&& (!serverHeaderField.contains("WebLogic"))
+ && (!serverHeaderField.startsWith("Rocket")) // a Python Web Server, see Web2py.com
) {
pipeliningSupported = QHttpNetworkConnectionChannel::PipeliningProbablySupported;
} else {
diff --git a/tests/auto/declarative/qdeclarativeimage/data/qtbug_22125.qml b/tests/auto/declarative/qdeclarativeimage/data/qtbug_22125.qml
new file mode 100644
index 0000000..8588028
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/qtbug_22125.qml
@@ -0,0 +1,44 @@
+import QtQuick 1.1
+
+Item {
+ id: root
+ width: 800
+ height: 800
+
+ GridView {
+ anchors.fill: parent
+ delegate: Image {
+ source: imagePath;
+ asynchronous: true
+ smooth: true
+ width: 200
+ height: 200
+ }
+ model: ListModel {
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/big256.png"
+ }
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/big256.png"
+ }
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/big256.png"
+ }
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/colors.png"
+ }
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/colors1.png"
+ }
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/big.jpeg"
+ }
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/heart.png"
+ }
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/green.png"
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
index a35d69a..f67c5b5 100644
--- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
+++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
@@ -94,6 +94,7 @@ private slots:
void resetSourceSize();
void testQtQuick11Attributes();
void testQtQuick11Attributes_data();
+ void readerCrash_QTBUG_22125();
private:
template<typename T>
@@ -762,6 +763,46 @@ void tst_qdeclarativeimage::testQtQuick11Attributes_data()
<< ":1 \"Image.cache\" is not available in QtQuick 1.0.\n";
}
+void tst_qdeclarativeimage::readerCrash_QTBUG_22125()
+{
+ {
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data/", TestHTTPServer::Delay);
+
+ {
+ QDeclarativeView view(QUrl::fromLocalFile(SRCDIR "/data/qtbug_22125.qml"));
+ view.show();
+ qApp->processEvents();
+ qApp->processEvents();
+ // shouldn't crash when the view drops out of scope due to
+ // QDeclarativePixmapData attempting to dereference a pointer to
+ // the destroyed reader.
+ }
+
+ // shouldn't crash when deleting cancelled QDeclarativePixmapReplys.
+ QTest::qWait(1000);
+ qApp->processEvents(QEventLoop::DeferredDeletion);
+ }
+
+ {
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data/");
+
+ {
+ QDeclarativeView view(QUrl::fromLocalFile(SRCDIR "/data/qtbug_22125.qml"));
+ view.show();
+ qApp->processEvents();
+ QTest::qWait(1000);
+ qApp->processEvents();
+ // shouldn't crash when the view drops out of scope due to
+ // the reader thread accessing self-deleted QDeclarativePixmapReplys.
+ }
+ qApp->processEvents();
+ }
+}
+
/*
Find an item with the specified objectName. If index is supplied then the
item must also evaluate the {index} expression equal to index
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 14ad6a9..371ac57 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -168,6 +168,7 @@ public Q_SLOTS:
void gotError();
void authenticationRequired(QNetworkReply*,QAuthenticator*);
void proxyAuthenticationRequired(const QNetworkProxy &,QAuthenticator*);
+ void pipeliningHelperSlot();
#ifndef QT_NO_OPENSSL
void sslErrors(QNetworkReply*,const QList<QSslError> &);
@@ -380,6 +381,7 @@ private Q_SLOTS:
void dontInsertPartialContentIntoTheCache();
void synchronousAuthenticationCache();
+ void pipelining();
// NOTE: This test must be last!
void parentingRepliesToTheApp();
@@ -6446,6 +6448,43 @@ void tst_QNetworkReply::synchronousAuthenticationCache()
}
}
+void tst_QNetworkReply::pipelining()
+{
+ QString urlString("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/echo.cgi?");
+ QList<QNetworkReplyPtr> replies;
+ for (int a = 0; a < 20; a++) {
+ QNetworkRequest request(urlString + QString::number(a));
+ request.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, QVariant(true));
+ replies.append(manager.get(request));
+ connect(replies.at(a), SIGNAL(finished()), this, SLOT(pipeliningHelperSlot()));
+ }
+ QTestEventLoop::instance().enterLoop(20);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+}
+
+void tst_QNetworkReply::pipeliningHelperSlot() {
+ static int a = 0;
+
+ // check that pipelining was used in at least one of the replies
+ static bool pipeliningWasUsed = false;
+ QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
+ bool pipeliningWasUsedInReply = reply->attribute(QNetworkRequest::HttpPipeliningWasUsedAttribute).toBool();
+ if (pipeliningWasUsedInReply)
+ pipeliningWasUsed = true;
+
+ // check that the contents match (the response to echo.cgi?3 should return 3 etc.)
+ QString urlQueryString = reply->url().queryItems().at(0).first;
+ QString content = reply->readAll();
+ QVERIFY2(urlQueryString == content, "data corruption with pipelining detected");
+
+ a++;
+
+ if (a == 20) { // all replies have finished
+ QTestEventLoop::instance().exitLoop();
+ QVERIFY2(pipeliningWasUsed, "pipelining was not used in any of the replies when trying to test pipelining");
+ }
+}
+
// NOTE: This test must be last testcase in tst_qnetworkreply!
void tst_QNetworkReply::parentingRepliesToTheApp()
{
diff --git a/tests/auto/qtranslator/i18n/hellotr_en.qm b/tests/auto/qtranslator/i18n/hellotr_en.qm
new file mode 100644
index 0000000..cc42afe
--- /dev/null
+++ b/tests/auto/qtranslator/i18n/hellotr_en.qm
Binary files differ
diff --git a/tests/auto/qtranslator/tst_qtranslator.cpp b/tests/auto/qtranslator/tst_qtranslator.cpp
index 8e2ed15..6f65e6a 100644
--- a/tests/auto/qtranslator/tst_qtranslator.cpp
+++ b/tests/auto/qtranslator/tst_qtranslator.cpp
@@ -66,6 +66,10 @@ protected:
private slots:
void load();
void load2();
+ void loadSubdir();
+ void loadSubdir2();
+ void loadSubdir3();
+ void loadSubdir4();
void threadLoad();
void testLanguageChange();
void plural();
@@ -124,6 +128,38 @@ void tst_QTranslator::load2()
QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!"));
}
+void tst_QTranslator::loadSubdir()
+{
+ QTranslator tor( 0 );
+ tor.load("hellotr_en_GB", "i18n");
+ QVERIFY(!tor.isEmpty());
+ QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!"));
+}
+
+void tst_QTranslator::loadSubdir2()
+{
+ QTranslator tor( 0 );
+ tor.load("i18n/hellotr_en_GB");
+ QVERIFY(!tor.isEmpty());
+ QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!"));
+}
+
+void tst_QTranslator::loadSubdir3()
+{
+ QTranslator tor( 0 );
+ tor.load(QString(QLatin1String("i18n%1hellotr_en_GB")).arg(QDir::separator()));
+ QVERIFY(!tor.isEmpty());
+ QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!"));
+}
+
+void tst_QTranslator::loadSubdir4()
+{
+ QTranslator tor( 0 );
+ tor.load("./hellotr_en_GB", "i18n");
+ QVERIFY(!tor.isEmpty());
+ QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!"));
+}
+
class TranslatorThread : public QThread
{
void run() {
@@ -249,10 +285,10 @@ void tst_QTranslator::loadFromResource()
void tst_QTranslator::loadDirectory()
{
- QVERIFY(QFileInfo("../qtranslator").isDir());
+ QVERIFY(QFileInfo("i18n").isDir());
QTranslator tor;
- tor.load("qtranslator", "..");
+ tor.load("qtranslator", "i18n");
QVERIFY(tor.isEmpty());
}
diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro
index bb5ff83..254ba92 100644
--- a/tools/qdoc3/qdoc3.pro
+++ b/tools/qdoc3/qdoc3.pro
@@ -15,6 +15,11 @@ qdoc_bootstrapped {
CONFIG -= debug_and_release_target
}
+# Increase the stack size on MSVC to 4M to avoid a stack overflow
+win32-msvc*:{
+    QMAKE_LFLAGS += /STACK:\"4194304\"
+}
+
!isEmpty(QT_BUILD_TREE):DESTDIR = $$QT_BUILD_TREE/bin
#CONFIG += debug
build_all:!build_pass {