summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorA-Team <ateam@pad.test.qt.nokia.com>2010-11-05 23:00:12 (GMT)
committerA-Team <ateam@pad.test.qt.nokia.com>2010-11-05 23:00:12 (GMT)
commit84de3d47a2fd5400920ad570b443b6bb95c8c766 (patch)
tree5fa4a5ff143e96a2b75831cf4c0f6f7bc623fb0a /src
parent915aa77e130e4722173df10e7bb6816c54a2c4e4 (diff)
parent6ac4bc5cb7ac7500b39ea6828fdf76e95a2c2f0b (diff)
downloadQt-84de3d47a2fd5400920ad570b443b6bb95c8c766.zip
Qt-84de3d47a2fd5400920ad570b443b6bb95c8c766.tar.gz
Qt-84de3d47a2fd5400920ad570b443b6bb95c8c766.tar.bz2
Merge branch '4.7-upstream' into 4.7-doc
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qsettings.cpp16
-rw-r--r--src/gui/dialogs/qinputdialog.cpp3
-rw-r--r--src/gui/image/qxbmhandler.cpp25
-rw-r--r--src/gui/kernel/qapplication.cpp12
-rw-r--r--src/gui/kernel/qapplication_x11.cpp24
-rw-r--r--src/gui/kernel/qt_x11_p.h1
-rw-r--r--src/gui/styles/qs60style.cpp18
-rw-r--r--src/gui/styles/qs60style_p.h1
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp5
-rw-r--r--src/network/kernel/qnetworkproxy.cpp6
-rw-r--r--src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp5
-rw-r--r--src/plugins/bearer/icd/maemo_icd.cpp2
-rw-r--r--src/plugins/bearer/icd/qnetworksession_impl.cpp2
13 files changed, 79 insertions, 41 deletions
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 8ee42e7..e6c5fb9 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -88,6 +88,12 @@
#define CSIDL_APPDATA 0x001a // <username>\Application Data
#endif
+#ifdef Q_AUTOTEST_EXPORT
+# define Q_AUTOTEST_EXPORT_HELPER Q_AUTOTEST_EXPORT
+#else
+# define Q_AUTOTEST_EXPORT_HELPER static
+#endif
+
// ************************************************************************
// QConfFile
@@ -134,7 +140,7 @@ QT_BEGIN_INCLUDE_NAMESPACE
# include <sys/mount.h>
QT_END_INCLUDE_NAMESPACE
-static bool isLikelyToBeNfs(int handle)
+Q_AUTOTEST_EXPORT_HELPER bool qIsLikelyToBeNfs(int handle)
{
struct statfs buf;
if (fstatfs(handle, &buf) != 0)
@@ -160,7 +166,7 @@ QT_END_INCLUDE_NAMESPACE
# define AUTOFSNG_SUPER_MAGIC 0x7d92b1a0
# endif
-static bool isLikelyToBeNfs(int handle)
+Q_AUTOTEST_EXPORT_HELPER bool qIsLikelyToBeNfs(int handle)
{
struct statfs buf;
if (fstatfs(handle, &buf) != 0)
@@ -177,7 +183,7 @@ QT_BEGIN_INCLUDE_NAMESPACE
# include <sys/statvfs.h>
QT_END_INCLUDE_NAMESPACE
-static bool isLikelyToBeNfs(int handle)
+Q_AUTOTEST_EXPORT_HELPER bool qIsLikelyToBeNfs(int handle)
{
struct statvfs buf;
if (fstatvfs(handle, &buf) != 0)
@@ -189,7 +195,7 @@ static bool isLikelyToBeNfs(int handle)
#endif
}
#else
-static inline bool isLikelyToBeNfs(int /* handle */)
+Q_AUTOTEST_EXPORT_HELPER inline bool qIsLikelyToBeNfs(int /* handle */)
{
return true;
}
@@ -203,7 +209,7 @@ static bool unixLock(int handle, int lockType)
now is to disable locking when we detect NFS (or AutoFS or
CacheFS, which are probably wrapping NFS).
*/
- if (isLikelyToBeNfs(handle))
+ if (qIsLikelyToBeNfs(handle))
return false;
struct flock fl;
diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp
index abaaa49..ce27bd3 100644
--- a/src/gui/dialogs/qinputdialog.cpp
+++ b/src/gui/dialogs/qinputdialog.cpp
@@ -561,6 +561,9 @@ void QInputDialog::setLabelText(const QString &text)
} else {
d->label->setText(text);
}
+#ifdef Q_OS_SYMBIAN
+ d->label->setWordWrap(true);
+#endif
}
QString QInputDialog::labelText() const
diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp
index 0dd4e99..f9c2e0c 100644
--- a/src/gui/image/qxbmhandler.cpp
+++ b/src/gui/image/qxbmhandler.cpp
@@ -66,27 +66,36 @@ static inline int hex2byte(register char *p)
static bool read_xbm_header(QIODevice *device, int& w, int& h)
{
const int buflen = 300;
+ const int maxlen = 4096;
char buf[buflen + 1];
QRegExp r1(QLatin1String("^#define[ \t]+[a-zA-Z0-9._]+[ \t]+"));
QRegExp r2(QLatin1String("[0-9]+"));
qint64 readBytes = 0;
+ qint64 totalReadBytes = 0;
- // "#define .._width <num>"
- readBytes = device->readLine(buf, buflen);
- if (readBytes <= 0)
- return false;
- buf[readBytes - 1] = '\0';
+ buf[0] = '\0';
// skip initial comment, if any
- while (buf[0] != '#' && (readBytes = device->readLine( buf, buflen )) > 0) {}
+ while (buf[0] != '#') {
+ readBytes = device->readLine(buf, buflen);
+
+ // if readBytes >= buflen, it's very probably not a C file
+ if (readBytes <= 0 || readBytes >= buflen -1)
+ return false;
+
+ // limit xbm headers to the first 4k in the file to prevent
+ // excessive reads on non-xbm files
+ totalReadBytes += readBytes;
+ if (totalReadBytes >= maxlen)
+ return false;
+ }
- if (readBytes <= 0)
- return false;
buf[readBytes - 1] = '\0';
QString sbuf;
sbuf = QString::fromLatin1(buf);
+ // "#define .._width <num>"
if (r1.indexIn(sbuf) == 0 &&
r2.indexIn(sbuf, r1.matchedLength()) == r1.matchedLength())
w = QByteArray(&buf[r1.matchedLength()]).trimmed().toInt();
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 6c4004e..a4ae46b 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -1430,10 +1430,18 @@ QStyle *QApplication::style()
// Compile-time search for default style
//
QString style;
- if (!QApplicationPrivate::styleOverride.isEmpty())
+#ifdef QT_BUILD_INTERNAL
+ QString envStyle = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE"));
+#else
+ QString envStyle;
+#endif
+ if (!QApplicationPrivate::styleOverride.isEmpty()) {
style = QApplicationPrivate::styleOverride;
- else
+ } else if (!envStyle.isEmpty()) {
+ style = envStyle;
+ } else {
style = QApplicationPrivate::desktopStyleKey();
+ }
QStyle *&app_style = QApplicationPrivate::app_style;
app_style = QStyleFactory::create(style);
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index a4cc5a3..7c68170 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -2334,6 +2334,30 @@ void qt_init(QApplicationPrivate *priv, int,
X11->desktopEnvironment = DE_4DWM;
break;
}
+
+ if (XGetWindowProperty(X11->display, QX11Info::appRootWindow(),
+ ATOM(_NET_SUPPORTING_WM_CHECK),
+ 0, 1024, False, XA_WINDOW, &type,
+ &format, &length, &after, &data) == Success) {
+ if (type == XA_WINDOW && format == 32) {
+ Window windowManagerWindow = *((Window*) data);
+ XFree(data);
+ data = 0;
+
+ if (windowManagerWindow != XNone) {
+ Atom utf8atom = ATOM(UTF8_STRING);
+ if (XGetWindowProperty(QX11Info::display(), windowManagerWindow, ATOM(_NET_WM_NAME),
+ 0, 1024, False, utf8atom, &type,
+ &format, &length, &after, &data) == Success) {
+ if (type == utf8atom && format == 8) {
+ if (qstrcmp((const char *)data, "MCompositor") == 0)
+ X11->desktopEnvironment = DE_MEEGO_COMPOSITOR;
+ }
+ }
+ }
+ }
+ }
+
} while(0);
if (data)
diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h
index d62d9c3..56c8094 100644
--- a/src/gui/kernel/qt_x11_p.h
+++ b/src/gui/kernel/qt_x11_p.h
@@ -338,6 +338,7 @@ enum DesktopEnvironment {
DE_KDE,
DE_GNOME,
DE_CDE,
+ DE_MEEGO_COMPOSITOR,
DE_4DWM
};
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 53ca28c..f3fb2f5 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -112,8 +112,6 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = {
// *** End of generated data ***
};
-QSet<const QWidget *> *QS60StylePrivate::m_autoFillDisabledWidgets = 0;
-
const short *QS60StylePrivate::m_pmPointer = QS60StylePrivate::data[0];
// theme background texture
@@ -154,8 +152,6 @@ const double KTabFontMul = 0.72;
QS60StylePrivate::~QS60StylePrivate()
{
- delete m_autoFillDisabledWidgets;
- m_autoFillDisabledWidgets = 0;
clearCaches(); //deletes also background image
deleteThemePalette();
#ifdef Q_WS_S60
@@ -3188,13 +3184,6 @@ void QS60Style::polish(QWidget *widget)
}
d->setThemePalette(widget);
d->setFont(widget);
-
- if (widget->autoFillBackground()) {
- if (!d->m_autoFillDisabledWidgets)
- d->m_autoFillDisabledWidgets = new QSet<const QWidget *>;
- widget->setAutoFillBackground(false);
- d->m_autoFillDisabledWidgets->insert(widget);
- }
}
/*!
@@ -3229,13 +3218,6 @@ void QS60Style::unpolish(QWidget *widget)
if (widget)
widget->setPalette(QPalette());
-
- if (d->m_autoFillDisabledWidgets &&
- !d->m_autoFillDisabledWidgets->isEmpty() &&
- d->m_autoFillDisabledWidgets->contains(widget)) {
- widget->setAutoFillBackground(true);
- d->m_autoFillDisabledWidgets->remove(widget);
- }
#if defined(Q_WS_S60) && !defined(QT_NO_PROGRESSBAR)
if (QProgressBar *bar = qobject_cast<QProgressBar *>(widget)) {
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index 3d66c40..b46f75e 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -625,7 +625,6 @@ private:
static qint64 m_webPaletteKey;
static QPointer<QWidget> m_pressedWidget;
- static QSet<const QWidget *> *m_autoFillDisabledWidgets;
#ifdef Q_WS_S60
//list of progress bars having animation running
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 4e5de53..02daa50 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -412,7 +412,9 @@ void QHttpNetworkConnectionChannel::_q_receiveReply()
}
case QHttpNetworkReplyPrivate::ReadingDataState: {
QHttpNetworkReplyPrivate *replyPrivate = reply->d_func();
- if (replyPrivate->downstreamLimited && !replyPrivate->responseData.isEmpty() && replyPrivate->shouldEmitSignals()) {
+ if (socket->state() == QAbstractSocket::ConnectedState &&
+ replyPrivate->downstreamLimited && !replyPrivate->responseData.isEmpty() && replyPrivate->shouldEmitSignals()) {
+ // (only do the following when still connected, not when we have already been disconnected and there is still data)
// We already have some HTTP body data. We don't read more from the socket until
// this is fetched by QHttpNetworkAccessHttpBackend. If we would read more,
// we could not limit our read buffer usage.
@@ -421,7 +423,6 @@ void QHttpNetworkConnectionChannel::_q_receiveReply()
// to the read buffer maximum size, but we don't care since they should be small.
return;
}
-
if (!replyPrivate->isChunked() && !replyPrivate->autoDecompress
&& replyPrivate->bodyLength > 0) {
// bulk files like images should fulfill these properties and
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index bc5a025..84f9517 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -426,7 +426,8 @@ template<> void QSharedDataPointer<QNetworkProxyPrivate>::detach()
QNetworkProxy::QNetworkProxy()
: d(0)
{
- globalNetworkProxy()->init();
+ if (QGlobalNetworkProxy *globalProxy = globalNetworkProxy())
+ globalProxy->init();
}
/*!
@@ -441,7 +442,8 @@ QNetworkProxy::QNetworkProxy(ProxyType type, const QString &hostName, quint16 po
const QString &user, const QString &password)
: d(new QNetworkProxyPrivate(type, hostName, port, user, password))
{
- globalNetworkProxy()->init();
+ if (QGlobalNetworkProxy *globalProxy = globalNetworkProxy())
+ globalProxy->init();
}
/*!
diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
index 559a6fd..167a7d2 100644
--- a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
+++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
@@ -63,8 +63,9 @@ QGLRect QGL2PEXVertexArray::boundingRect() const
void QGL2PEXVertexArray::addClosingLine(int index)
{
- if (QPointF(vertexArray.at(index)) != QPointF(vertexArray.last()))
- vertexArray.add(vertexArray.at(index));
+ QPointF point(vertexArray.at(index));
+ if (point != QPointF(vertexArray.last()))
+ vertexArray.add(point);
}
void QGL2PEXVertexArray::addCentroid(const QVectorPath &path, int subPathIndex)
diff --git a/src/plugins/bearer/icd/maemo_icd.cpp b/src/plugins/bearer/icd/maemo_icd.cpp
index 4f879e3..57ab0a8 100644
--- a/src/plugins/bearer/icd/maemo_icd.cpp
+++ b/src/plugins/bearer/icd/maemo_icd.cpp
@@ -508,6 +508,7 @@ uint IcdPrivate::state(QList<IcdStateResult>& state_results)
mInterface.clear();
while ((time(0)<=(started+timeout_secs)) && mInterface.isEmpty()) {
mDBus->synchronousDispatch(1000);
+ QCoreApplication::sendPostedEvents(icd, QEvent::MetaCall);
}
if (time(0)>(started+timeout_secs)) {
@@ -685,6 +686,7 @@ uint IcdPrivate::addrinfo(QList<IcdAddressInfoResult>& addr_results)
mInterface.clear();
while ((time(0)<=(started+timeout_secs)) && mInterface.isEmpty()) {
mDBus->synchronousDispatch(1000);
+ QCoreApplication::sendPostedEvents(icd, QEvent::MetaCall);
}
if (time(0)>(started+timeout_secs)) {
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp
index 37434e3..8d0f587 100644
--- a/src/plugins/bearer/icd/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp
@@ -679,7 +679,7 @@ void QNetworkSessionPrivateImpl::open()
if (serviceConfig.isValid()) {
lastError = QNetworkSession::OperationNotSupportedError;
emit QNetworkSessionPrivate::error(lastError);
- } else if (!isOpen) {
+ } else if (!opened) {
if (publicConfig.type() == QNetworkConfiguration::UserChoice) {
/* Caller is trying to connect to default IAP.
* At this time we will not know the IAP details so we just