diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2010-06-16 15:23:34 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2010-06-16 15:23:34 (GMT) |
commit | 0b9638476c1a8bad4e33cbd20be1f6ff33935766 (patch) | |
tree | 968c6927ef9cda975f1065c41d93882231383588 /src/corelib | |
parent | 8cb10f381af7fd6f1fa0ffc946f6a4e6ba106d5d (diff) | |
parent | c9a89b253176547901e11d27c042983a65f43b1f (diff) | |
download | Qt-0b9638476c1a8bad4e33cbd20be1f6ff33935766.zip Qt-0b9638476c1a8bad4e33cbd20be1f6ff33935766.tar.gz Qt-0b9638476c1a8bad4e33cbd20be1f6ff33935766.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into qt-4.7-from-4.6
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qendian.h | 24 | ||||
-rw-r--r-- | src/corelib/io/qfsfileengine_win.cpp | 10 | ||||
-rw-r--r-- | src/corelib/kernel/qabstractitemmodel.cpp | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_glib.cpp | 3 | ||||
-rw-r--r-- | src/corelib/tools/qstring.cpp | 4 | ||||
-rw-r--r-- | src/corelib/tools/tools.pri | 5 |
6 files changed, 44 insertions, 4 deletions
diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h index 107854c..d53504a 100644 --- a/src/corelib/global/qendian.h +++ b/src/corelib/global/qendian.h @@ -44,6 +44,14 @@ #include <QtCore/qglobal.h> +#ifdef Q_OS_LINUX +# include <features.h> +#endif + +#ifdef __GLIBC__ +#include <byteswap.h> +#endif + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -264,6 +272,21 @@ template <> inline qint16 qFromBigEndian<qint16>(const uchar *src) * and it is therefore a bit more convenient and in most cases more efficient. */ template <typename T> T qbswap(T source); + +#ifdef __GLIBC__ +template <> inline quint64 qbswap<quint64>(quint64 source) +{ + return bswap_64(source); +} +template <> inline quint32 qbswap<quint32>(quint32 source) +{ + return bswap_32(source); +} +template <> inline quint16 qbswap<quint16>(quint16 source) +{ + return bswap_16(source); +} +#else template <> inline quint64 qbswap<quint64>(quint64 source) { return 0 @@ -292,6 +315,7 @@ template <> inline quint16 qbswap<quint16>(quint16 source) | ((source & 0x00ff) << 8) | ((source & 0xff00) >> 8) ); } +#endif // __GLIBC__ // signed specializations template <> inline qint64 qbswap<qint64>(qint64 source) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index ec49f1a..21930e1 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -1162,7 +1162,15 @@ bool QFSFileEnginePrivate::doStat() const if (filePath.isEmpty()) return could_stat; - QString fname = filePath.endsWith(QLatin1String(".lnk")) ? readLink(filePath) : filePath; + QString fname; + if(filePath.endsWith(QLatin1String(".lnk"))) { + fname = readLink(filePath); + if(fname.isEmpty()) + return could_stat; + } + else + fname = filePath; + fname = fixIfRelativeUncPath(fname); UINT oldmode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp index b0e2f48..8415259 100644 --- a/src/corelib/kernel/qabstractitemmodel.cpp +++ b/src/corelib/kernel/qabstractitemmodel.cpp @@ -2854,7 +2854,7 @@ void QAbstractItemModel::endMoveColumns() \note Use beginResetModel() and endResetModel() instead whenever possible. Use this method only if there is no way to call beginResetModel() before invalidating the model. - Otherwise it could lead to unexcpected behaviour, especially when used with proxy models. + Otherwise it could lead to unexpected behaviour, especially when used with proxy models. */ void QAbstractItemModel::reset() { diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp index fd36be4..9c1c827 100644 --- a/src/corelib/kernel/qeventdispatcher_glib.cpp +++ b/src/corelib/kernel/qeventdispatcher_glib.cpp @@ -246,6 +246,7 @@ struct GPostEventSource GSource source; QAtomicInt serialNumber; int lastSerialNumber; + QEventDispatcherGlibPrivate *d; }; static gboolean postEventSourcePrepare(GSource *s, gint *timeout) @@ -274,6 +275,7 @@ static gboolean postEventSourceDispatch(GSource *s, GSourceFunc, gpointer) GPostEventSource *source = reinterpret_cast<GPostEventSource *>(s); source->lastSerialNumber = source->serialNumber; QCoreApplication::sendPostedEvents(); + source->d->runTimersOnceWithNormalPriority(); return true; // i dunno, george... } @@ -313,6 +315,7 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context) postEventSource = reinterpret_cast<GPostEventSource *>(g_source_new(&postEventSourceFuncs, sizeof(GPostEventSource))); postEventSource->serialNumber = 1; + postEventSource->d = this; g_source_set_can_recurse(&postEventSource->source, true); g_source_attach(&postEventSource->source, mainContext); diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 1d5fab3..57f79a0 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -4768,6 +4768,10 @@ int QString::localeAwareCompare_helper(const QChar *data1, int length1, CFRelease(thisString); CFRelease(otherString); return result; +#elif defined(Q_OS_SYMBIAN) + TPtrC p1 = TPtrC16(reinterpret_cast<const TUint16 *>(data1), length1); + TPtrC p2 = TPtrC16(reinterpret_cast<const TUint16 *>(data2), length2); + return p1.CompareC(p2); #elif defined(Q_OS_UNIX) // declared in <string.h> int delta = strcoll(toLocal8Bit_helper(data1, length1), toLocal8Bit_helper(data2, length2)); diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index 4e0ebbc..e579dd5 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -106,8 +106,9 @@ contains(QT_CONFIG, zlib) { ../3rdparty/zlib/uncompr.c \ ../3rdparty/zlib/zutil.c } else:!contains(QT_CONFIG, no-zlib) { - unix:LIBS_PRIVATE += -lz -# win32:LIBS += libz.lib + symbian:LIBS_PRIVATE += -llibz + else:if(unix|win32-g++*):LIBS_PRIVATE += -lz + else:LIBS += zdll.lib } DEFINES += HB_EXPORT=Q_CORE_EXPORT |