summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-11-05 16:35:28 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-11-05 16:35:28 (GMT)
commit58bac5551cbeed83a99e257226bb7b40d363bab9 (patch)
tree4c4f47fc20f53a29e4d5dcfa3e59b8e7d523dee3 /src
parentebecf192abe56c405409343acc2f97eaf9124fc3 (diff)
parent60b09b8915e2095b221eb0a16a76d49e5bb10391 (diff)
downloadQt-58bac5551cbeed83a99e257226bb7b40d363bab9.zip
Qt-58bac5551cbeed83a99e257226bb7b40d363bab9.tar.gz
Qt-58bac5551cbeed83a99e257226bb7b40d363bab9.tar.bz2
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts: mkspecs/features/symbian/symbian_building.prf src/network/access/qhttpnetworkconnectionchannel.cpp
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qsettings.cpp16
-rw-r--r--src/corelib/tools/qpoint.cpp6
-rw-r--r--src/corelib/tools/qsize.cpp6
-rw-r--r--src/dbus/qdbusconnection.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage.cpp2
-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.cpp4
-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
17 files changed, 94 insertions, 45 deletions
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 131764b..7235459 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/corelib/tools/qpoint.cpp b/src/corelib/tools/qpoint.cpp
index 66f06e9..c297709 100644
--- a/src/corelib/tools/qpoint.cpp
+++ b/src/corelib/tools/qpoint.cpp
@@ -438,8 +438,12 @@ QDebug operator<<(QDebug d, const QPointF &p)
/*!
\fn bool QPointF::isNull() const
- Returns true if both the x and y coordinates are set to 0.0,
+ Returns true if both the x and y coordinates are set to +0.0;
otherwise returns false.
+
+ \note Since this function treats +0.0 and -0.0 differently, points
+ with zero-valued coordinates where either or both values have a
+ negative sign are not defined to be null points.
*/
diff --git a/src/corelib/tools/qsize.cpp b/src/corelib/tools/qsize.cpp
index 20ac344..12287ab 100644
--- a/src/corelib/tools/qsize.cpp
+++ b/src/corelib/tools/qsize.cpp
@@ -492,9 +492,13 @@ QDebug operator<<(QDebug dbg, const QSize &s) {
/*!
\fn bool QSizeF::isNull() const
- Returns true if both the width and height is 0; otherwise returns
+ Returns true if both the width and height are +0.0; otherwise returns
false.
+ \note Since this function treats +0.0 and -0.0 differently, sizes with
+ zero width and height where either or both values have a negative
+ sign are not defined to be null sizes.
+
\sa isValid(), isEmpty()
*/
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
index bf771a8..f68a8ca 100644
--- a/src/dbus/qdbusconnection.cpp
+++ b/src/dbus/qdbusconnection.cpp
@@ -140,9 +140,9 @@ void QDBusConnectionManager::setConnection(const QString &name, QDBusConnectionP
\fn QDBusConnection &QDBusConnection::sessionBus()
\relates QDBusConnection
- Returns a QDBusConnection object opened with the session bus. The object reference returned
- by this function is valid until the QCoreApplication's destructor is run, when the
- connection will be closed and the object, deleted.
+ Returns a QDBusConnection object opened with the session bus. The object
+ reference returned by this function is valid until the application terminates,
+ at which point the connection will be closed and the object deleted.
*/
/*!
\fn QDBusConnection &QDBusConnection::systemBus()
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
index c58a08d..649c8fb 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
@@ -361,6 +361,8 @@ QDeclarativeScaleGrid *QDeclarativeBorderImage::border()
\o BorderImage.Repeat - Tile the image until there is no more space. May crop the last image.
\o BorderImage.Round - Like Repeat, but scales the images down to ensure that the last image is not cropped.
\endlist
+
+ The default tile mode for each property is BorderImage.Stretch.
*/
QDeclarativeBorderImage::TileMode QDeclarativeBorderImage::horizontalTileMode() const
{
diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp
index 778e796..9e4b9b6 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 1d80809..833e803 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -1433,10 +1433,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 cbc2356..ff98229 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -2335,6 +2335,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 1262340..6fb3689 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 d8530cc..fe5946a 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -417,7 +417,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.
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