diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp | 1 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/effectfactory.cpp | 17 | ||||
-rw-r--r-- | src/corelib/io/io.pri | 1 | ||||
-rw-r--r-- | src/corelib/io/qdatastream.cpp | 102 | ||||
-rw-r--r-- | src/corelib/io/qdatastream.h | 13 | ||||
-rw-r--r-- | src/corelib/io/qdatastream_p.h | 72 | ||||
-rw-r--r-- | src/gui/dialogs/qfontdialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 4 | ||||
-rw-r--r-- | src/gui/s60framework/qs60mainapplication.h | 2 | ||||
-rw-r--r-- | src/gui/styles/qs60style.h | 3 | ||||
-rw-r--r-- | src/script/script.pro | 3 |
11 files changed, 201 insertions, 19 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp index 05e3d7b..f7bda9e 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp @@ -46,7 +46,6 @@ #define DO_PROPERTYMAP_CONSTENCY_CHECK 0 #endif -using namespace std; using namespace WTF; namespace JSC { diff --git a/src/3rdparty/phonon/mmf/effectfactory.cpp b/src/3rdparty/phonon/mmf/effectfactory.cpp index 4acaaa4..9843a6c 100644 --- a/src/3rdparty/phonon/mmf/effectfactory.cpp +++ b/src/3rdparty/phonon/mmf/effectfactory.cpp @@ -17,6 +17,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. */ #include <QObject> +#include <QCoreApplication> #include <AudioEqualizerBase.h> #include <BassBoostBase.h> @@ -57,21 +58,21 @@ QHash<QByteArray, QVariant> EffectFactory::audioEffectDescriptions(AbstractAudio switch (type) { case AbstractAudioEffect::EffectAudioEqualizer: - return constructEffectDescription(QObject::tr("audio equalizer"), "Audio equalizer."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "audio equalizer"), "Audio equalizer."); case AbstractAudioEffect::EffectBassBoost: - return constructEffectDescription(QObject::tr("Bass boost"), "Bass boost."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Bass boost"), "Bass boost."); case AbstractAudioEffect::EffectDistanceAttenuation: - return constructEffectDescription(QObject::tr("Distance Attenuation"), "Distance Attenuation."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Distance Attenuation"), "Distance Attenuation."); case AbstractAudioEffect::EffectEnvironmentalReverb: - return constructEffectDescription(QObject::tr("Environmental Reverb"), "Environmental Reverb."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Environmental Reverb"), "Environmental Reverb."); case AbstractAudioEffect::EffectListenerOrientation: - return constructEffectDescription(QObject::tr("Environmental Reverb"), "Environmental Reverb."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Environmental Reverb"), "Environmental Reverb."); case AbstractAudioEffect::EffectLoudness: - return constructEffectDescription(QObject::tr("Loudness"), "Loudness."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Loudness"), "Loudness."); case AbstractAudioEffect::EffectSourceOrientation: - return constructEffectDescription(QObject::tr("Source Orientation"), "Source Orientation."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Source Orientation"), "Source Orientation."); case AbstractAudioEffect::EffectStereoWidening: - return constructEffectDescription(QObject::tr("Stereo Widening"), "Stereo Widening."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Stereo Widening"), "Stereo Widening."); } Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown effect type."); diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index bca9baa..02a1586 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -5,6 +5,7 @@ HEADERS += \ io/qabstractfileengine_p.h \ io/qbuffer.h \ io/qdatastream.h \ + io/qdatastream_p.h \ io/qdebug.h \ io/qdir.h \ io/qdiriterator.h \ diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index 9339b8e..cc62201 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qdatastream.h" +#include "qdatastream_p.h" #ifndef QT_NO_DATASTREAM #include "qbuffer.h" @@ -193,6 +194,21 @@ QT_BEGIN_NAMESPACE */ /*! + \enum QDataStream::FloatingPointPrecision + + The precision of floating point numbers used for reading/writing the data. This will only have + an effect if the version of the data stream is Qt_4_6 or higher. + + \warning The floating point precision must be set to the same value on the object that writes + and the object that reads the data stream. + + \value SinglePrecision All floating point numbers in the data stream have 32-bit precision. + \value DoublePrecision All floating point numbers in the data stream have 64-bit precision. + + \sa setFloatingPointPrecision(), floatingPointPrecision() +*/ + +/*! \enum QDataStream::Status This enum describes the current status of the data stream. @@ -222,7 +238,7 @@ QT_BEGIN_NAMESPACE #endif enum { - DefaultStreamVersion = QDataStream::Qt_4_5 + DefaultStreamVersion = QDataStream::Qt_4_6 }; // ### 5.0: when streaming invalid QVariants, just the type should @@ -414,6 +430,42 @@ bool QDataStream::atEnd() const } /*! + Returns the floating point precision of the data stream. + + \since 4.6 + + \sa FloatingPointPrecision setFloatingPointPrecision() +*/ +QDataStream::FloatingPointPrecision QDataStream::floatingPointPrecision() const +{ + return d == 0 ? QDataStream::DoublePrecision : d->floatingPointPrecision; +} + +/*! + Sets the floating point precision of the data stream. If the floating point precision is + DoublePrecision and the version of the data stream is Qt_4_6 or higher, all floating point + numbers will be written and read with 64-bit precision. If the floating point precision is + SinglePrecision and the version is Qt_4_6 or higher, all floating point numbers will be written + and read with 32-bit precision. + + For versions prior to Qt_4_6, the precision of floating point numbers in the data stream depends + on the stream operator called. + + The default is DoublePrecision. + + \warning This property must be set to the same value on the object that writes and the object + that reads the data stream. + + \since 4.6 +*/ +void QDataStream::setFloatingPointPrecision(QDataStream::FloatingPointPrecision precision) +{ + if (d == 0) + d.reset(new QDataStreamPrivate()); + d->floatingPointPrecision = precision; +} + +/*! Returns the status of the data stream. \sa Status setStatus() resetStatus() @@ -517,7 +569,7 @@ void QDataStream::setByteOrder(ByteOrder bo) \value Qt_4_3 Version 9 (Qt 4.3) \value Qt_4_4 Version 10 (Qt 4.4) \value Qt_4_5 Version 11 (Qt 4.5) - \omitvalue Qt_4_6 + \value Qt_4_6 Version 12 (Qt 4.6) \sa setVersion(), version() */ @@ -754,13 +806,23 @@ QDataStream &QDataStream::operator>>(bool &i) /*! \overload - Reads a 32-bit floating point number from the stream into \a f, + Reads a floating point number from the stream into \a f, using the standard IEEE 754 format. Returns a reference to the stream. + + \sa setFloatingPointPrecision() */ QDataStream &QDataStream::operator>>(float &f) -{ +{ + if (version() >= QDataStream::Qt_4_6 + && floatingPointPrecision() == QDataStream::DoublePrecision) { + double d; + *this >> d; + f = d; + return *this; + } + f = 0.0f; CHECK_STREAM_PRECOND(*this) if (noswap) { @@ -796,13 +858,23 @@ QDataStream &QDataStream::operator>>(float &f) /*! \overload - Reads a 64-bit floating point number from the stream into \a f, + Reads a floating point number from the stream into \a f, using the standard IEEE 754 format. Returns a reference to the stream. + + \sa setFloatingPointPrecision() */ QDataStream &QDataStream::operator>>(double &f) { + if (version() >= QDataStream::Qt_4_6 + && floatingPointPrecision() == QDataStream::SinglePrecision) { + float d; + *this >> d; + f = d; + return *this; + } + f = 0.0; CHECK_STREAM_PRECOND(*this) #ifndef Q_DOUBLE_FORMAT @@ -1115,12 +1187,20 @@ QDataStream &QDataStream::operator<<(bool i) /*! \overload - Writes a 32-bit floating point number, \a f, to the stream using + Writes a floating point number, \a f, to the stream using the standard IEEE 754 format. Returns a reference to the stream. + + \sa setFloatingPointPrecision() */ QDataStream &QDataStream::operator<<(float f) { + if (version() >= QDataStream::Qt_4_6 + && floatingPointPrecision() == QDataStream::DoublePrecision) { + *this << double(f); + return *this; + } + CHECK_STREAM_PRECOND(*this) float g = f; // fixes float-on-stack problem if (noswap) { // no conversion needed @@ -1146,12 +1226,20 @@ QDataStream &QDataStream::operator<<(float f) /*! \overload - Writes a 64-bit floating point number, \a f, to the stream using + Writes a floating point number, \a f, to the stream using the standard IEEE 754 format. Returns a reference to the stream. + + \sa setFloatingPointPrecision() */ QDataStream &QDataStream::operator<<(double f) { + if (version() >= QDataStream::Qt_4_6 + && floatingPointPrecision() == QDataStream::SinglePrecision) { + *this << float(f); + return *this; + } + CHECK_STREAM_PRECOND(*this) #ifndef Q_DOUBLE_FORMAT if (noswap) { diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h index b376de6..6e83204 100644 --- a/src/corelib/io/qdatastream.h +++ b/src/corelib/io/qdatastream.h @@ -42,6 +42,7 @@ #ifndef QDATASTREAM_H #define QDATASTREAM_H +#include <QtCore/qscopedpointer.h> #include <QtCore/qiodevice.h> #include <QtCore/qglobal.h> @@ -83,7 +84,7 @@ public: Qt_4_3 = 9, Qt_4_4 = 10, Qt_4_5 = 11, - Qt_4_6 = Qt_4_5 + Qt_4_6 = 12, #if QT_VERSION >= 0x040700 #error Add the datastream version for this Qt version Qt_4_7 = Qt_4_6 @@ -101,6 +102,11 @@ public: ReadCorruptData }; + enum FloatingPointPrecision { + SinglePrecision, + DoublePrecision + }; + QDataStream(); explicit QDataStream(QIODevice *); #ifdef QT3_SUPPORT @@ -123,6 +129,9 @@ public: void setStatus(Status status); void resetStatus(); + FloatingPointPrecision floatingPointPrecision() const; + void setFloatingPointPrecision(FloatingPointPrecision precision); + ByteOrder byteOrder() const; void setByteOrder(ByteOrder); @@ -176,7 +185,7 @@ public: private: Q_DISABLE_COPY(QDataStream) - QDataStreamPrivate *d; + QScopedPointer<QDataStreamPrivate> d; QIODevice *dev; bool owndev; diff --git a/src/corelib/io/qdatastream_p.h b/src/corelib/io/qdatastream_p.h new file mode 100644 index 0000000..157fee9 --- /dev/null +++ b/src/corelib/io/qdatastream_p.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDATASTREAM_P_H +#define QDATASTREAM_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <qdatastream.h> + +QT_BEGIN_NAMESPACE + +#ifndef QT_NO_DATASTREAM +class QDataStreamPrivate +{ +public: + QDataStreamPrivate() : floatingPointPrecision(QDataStream::DoublePrecision) { } + + QDataStream::FloatingPointPrecision floatingPointPrecision; +}; +#endif + +QT_END_NAMESPACE + +#endif // QDATASTREAM_P_H diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp index ca882c5..60fae27 100644 --- a/src/gui/dialogs/qfontdialog.cpp +++ b/src/gui/dialogs/qfontdialog.cpp @@ -602,6 +602,8 @@ void QFontDialogPrivate::updateStyles() } if (!found) styleList->setCurrentItem(0); + } else { + styleList->setCurrentItem(0); } styleEdit->setText(styleList->currentText()); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 08fe5b9..e2de148 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -11454,6 +11454,10 @@ QWidget *QWidgetPrivate::widgetInNavigationDirection(Direction direction) QWidget *targetWidget = 0; int shortestDistance = INT_MAX; foreach(QWidget *targetCandidate, QApplication::allWidgets()) { + + if (targetCandidate->focusProxy()) //skip if focus proxy set + continue; + const QRect targetCandidateRect = targetCandidate->rect().translated(targetCandidate->mapToGlobal(QPoint())); if ( targetCandidate != sourceWidget && targetCandidate->focusPolicy() & Qt::TabFocus diff --git a/src/gui/s60framework/qs60mainapplication.h b/src/gui/s60framework/qs60mainapplication.h index 457764c..5f621e0 100644 --- a/src/gui/s60framework/qs60mainapplication.h +++ b/src/gui/s60framework/qs60mainapplication.h @@ -42,7 +42,7 @@ #ifndef QS60MAINAPPLICATION_H #define QS60MAINAPPLICATION_H -#include <qglobal.h> +#include <QtCore/qglobal.h> #ifdef Q_WS_S60 diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h index fd18bc3..6be3197 100644 --- a/src/gui/styles/qs60style.h +++ b/src/gui/styles/qs60style.h @@ -76,6 +76,9 @@ public: void unpolish(QWidget *widget); void polish(QApplication *application); void unpolish(QApplication *application); +#ifndef Q_NO_USING_KEYWORD + using QCommonStyle::polish; +#endif void setStyleProperty(const char *name, const QVariant &value); QVariant styleProperty(const char *name) const; diff --git a/src/script/script.pro b/src/script/script.pro index 6c6b701..659aa26 100644 --- a/src/script/script.pro +++ b/src/script/script.pro @@ -62,6 +62,9 @@ DEFINES += WTF_USE_JAVASCRIPTCORE_BINDINGS=1 WTF_CHANGES=1 DEFINES += NDEBUG +# Avoid JSC C API functions being exported. +DEFINES += JS_EXPORT="" JS_EXPORTDATA="" + INCLUDEPATH += $$PWD include(script.pri) |