diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-18 15:48:32 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-18 15:48:32 (GMT) |
commit | 4baa9dfb5273d7b501dcb3f456983262c53cc8d1 (patch) | |
tree | af04bea96067fcb8c282067aea00703a25b52069 /src/corelib | |
parent | 9eacc56619ce471a9777f88c89f64ca95cd6ae63 (diff) | |
parent | c18beac8163634b48bbf1e7280923e96f5ef0a51 (diff) | |
download | Qt-4baa9dfb5273d7b501dcb3f456983262c53cc8d1.zip Qt-4baa9dfb5273d7b501dcb3f456983262c53cc8d1.tar.gz Qt-4baa9dfb5273d7b501dcb3f456983262c53cc8d1.tar.bz2 |
Merge remote branch 'origin/master' into qt-master-from-4.6
Conflicts:
src/corelib/codecs/qtextcodec.h
tests/auto/gestures/tst_gestures.cpp
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/codecs/qtextcodec.h | 5 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.h | 3 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 1 | ||||
-rw-r--r-- | src/corelib/io/qdataurl.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qdataurl_p.h | 2 | ||||
-rw-r--r-- | src/corelib/io/qdir.cpp | 18 | ||||
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qsharedpointer_impl.h | 49 |
8 files changed, 59 insertions, 23 deletions
diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h index e00d7b4..4e85bf5 100644 --- a/src/corelib/codecs/qtextcodec.h +++ b/src/corelib/codecs/qtextcodec.h @@ -171,12 +171,7 @@ public: private: const QTextCodec *c; QTextCodec::ConverterState state; - - friend class QXmlStreamWriter; - friend class QXmlStreamWriterPrivate; #if defined Q_XMLSTREAM_RENAME_SYMBOLS - friend class QCoreXmlStreamWriter; - friend class QCoreXmlStreamWriterPrivate; #endif }; diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 35ff8e7..6ee8ae9 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1725,7 +1725,8 @@ public: enum GestureFlag { DontStartGestureOnChildren = 0x01, - ReceivePartialGestures = 0x02 + ReceivePartialGestures = 0x02, + IgnoredGesturesPropagateToParent = 0x04 }; Q_DECLARE_FLAGS(GestureFlags, GestureFlag) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 1f1c8f7..db910ce 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -42,6 +42,7 @@ /*! \namespace Qt \inmodule QtCore + \target Qt Namespace \brief The Qt namespace contains miscellaneous identifiers used throughout the Qt library. diff --git a/src/corelib/io/qdataurl.cpp b/src/corelib/io/qdataurl.cpp index 9bb896e..4e2dec2 100644 --- a/src/corelib/io/qdataurl.cpp +++ b/src/corelib/io/qdataurl.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/corelib/io/qdataurl_p.h b/src/corelib/io/qdataurl_p.h index be5b10d..57cfd75 100644 --- a/src/corelib/io/qdataurl_p.h +++ b/src/corelib/io/qdataurl_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index f5d803e..7cfdddf 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -89,8 +89,6 @@ public: QDirPrivate(const QDir *copy = 0); ~QDirPrivate(); - QString initFileEngine(const QString &file); - void updateFileLists() const; void sortFileList(QDir::SortFlags, QFileInfoList &, QStringList *, QFileInfoList *) const; @@ -146,6 +144,7 @@ public: } *data; inline void setPath(const QString &p) { + detach(false); QString path = p; if ((path.endsWith(QLatin1Char('/')) || path.endsWith(QLatin1Char('\\'))) && path.length() > 1) { @@ -155,8 +154,12 @@ public: path.truncate(path.length() - 1); } + delete data->fileEngine; + data->fileEngine = QAbstractFileEngine::create(path); + // set the path to be the qt friendly version so then we can operate on it using just / - data->path = initFileEngine(path); + data->path = data->fileEngine->fileName(QAbstractFileEngine::DefaultName); + data->clear(); } inline void reset() { detach(); @@ -310,15 +313,6 @@ inline void QDirPrivate::updateFileLists() const } } -inline QString QDirPrivate::initFileEngine(const QString &path) -{ - detach(false); - data->clear(); - delete data->fileEngine; - data->fileEngine = QAbstractFileEngine::create(path); - return data->fileEngine->fileName(QAbstractFileEngine::DefaultName); -} - void QDirPrivate::detach(bool createFileEngine) { qAtomicDetach(data); diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index ff10fa1..b4bfcaf 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -2917,7 +2917,7 @@ QDate QLocale::toDate(const QString &string, FormatType format) const #ifndef QT_NO_DATESTRING QDateTime QLocale::toDateTime(const QString &string, FormatType format) const { - return toDateTime(string, dateFormat(format)); + return toDateTime(string, dateTimeFormat(format)); } #endif diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 8fbfcda..0dcea5f 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -653,6 +653,9 @@ public: T *value; }; +// +// operator== and operator!= +// template <class T, class X> bool operator==(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2) { @@ -674,7 +677,6 @@ bool operator==(const T *ptr1, const QSharedPointer<X> &ptr2) { return ptr1 == ptr2.data(); } - template <class T, class X> bool operator!=(const QSharedPointer<T> &ptr1, const X *ptr2) { @@ -697,11 +699,54 @@ bool operator!=(const QSharedPointer<T> &ptr1, const QWeakPointer<X> &ptr2) return ptr2 != ptr1; } +// +// operator- +// template <class T, class X> -Q_INLINE_TEMPLATE typename T::difference_type operator-(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2) +Q_INLINE_TEMPLATE typename QSharedPointer<T>::difference_type operator-(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2) { return ptr1.data() - ptr2.data(); } +template <class T, class X> +Q_INLINE_TEMPLATE typename QSharedPointer<T>::difference_type operator-(const QSharedPointer<T> &ptr1, X *ptr2) +{ + return ptr1.data() - ptr2; +} +template <class T, class X> +Q_INLINE_TEMPLATE typename QSharedPointer<X>::difference_type operator-(T *ptr1, const QSharedPointer<X> &ptr2) +{ + return ptr1 - ptr2.data(); +} + +// +// operator< +// +template <class T, class X> +Q_INLINE_TEMPLATE bool operator<(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2) +{ + return ptr1.data() < ptr2.data(); +} +template <class T, class X> +Q_INLINE_TEMPLATE bool operator<(const QSharedPointer<T> &ptr1, X *ptr2) +{ + return ptr1.data() < ptr2; +} +template <class T, class X> +Q_INLINE_TEMPLATE bool operator<(T *ptr1, const QSharedPointer<X> &ptr2) +{ + return ptr1 < ptr2.data(); +} + +// +// qHash +// +template <class T> inline uint qHash(const T *key); // defined in qhash.h +template <class T> +Q_INLINE_TEMPLATE uint qHash(const QSharedPointer<T> &ptr) +{ + return QT_PREPEND_NAMESPACE(qHash)<T>(ptr.data()); +} + template <class T> Q_INLINE_TEMPLATE QWeakPointer<T> QSharedPointer<T>::toWeakRef() const |