summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2010-07-14 06:55:05 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2010-07-14 06:55:05 (GMT)
commit0832d7209e3aee7055fb39339030ff6842f4117d (patch)
tree75ec174a5492d0ddc52bc2f4dcdef363714a63cb /src/corelib/tools
parentad0d0c4b6f7958b3cde01855b0f3b9c68db5253a (diff)
parentdf28c1203e12c572f795b8d114254a8e5a6619e8 (diff)
downloadQt-0832d7209e3aee7055fb39339030ff6842f4117d.zip
Qt-0832d7209e3aee7055fb39339030ff6842f4117d.tar.gz
Qt-0832d7209e3aee7055fb39339030ff6842f4117d.tar.bz2
Merge remote branch 'qt/4.7' into lighthouse-4.7
Conflicts: src/gui/image/image.pri src/gui/image/qpixmapdatafactory.cpp src/gui/painting/qgraphicssystem.cpp
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qbytearray.cpp5
-rw-r--r--src/corelib/tools/qdatetime.cpp29
-rw-r--r--src/corelib/tools/qsimd_p.h4
-rw-r--r--src/corelib/tools/tools.pri23
4 files changed, 37 insertions, 24 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 05d38f6..b46af1f 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -1805,6 +1805,11 @@ QByteArray &QByteArray::replace(int pos, int len, const QByteArray &after)
/*! \fn QByteArray &QByteArray::replace(int pos, int len, const char *after)
\overload
+
+ Replaces \a len bytes from index position \a pos with the zero terminated
+ string \a after.
+
+ Notice: this can change the lenght of the byte array.
*/
QByteArray &QByteArray::replace(int pos, int len, const char *after)
{
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index ae8aad6..ab7530d 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -1843,7 +1843,7 @@ QTime QTime::fromString(const QString& s, Qt::DateFormat f)
const QString msec_s(QLatin1String("0.") + s.mid(9, 4));
const float msec(msec_s.toFloat(&ok));
if (!ok)
- return QTime();
+ return QTime(hour, minute, second, 0);
return QTime(hour, minute, second, qMin(qRound(msec * 1000.0), 999));
}
}
@@ -3304,12 +3304,37 @@ QDateTime QDateTime::fromString(const QString& s, Qt::DateFormat f)
if (tmp.size() == 10)
return QDateTime(date);
+ tmp = tmp.mid(11);
+
// Recognize UTC specifications
if (tmp.endsWith(QLatin1Char('Z'))) {
ts = Qt::UTC;
tmp.chop(1);
}
- return QDateTime(date, QTime::fromString(tmp.mid(11), Qt::ISODate), ts);
+
+ // Recognize timezone specifications
+ QRegExp rx(QLatin1String("[+-]"));
+ if (tmp.contains(rx)) {
+ int idx = tmp.indexOf(rx);
+ QString tmp2 = tmp.mid(idx);
+ tmp = tmp.left(idx);
+ bool ok = true;
+ int ntzhour = 1;
+ int ntzminute = 3;
+ if ( tmp2.indexOf(QLatin1Char(':')) == 3 )
+ ntzminute = 4;
+ const int tzhour(tmp2.mid(ntzhour, 2).toInt(&ok));
+ const int tzminute(tmp2.mid(ntzminute, 2).toInt(&ok));
+ QTime tzt(tzhour, tzminute);
+ int utcOffset = (tzt.hour() * 60 + tzt.minute()) * 60;
+ if ( utcOffset != 0 ) {
+ ts = Qt::OffsetFromUTC;
+ QDateTime dt(date, QTime::fromString(tmp, Qt::ISODate), ts);
+ dt.setUtcOffset( utcOffset * (tmp2.startsWith(QLatin1Char('-')) ? -1 : 1) );
+ return dt;
+ }
+ }
+ return QDateTime(date, QTime::fromString(tmp, Qt::ISODate), ts);
}
case Qt::SystemLocaleDate:
case Qt::SystemLocaleShortDate:
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index cbe6146..0ed9d5d 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -58,7 +58,7 @@ QT_BEGIN_HEADER
#endif
// SSE intrinsics
-#if defined(__SSE2__) && defined(QT_HAVE_SSE2) && !defined(QT_BOOTSTRAPPED)
+#if defined(QT_HAVE_SSE2) && (defined(__SSE2__) || defined(Q_CC_MSVC))
#if defined(QT_LINUXBASE)
/// this is an evil hack - the posix_memalign declaration in LSB
/// is wrong - see http://bugs.linuxbase.org/show_bug.cgi?id=2431
@@ -72,8 +72,10 @@ QT_BEGIN_HEADER
# include <emmintrin.h>
#endif
+#if !defined(QT_BOOTSTRAPPED) && (!defined(Q_CC_MSVC) || (defined(_M_X64) || _M_IX86_FP == 2))
#define QT_ALWAYS_HAVE_SSE2
#endif
+#endif // defined(QT_HAVE_SSE2) && (defined(__SSE2__) || defined(Q_CC_MSVC))
// NEON intrinsics
#if defined(QT_HAVE_NEON)
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 8807612..03bb32d 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -89,27 +89,8 @@ else:unix:SOURCES += tools/qelapsedtimer_unix.cpp
else:win32:SOURCES += tools/qelapsedtimer_win.cpp
else:SOURCES += tools/qelapsedtimer_generic.cpp
-#zlib support
-contains(QT_CONFIG, zlib) {
- wince*: DEFINES += NO_ERRNO_H
- INCLUDEPATH += ../3rdparty/zlib
- SOURCES+= \
- ../3rdparty/zlib/adler32.c \
- ../3rdparty/zlib/compress.c \
- ../3rdparty/zlib/crc32.c \
- ../3rdparty/zlib/deflate.c \
- ../3rdparty/zlib/gzio.c \
- ../3rdparty/zlib/inffast.c \
- ../3rdparty/zlib/inflate.c \
- ../3rdparty/zlib/inftrees.c \
- ../3rdparty/zlib/trees.c \
- ../3rdparty/zlib/uncompr.c \
- ../3rdparty/zlib/zutil.c
-} else:!contains(QT_CONFIG, no-zlib) {
- symbian:LIBS_PRIVATE += -llibz
- else:if(unix|win32-g++*):LIBS_PRIVATE += -lz
- else:LIBS += zdll.lib
-}
+contains(QT_CONFIG, zlib):include($$PWD/../../3rdparty/zlib.pri)
+else:include($$PWD/../../3rdparty/zlib_dependency.pri)
DEFINES += HB_EXPORT=Q_CORE_EXPORT
INCLUDEPATH += ../3rdparty/harfbuzz/src