summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2010-01-13 20:08:26 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2010-01-13 20:08:26 (GMT)
commit0193617fe21486561ae55403b80419ad1a9105b2 (patch)
treeda00c7b6a8920a586450e10d58b7fcb8b84ce26d /src
parentcf32ca450a80d0a9d0be36d74320de651b83ad63 (diff)
parentdc5c5104a3f31b03954b33e1c098e17bc4634f27 (diff)
downloadQt-0193617fe21486561ae55403b80419ad1a9105b2.zip
Qt-0193617fe21486561ae55403b80419ad1a9105b2.tar.gz
Qt-0193617fe21486561ae55403b80419ad1a9105b2.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/phonon/mmf/abstractaudioeffect.cpp139
-rw-r--r--src/3rdparty/phonon/mmf/abstractaudioeffect.h66
-rw-r--r--src/3rdparty/phonon/mmf/abstractplayer.h4
-rw-r--r--src/3rdparty/phonon/mmf/audioequalizer.cpp103
-rw-r--r--src/3rdparty/phonon/mmf/audioequalizer.h20
-rw-r--r--src/3rdparty/phonon/mmf/backend.cpp11
-rw-r--r--src/3rdparty/phonon/mmf/backend.h2
-rw-r--r--src/3rdparty/phonon/mmf/bassboost.cpp29
-rw-r--r--src/3rdparty/phonon/mmf/bassboost.h21
-rw-r--r--src/3rdparty/phonon/mmf/effectfactory.cpp223
-rw-r--r--src/3rdparty/phonon/mmf/effectfactory.h51
-rw-r--r--src/3rdparty/phonon/mmf/effectparameter.cpp71
-rw-r--r--src/3rdparty/phonon/mmf/effectparameter.h74
-rw-r--r--src/3rdparty/phonon/mmf/environmentalreverb.cpp201
-rw-r--r--src/3rdparty/phonon/mmf/environmentalreverb.h62
-rw-r--r--src/3rdparty/phonon/mmf/loudness.cpp58
-rw-r--r--src/3rdparty/phonon/mmf/loudness.h60
-rw-r--r--src/3rdparty/phonon/mmf/mediaobject.cpp3
-rw-r--r--src/3rdparty/phonon/mmf/mediaobject.h5
-rw-r--r--src/3rdparty/phonon/mmf/stereowidening.cpp93
-rw-r--r--src/3rdparty/phonon/mmf/stereowidening.h62
-rw-r--r--src/3rdparty/phonon/phonon/effectwidget.cpp4
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog25
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro9
-rw-r--r--src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp30
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp84
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog18
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/testiframe.html54
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/testiframe2.html21
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp67
-rw-r--r--src/corelib/global/qnamespace.qdoc73
-rw-r--r--src/corelib/io/qfileinfo.cpp7
-rw-r--r--src/corelib/kernel/qcore_unix.cpp2
-rw-r--r--src/corelib/kernel/qmath.cpp512
-rw-r--r--src/corelib/kernel/qobject.cpp2
-rw-r--r--src/corelib/thread/qreadwritelock.cpp6
-rw-r--r--src/dbus/qdbusintegrator.cpp2
-rw-r--r--src/gui/dialogs/qfiledialog.cpp8
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp11
-rw-r--r--src/gui/itemviews/qtreeview.cpp18
-rw-r--r--src/gui/kernel/qwidget_qws.cpp2
-rw-r--r--src/gui/kernel/qwidget_s60.cpp2
-rw-r--r--src/gui/painting/qoutlinemapper.cpp9
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp4
-rw-r--r--src/gui/painting/qpaintengineex.cpp8
-rw-r--r--src/gui/painting/qpainterpath_p.h16
-rw-r--r--src/gui/styles/qcleanlooksstyle.cpp2
-rw-r--r--src/gui/styles/qmacstyle_mac.mm2
-rw-r--r--src/gui/styles/qs60style.cpp11
-rw-r--r--src/gui/styles/qs60style_p.h5
-rw-r--r--src/gui/styles/qs60style_s60.cpp5
-rw-r--r--src/gui/styles/qs60style_simulated.cpp7
-rw-r--r--src/gui/text/qfont.cpp3
-rw-r--r--src/gui/text/qfontengine_s60.cpp36
-rw-r--r--src/gui/text/qfontengine_s60_p.h3
-rw-r--r--src/gui/widgets/qspinbox.cpp16
-rw-r--r--src/multimedia/audio/qaudioinput.cpp2
-rw-r--r--src/multimedia/audio/qaudiooutput.cpp2
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp32
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h3
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp99
-rw-r--r--src/network/access/qhttpnetworkreply.cpp12
-rw-r--r--src/network/access/qhttpnetworkreply_p.h2
-rw-r--r--src/network/access/qnetworkaccessbackend.cpp6
-rw-r--r--src/network/access/qnetworkaccessbackend_p.h1
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp10
-rw-r--r--src/network/access/qnetworkaccesshttpbackend_p.h2
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp3
-rw-r--r--src/network/ssl/qsslsocket_p.h3
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp48
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h20
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp45
-rw-r--r--src/opengl/qgl.cpp2
-rw-r--r--src/opengl/qpaintengine_opengl.cpp3
-rw-r--r--src/plugins/phonon/mmf/mmf.pro9
-rw-r--r--src/s60installs/s60installs.pro2
-rw-r--r--src/script/api/qscriptvalue.cpp12
-rw-r--r--src/script/bridge/qscriptdeclarativeclass.cpp5
-rw-r--r--src/script/bridge/qscriptdeclarativeclass_p.h1
-rw-r--r--src/sql/drivers/sqlite2/qsql_sqlite2.cpp16
83 files changed, 2098 insertions, 690 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp
index e7ef9b2..132eb79 100644
--- a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp
+++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp
@@ -37,18 +37,24 @@ using namespace Phonon::MMF;
AbstractAudioEffect::AbstractAudioEffect(QObject *parent,
const QList<EffectParameter> &params)
- : MediaNode::MediaNode(parent)
- , m_player(0)
+ : MediaNode(parent)
, m_params(params)
+ , m_player(0)
{
+
}
-QList<EffectParameter> AbstractAudioEffect::parameters() const
+QList<Phonon::EffectParameter> AbstractAudioEffect::parameters() const
{
- return m_params;
+ // Convert from QList<MMF::EffectParameter> to QList<Phonon::EffectParameter>
+ QList<Phonon::EffectParameter> result;
+ EffectParameter param;
+ foreach (param, m_params)
+ result += param;
+ return result;
}
-QVariant AbstractAudioEffect::parameterValue(const EffectParameter &queriedParam) const
+QVariant AbstractAudioEffect::parameterValue(const Phonon::EffectParameter &queriedParam) const
{
const QVariant &val = m_values.value(queriedParam.id());
@@ -58,13 +64,31 @@ QVariant AbstractAudioEffect::parameterValue(const EffectParameter &queriedParam
return val;
}
-void AbstractAudioEffect::setParameterValue(const EffectParameter &param,
+void AbstractAudioEffect::setParameterValue(const Phonon::EffectParameter &param,
const QVariant &newValue)
{
m_values.insert(param.id(), newValue);
- parameterChanged(param.id(), newValue);
- // TODO: handle audio effect errors
- TRAP_IGNORE(m_effect->ApplyL());
+
+ if (m_effect.data()) {
+ const EffectParameter& internalParam = internalParameter(param.id());
+ int err = parameterChanged(internalParam, newValue);
+ // TODO: handle audio effect errors
+ Q_UNUSED(err);
+ }
+}
+
+void AbstractAudioEffect::abstractPlayerChanged(AbstractPlayer *player)
+{
+ m_player = qobject_cast<AbstractMediaPlayer *>(player);
+ m_effect.reset();
+}
+
+void AbstractAudioEffect::stateChanged(Phonon::State newState,
+ Phonon::State oldState)
+{
+ if (Phonon::LoadingState == oldState
+ && Phonon::LoadingState != newState)
+ createEffect();
}
void AbstractAudioEffect::connectMediaObject(MediaObject *mediaObject)
@@ -72,26 +96,99 @@ void AbstractAudioEffect::connectMediaObject(MediaObject *mediaObject)
Q_ASSERT_X(!m_player, Q_FUNC_INFO, "Player already connected");
Q_ASSERT_X(!m_effect.data(), Q_FUNC_INFO, "Effect already created");
- AbstractMediaPlayer *const player =
- qobject_cast<AbstractMediaPlayer *>(mediaObject->abstractPlayer());
+ abstractPlayerChanged(mediaObject->abstractPlayer());
+
+ connect(mediaObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)),
+ SLOT(stateChanged(Phonon::State, Phonon::State)));
+
+ connect(mediaObject, SIGNAL(abstractPlayerChanged(AbstractPlayer *)),
+ SLOT(abstractPlayerChanged(AbstractPlayer *)));
+
+ if (mediaObject->state() != Phonon::LoadingState)
+ createEffect();
+}
+
+void AbstractAudioEffect::disconnectMediaObject(MediaObject *mediaObject)
+{
+ mediaObject->disconnect(this);
+ abstractPlayerChanged(0);
+}
- if (player) {
- m_player = player;
+void AbstractAudioEffect::setEnabled(bool enabled)
+{
+ TInt err = KErrNone;
- if (AudioPlayer *audioPlayer = qobject_cast<AudioPlayer *>(player)) {
- connectAudioPlayer(audioPlayer->nativePlayer());
- applyParameters();
- // TODO: handle audio effect errors
- TRAP_IGNORE(m_effect->EnableL());
+ if (enabled)
+ // TODO: handle audio effect errors
+ TRAP(err, m_effect->EnableL())
+ else
+ // TODO: handle audio effect errors
+ TRAP(err, m_effect->DisableL())
+
+ Q_UNUSED(err);
+}
+
+void AbstractAudioEffect::createEffect()
+{
+ Q_ASSERT_X(m_player, Q_FUNC_INFO, "Invalid media player pointer");
+
+ if (AudioPlayer *audioPlayer = qobject_cast<AudioPlayer *>(m_player)) {
+ createEffect(audioPlayer->nativePlayer());
+ }
+
+ if (m_effect.data()) {
+ EffectParameter param;
+ int err = 0;
+ foreach (param, m_params) {
+ const QVariant value = parameterValue(param);
+ err = parameterChanged(param, value);
}
+ Q_UNUSED(err)
}
}
-void AbstractAudioEffect::disconnectMediaObject(MediaObject * /*mediaObject*/)
+const MMF::EffectParameter& AbstractAudioEffect::internalParameter(int id) const
{
- m_player = 0;
- m_effect.reset();
+ const EffectParameter *result = 0;
+ for (int i=0; i<m_params.count() && !result; ++i) {
+ if (m_params[i].id() == id)
+ result = &m_params[i];
+ }
+ Q_ASSERT_X(result, Q_FUNC_INFO, "Parameter not found");
+ return *result;
+}
+
+int AbstractAudioEffect::parameterChanged(const EffectParameter &param,
+ const QVariant &value)
+{
+ int err = 0;
+
+ switch (param.id()) {
+ case ParameterEnable:
+ setEnabled(value.toBool());
+ break;
+ default:
+ {
+ const EffectParameter& internalParam = internalParameter(param.id());
+ err = effectParameterChanged(internalParam, value);
+ }
+ break;
+ }
+
+ if (!err)
+ TRAP(err, m_effect->ApplyL());
+
+ return err;
}
+int AbstractAudioEffect::effectParameterChanged(
+ const EffectParameter &param, const QVariant &value)
+{
+ // Default implementation
+ Q_ASSERT_X(false, Q_FUNC_INFO, "Effect has no parameters");
+ return 0;
+}
+
+
QT_END_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.h b/src/3rdparty/phonon/mmf/abstractaudioeffect.h
index 6f74a73..9878472 100644
--- a/src/3rdparty/phonon/mmf/abstractaudioeffect.h
+++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.h
@@ -24,18 +24,21 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include <AudioEffectBase.h>
#include <Phonon/EffectInterface>
-#include <Phonon/EffectParameter>
#include "audioplayer.h"
+#include "effectparameter.h"
#include "mmf_medianode.h"
#include "mmf_videoplayer.h"
+class CMdaAudioOutputStream;
+
QT_BEGIN_NAMESPACE
namespace Phonon
{
namespace MMF
{
+class AbstractPlayer;
class AbstractMediaPlayer;
/**
@@ -63,46 +66,73 @@ public:
AbstractAudioEffect(QObject *parent,
const QList<EffectParameter> &params);
- virtual QList<EffectParameter> parameters() const;
- virtual QVariant parameterValue(const EffectParameter &param) const;
- virtual void setParameterValue(const EffectParameter &,
+ // Phonon::EffectInterface
+ virtual QList<Phonon::EffectParameter> parameters() const;
+ virtual QVariant parameterValue(const Phonon::EffectParameter &param) const;
+ virtual void setParameterValue(const Phonon::EffectParameter &,
const QVariant &newValue);
- enum Type
+ // Parameters which are shared by all effects
+ enum CommonParameters
{
- EffectAudioEqualizer = 1,
- EffectBassBoost,
- EffectDistanceAttenuation,
- EffectEnvironmentalReverb,
- EffectListenerOrientation,
- EffectLoudness,
- EffectSourceOrientation,
- EffectStereoWidening
+ ParameterEnable = 0,
+ ParameterBase // must be last entry in enum
};
+public Q_SLOTS:
+ void abstractPlayerChanged(AbstractPlayer *player);
+ void stateChanged(Phonon::State newState,
+ Phonon::State oldState);
+
protected:
// MediaNode
void connectMediaObject(MediaObject *mediaObject);
void disconnectMediaObject(MediaObject *mediaObject);
- virtual void connectAudioPlayer(AudioPlayer::NativePlayer *player) = 0;
- virtual void applyParameters() = 0;
+ virtual void createEffect(AudioPlayer::NativePlayer *player) = 0;
- virtual void parameterChanged(const int id,
- const QVariant &value) = 0;
+ // Effect-specific parameter changed
+ virtual int effectParameterChanged(const EffectParameter &param,
+ const QVariant &value);
+
+private:
+ void createEffect();
+ void setEnabled(bool enabled);
+ const EffectParameter& internalParameter(int id) const;
+ int parameterChanged(const EffectParameter &param,
+ const QVariant &value);
protected:
QScopedPointer<CAudioEffect> m_effect;
private:
- AbstractMediaPlayer * m_player;
const QList<EffectParameter> m_params;
+ AbstractMediaPlayer * m_player;
QHash<int, QVariant> m_values;
};
}
}
+
+// Macro for defining functions which depend on the native class name
+// for each of the effects. Using this reduces repetition of boilerplate
+// in the implementations of the backend effect nodes.
+
+#define PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(Effect) \
+ \
+void Effect##::createEffect(AudioPlayer::NativePlayer *player) \
+{ \
+ C##Effect *ptr = 0; \
+ QT_TRAP_THROWING(ptr = C##Effect::NewL(*player)); \
+ m_effect.reset(ptr); \
+} \
+ \
+C##Effect* Effect::concreteEffect() \
+{ \
+ return static_cast<C##Effect *>(m_effect.data()); \
+}
+
QT_END_NAMESPACE
#endif
diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h
index 40ad7f8..dbcbe63 100644
--- a/src/3rdparty/phonon/mmf/abstractplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractplayer.h
@@ -106,8 +106,8 @@ Q_SIGNALS:
void finished();
void tick(qint64 time);
void bufferStatus(int percentFilled);
- void stateChanged(Phonon::State oldState,
- Phonon::State newState);
+ void stateChanged(Phonon::State newState,
+ Phonon::State oldState);
void metaDataChanged(const QMultiMap<QString, QString>& metaData);
void aboutToFinish();
void prefinishMarkReached(qint32 remaining);
diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp
index c2936c5..1d2bbd4 100644
--- a/src/3rdparty/phonon/mmf/audioequalizer.cpp
+++ b/src/3rdparty/phonon/mmf/audioequalizer.cpp
@@ -28,80 +28,79 @@ using namespace Phonon::MMF;
\internal
*/
-AudioEqualizer::AudioEqualizer(QObject *parent) : AbstractAudioEffect::AbstractAudioEffect(parent, createParams())
+// Define functions which depend on concrete native effect class name
+PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(AudioEqualizer)
+
+AudioEqualizer::AudioEqualizer(QObject *parent, const QList<EffectParameter>& parameters)
+ : AbstractAudioEffect::AbstractAudioEffect(parent, parameters)
{
+
}
-void AudioEqualizer::parameterChanged(const int pid,
+int AudioEqualizer::effectParameterChanged(const EffectParameter &param,
const QVariant &value)
{
- if (m_effect.data()) {
- const int band = pid;
- const int level = value.toInt();
- setBandLevel(band, level);
- }
-}
+ const int band = param.id() - ParameterBase + 1;
-void AudioEqualizer::connectAudioPlayer(AudioPlayer::NativePlayer *player)
-{
- CAudioEqualizer *ptr = 0;
- QT_TRAP_THROWING(ptr = CAudioEqualizer::NewL(*player));
- m_effect.reset(ptr);
-}
+ const qreal externalLevel = value.toReal();
+ const int internalLevel = param.toInternalValue(externalLevel);
-void AudioEqualizer::applyParameters()
-{
- if (m_effect.data()) {
- EffectParameter param;
- foreach (param, parameters()) {
- const int band = param.id();
- const int level = parameterValue(param).toInt();
- setBandLevel(band, level);
- }
- }
+ TRAPD(err, concreteEffect()->SetBandLevelL(band, internalLevel));
+ return err;
}
-void AudioEqualizer::setBandLevel(int band, int level)
+
+//-----------------------------------------------------------------------------
+// Static functions
+//-----------------------------------------------------------------------------
+
+const char* AudioEqualizer::description()
{
- CAudioEqualizer *const effect = static_cast<CAudioEqualizer *>(m_effect.data());
- // TODO: handle audio effect errors
- TRAP_IGNORE(effect->SetBandLevelL(band, level));
+ return "Audio equalizer";
}
-QList<EffectParameter> AudioEqualizer::createParams()
+bool AudioEqualizer::getParameters(CMdaAudioOutputStream *stream,
+ QList<EffectParameter>& parameters)
{
- QList<EffectParameter> retval;
+ bool supported = false;
+
+ QScopedPointer<CAudioEqualizer> effect;
+ TRAPD(err, effect.reset(CAudioEqualizer::NewL(*stream)));
- // We temporarily create an AudioPlayer, and run the effect on it, so
- // we can extract the readonly data we need.
- AudioPlayer dummyPlayer;
+ if (KErrNone == err) {
+ supported = true;
- CAudioEqualizer *eqPtr = 0;
- QT_TRAP_THROWING(eqPtr = CAudioEqualizer::NewL(*dummyPlayer.nativePlayer()));
- QScopedPointer<CAudioEqualizer> e(eqPtr);
+ TInt32 dbMin;
+ TInt32 dbMax;
+ effect->DbLevelLimits(dbMin, dbMax);
- TInt32 dbMin;
- TInt32 dbMax;
- e->DbLevelLimits(dbMin, dbMax);
+ const int bandCount = effect->NumberOfBands();
- const int bandCount = e->NumberOfBands();
+ for (int i = 0; i < bandCount; ++i) {
+ // For some reason, band IDs are 1-based, as opposed to the
+ // 0-based indices used in just about other Symbian API...!
+ const int band = i + 1;
- for (int i = 0; i < bandCount; ++i) {
- const qint32 hz = e->CenterFrequency(i);
+ const qint32 hz = effect->CenterFrequency(band);
- const qint32 defVol = e->BandLevel(i);
+ // We pass a floating-point parameter range of -1.0 to +1.0 for
+ // each band in order to work around a limitation in
+ // Phonon::EffectWidget. See documentation of EffectParameter
+ // for more details.
+ EffectParameter param(
+ /* parameterId */ ParameterBase + i,
+ /* name */ tr("%1 Hz").arg(hz),
+ /* hints */ EffectParameter::LogarithmicHint,
+ /* defaultValue */ QVariant(qreal(0.0)),
+ /* minimumValue */ QVariant(qreal(-1.0)),
+ /* maximumValue */ QVariant(qreal(+1.0)));
- retval.append(EffectParameter(i,
- tr("Frequency band, %1 Hz").arg(hz),
- EffectParameter::LogarithmicHint,
- QVariant(qint32(defVol)),
- QVariant(qint32(dbMin)),
- QVariant(qint32(dbMax)),
- QVariantList(),
- QString()));
+ param.setInternalRange(dbMin, dbMax);
+ parameters.append(param);
+ }
}
- return retval;
+ return supported;
}
QT_END_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/audioequalizer.h b/src/3rdparty/phonon/mmf/audioequalizer.h
index 10fe9ad..9c3770a 100644
--- a/src/3rdparty/phonon/mmf/audioequalizer.h
+++ b/src/3rdparty/phonon/mmf/audioequalizer.h
@@ -21,6 +21,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "abstractaudioeffect.h"
+class CAudioEqualizer;
+
QT_BEGIN_NAMESPACE
namespace Phonon
@@ -39,19 +41,21 @@ class AudioEqualizer : public AbstractAudioEffect
{
Q_OBJECT
public:
- AudioEqualizer(QObject *parent);
+ AudioEqualizer(QObject *parent, const QList<EffectParameter> &parameters);
+
+ // Static interface required by EffectFactory
+ static const char* description();
+ static bool getParameters(CMdaAudioOutputStream *stream,
+ QList<EffectParameter>& parameters);
protected:
// AbstractAudioEffect
- virtual void connectAudioPlayer(AudioPlayer::NativePlayer *player);
- virtual void applyParameters();
- virtual void parameterChanged(const int id, const QVariant &value);
-
-private:
- void setBandLevel(int band, int level);
+ virtual void createEffect(AudioPlayer::NativePlayer *player);
+ virtual int effectParameterChanged(const EffectParameter &param,
+ const QVariant &value);
private:
- static QList<EffectParameter> createParams();
+ CAudioEqualizer *concreteEffect();
};
}
diff --git a/src/3rdparty/phonon/mmf/backend.cpp b/src/3rdparty/phonon/mmf/backend.cpp
index 0c07f66..3568a49 100644
--- a/src/3rdparty/phonon/mmf/backend.cpp
+++ b/src/3rdparty/phonon/mmf/backend.cpp
@@ -45,6 +45,7 @@ using namespace Phonon::MMF;
Backend::Backend(QObject *parent)
: QObject(parent)
, m_ancestorMoveMonitor(new AncestorMoveMonitor(this))
+ , m_effectFactory(new EffectFactory(this))
{
TRACE_CONTEXT(Backend::Backend, EBackend);
TRACE_ENTRY_0();
@@ -81,9 +82,9 @@ QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const
{
Q_ASSERT(args.count() == 1);
Q_ASSERT(args.first().type() == QVariant::Int);
- const AbstractAudioEffect::Type effect = AbstractAudioEffect::Type(args.first().toInt());
-
- return EffectFactory::createAudioEffect(effect, parent);
+ const EffectFactory::Type type =
+ static_cast<EffectFactory::Type>(args.first().toInt());
+ return m_effectFactory->createAudioEffect(type, parent);
}
case VideoWidgetClass:
result = new VideoWidget(m_ancestorMoveMonitor.data(), qobject_cast<QWidget *>(parent));
@@ -105,7 +106,7 @@ QList<int> Backend::objectDescriptionIndexes(ObjectDescriptionType type) const
switch(type)
{
case EffectType:
- retval.append(EffectFactory::effectIndexes());
+ retval.append(m_effectFactory->effectIndexes());
break;
case AudioOutputDeviceType:
// We only have one possible output device, but we need at least
@@ -126,7 +127,7 @@ QHash<QByteArray, QVariant> Backend::objectDescriptionProperties(ObjectDescripti
switch (type) {
case EffectType:
- return EffectFactory::audioEffectDescriptions(AbstractAudioEffect::Type(index));
+ return m_effectFactory->audioEffectDescriptions(EffectFactory::Type(index));
case AudioOutputDeviceType:
return AudioOutput::audioOutputDescription(index);
default:
diff --git a/src/3rdparty/phonon/mmf/backend.h b/src/3rdparty/phonon/mmf/backend.h
index 9e3d3b3..6b85625 100644
--- a/src/3rdparty/phonon/mmf/backend.h
+++ b/src/3rdparty/phonon/mmf/backend.h
@@ -20,6 +20,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#define PHONON_MMF_BACKEND_H
#include "ancestormovemonitor.h"
+#include "effectfactory.h"
#include <Phonon/MediaSource>
#include <Phonon/BackendInterface>
@@ -53,6 +54,7 @@ Q_SIGNALS:
private:
QScopedPointer<AncestorMoveMonitor> m_ancestorMoveMonitor;
+ QScopedPointer<EffectFactory> m_effectFactory;
};
}
diff --git a/src/3rdparty/phonon/mmf/bassboost.cpp b/src/3rdparty/phonon/mmf/bassboost.cpp
index ae96b45..c7af939 100644
--- a/src/3rdparty/phonon/mmf/bassboost.cpp
+++ b/src/3rdparty/phonon/mmf/bassboost.cpp
@@ -24,31 +24,34 @@ QT_BEGIN_NAMESPACE
using namespace Phonon;
using namespace Phonon::MMF;
+// Define functions which depend on concrete native effect class name
+PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(BassBoost)
+
/*! \class MMF::BassBoost
\internal
*/
-BassBoost::BassBoost(QObject *parent) : AbstractAudioEffect::AbstractAudioEffect(parent,
- QList<EffectParameter>())
+BassBoost::BassBoost(QObject *parent, const QList<EffectParameter> &parameters)
+ : AbstractAudioEffect::AbstractAudioEffect(parent, parameters)
{
-}
-void BassBoost::parameterChanged(const int,
- const QVariant &)
-{
- Q_ASSERT_X(false, Q_FUNC_INFO, "BassBoost has not parameters");
}
-void BassBoost::connectAudioPlayer(AudioPlayer::NativePlayer *player)
+//-----------------------------------------------------------------------------
+// Static functions
+//-----------------------------------------------------------------------------
+
+const char* BassBoost::description()
{
- CBassBoost *ptr = 0;
- QT_TRAP_THROWING(ptr = CBassBoost::NewL(*player));
- m_effect.reset(ptr);
+ return "Bass boost";
}
-void BassBoost::applyParameters()
+bool BassBoost::getParameters(CMdaAudioOutputStream *stream,
+ QList<EffectParameter> &parameters)
{
- // No parameters to apply
+ QScopedPointer<CBassBoost> effect;
+ TRAPD(err, effect.reset(CBassBoost::NewL(*stream)));
+ return (KErrNone == err);
}
QT_END_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/bassboost.h b/src/3rdparty/phonon/mmf/bassboost.h
index 4ad0a6c..fc40e21 100644
--- a/src/3rdparty/phonon/mmf/bassboost.h
+++ b/src/3rdparty/phonon/mmf/bassboost.h
@@ -21,6 +21,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "abstractaudioeffect.h"
+class CBassBoost;
+
QT_BEGIN_NAMESPACE
namespace Phonon
@@ -28,22 +30,25 @@ namespace Phonon
namespace MMF
{
/**
- * @short An "bass boost" effect.
- *
- * The documentation does not say what "bass boost" is, neither has it anykind
- * of setting. It's an on or off thing.
+ * @short A "bass boost" effect.
*/
class BassBoost : public AbstractAudioEffect
{
Q_OBJECT
public:
- BassBoost(QObject *parent);
+ BassBoost(QObject *parent, const QList<EffectParameter> &parameters);
+
+ // Static interface required by EffectFactory
+ static const char* description();
+ static bool getParameters(CMdaAudioOutputStream *stream,
+ QList<EffectParameter>& parameters);
protected:
// AbstractAudioEffect
- virtual void connectAudioPlayer(AudioPlayer::NativePlayer *player);
- virtual void applyParameters();
- virtual void parameterChanged(const int id, const QVariant &value);
+ virtual void createEffect(AudioPlayer::NativePlayer *player);
+
+private:
+ CBassBoost *concreteEffect();
};
}
diff --git a/src/3rdparty/phonon/mmf/effectfactory.cpp b/src/3rdparty/phonon/mmf/effectfactory.cpp
index cc94367..c5e33d5 100644
--- a/src/3rdparty/phonon/mmf/effectfactory.cpp
+++ b/src/3rdparty/phonon/mmf/effectfactory.cpp
@@ -19,19 +19,13 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include <QObject>
#include <QCoreApplication>
-#include <AudioEqualizerBase.h>
-#include <BassBoostBase.h>
-#include <DistanceAttenuationBase.h>
-#include <DopplerBase.h>
-#include <EnvironmentalReverbBase.h>
-#include <ListenerOrientationBase.h>
-#include <LocationBase.h>
-#include <LoudnessBase.h>
-#include <SourceOrientationBase.h>
-#include <StereoWideningBase.h>
+#include <mdaaudiooutputstream.h>
#include "audioequalizer.h"
#include "bassboost.h"
+#include "environmentalreverb.h"
+#include "loudness.h"
+#include "stereowidening.h"
#include "effectfactory.h"
@@ -44,111 +38,176 @@ using namespace Phonon::MMF;
\internal
*/
-QHash<QByteArray, QVariant> EffectFactory::constructEffectDescription(const QString &name,
- const QString &description)
+EffectFactory::EffectFactory(QObject *parent)
+ : QObject(parent)
+ , m_initialized(false)
{
- QHash<QByteArray, QVariant> retval;
- retval.insert("name", name);
- retval.insert("description", description);
- retval.insert("available", true);
-
- return retval;
}
-
-QHash<QByteArray, QVariant> EffectFactory::audioEffectDescriptions(AbstractAudioEffect::Type type)
+EffectFactory::~EffectFactory()
{
- switch (type)
- {
- case AbstractAudioEffect::EffectAudioEqualizer:
- return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Audio Equalizer"), "Audio equalizer.");
- case AbstractAudioEffect::EffectBassBoost:
- return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Bass Boost"), "Bass boost.");
- case AbstractAudioEffect::EffectDistanceAttenuation:
- return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Distance Attenuation"), "Distance Attenuation.");
- case AbstractAudioEffect::EffectEnvironmentalReverb:
- return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Environmental Reverb"), "Environmental Reverb.");
- case AbstractAudioEffect::EffectListenerOrientation:
- return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Environmental Reverb"), "Environmental Reverb.");
- case AbstractAudioEffect::EffectLoudness:
- return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Loudness"), "Loudness.");
- case AbstractAudioEffect::EffectSourceOrientation:
- return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Source Orientation"), "Source Orientation.");
- case AbstractAudioEffect::EffectStereoWidening:
- return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Stereo Widening"), "Stereo Widening.");
- }
- Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown effect type.");
- return QHash<QByteArray, QVariant>();
}
-AbstractAudioEffect *EffectFactory::createAudioEffect(AbstractAudioEffect::Type type,
+//-----------------------------------------------------------------------------
+// Public functions
+//-----------------------------------------------------------------------------
+
+AbstractAudioEffect *EffectFactory::createAudioEffect(Type type,
QObject *parent)
{
+ // Lazily initialize
+ if (!m_initialized)
+ initialize();
+
Q_ASSERT(parent);
+ const QList<EffectParameter>& parameters = data(type).m_parameters;
+
+ AbstractAudioEffect *effect = 0;
+
switch (type)
{
- case AbstractAudioEffect::EffectBassBoost:
- return new BassBoost(parent);
- case AbstractAudioEffect::EffectAudioEqualizer:
- return new AudioEqualizer(parent);
- case AbstractAudioEffect::EffectDistanceAttenuation:
- case AbstractAudioEffect::EffectEnvironmentalReverb:
- case AbstractAudioEffect::EffectListenerOrientation:
- case AbstractAudioEffect::EffectLoudness:
- case AbstractAudioEffect::EffectSourceOrientation:
- case AbstractAudioEffect::EffectStereoWidening:
- ;
+ case TypeBassBoost:
+ effect = new BassBoost(parent, parameters);
+ break;
+ case TypeAudioEqualizer:
+ effect = new AudioEqualizer(parent, parameters);
+ break;
+ case TypeEnvironmentalReverb:
+ effect = new EnvironmentalReverb(parent, parameters);
+ break;
+ case TypeLoudness:
+ effect = new Loudness(parent, parameters);
+ break;
+ case TypeStereoWidening:
+ effect = new StereoWidening(parent, parameters);
+ break;
+
+ // Not implemented
+ case TypeDistanceAttenuation:
+ case TypeListenerOrientation:
+ case TypeSourceOrientation:
+ // Fall through
+ default:
+ Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown effect");
}
- Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown effect.");
- return 0;
+ return effect;
}
-template<typename TEffect>
-bool isEffectSupported()
+QHash<QByteArray, QVariant> EffectFactory::audioEffectDescriptions(Type type)
{
- AudioPlayer audioPlayer;
-
- QScopedPointer<TEffect> eff;
- TRAPD(errorCode, eff.reset(TEffect::NewL(*audioPlayer.nativePlayer())));
+ // Lazily initialize
+ if (!m_initialized)
+ initialize();
- return errorCode != KErrNone;
+ return data(type).m_descriptions;
}
QList<int> EffectFactory::effectIndexes()
{
- QList<int> retval;
+ // Lazily initialize
+ if (!m_initialized)
+ initialize();
- if (isEffectSupported<CAudioEqualizer>())
- retval.append(AbstractAudioEffect::EffectAudioEqualizer);
+ QList<int> result;
- if (isEffectSupported<CBassBoost>())
- retval.append(AbstractAudioEffect::EffectBassBoost);
+ QHash<Type, EffectData>::const_iterator i = m_effectData.begin();
+ for ( ; i != m_effectData.end(); ++i)
+ if (i.value().m_supported)
+ result.append(i.key());
- /* We haven't implemented these yet.
- if (isEffectSupported<CDistanceAttenuation>())
- retval.append(AbstractAudioEffect::EffectDistanceAttenuation);
+ return result;
+}
- if (isEffectSupported<CEnvironmentalReverb>())
- retval.append(AbstractAudioEffect::EffectEnvironmentalReverb);
+//-----------------------------------------------------------------------------
+// Private functions
+//-----------------------------------------------------------------------------
- if (isEffectSupported<CLoudness>())
- retval.append(AbstractAudioEffect::EffectLoudness);
+#define INITIALIZE_EFFECT(Effect) \
+ { \
+ EffectData data = getData<Effect>(); \
+ m_effectData.insert(Type##Effect, data); \
+ }
- if (isEffectSupported<CListenerOrientation>())
- retval.append(AbstractAudioEffect::EffectListenerOrientation);
+void EffectFactory::initialize()
+{
+ Q_ASSERT_X(!m_initialized, Q_FUNC_INFO, "Already initialized");
- if (isEffectSupported<CSourceOrientation>())
- retval.append(AbstractAudioEffect::EffectSourceOrientation);
+ INITIALIZE_EFFECT(AudioEqualizer)
+ INITIALIZE_EFFECT(BassBoost)
+ INITIALIZE_EFFECT(EnvironmentalReverb)
+ INITIALIZE_EFFECT(Loudness)
+ INITIALIZE_EFFECT(StereoWidening)
- if (isEffectSupported<CStereoWidening>())
- retval.append(AbstractAudioEffect::EffectStereoWidening);
- */
+ m_initialized = true;
+}
+
+// This class is just a wrapper which allows us to instantiate a
+// CMdaAudioOutputStream object. This is done in order to allow the
+// effects API to query the DevSound implementation, to discover
+// which effects are supported and what parameters they take.
+// Ideally, we would use CMMFDevSound directly, but this class is not
+// available in the public S60 SDK.
+class OutputStreamFactory : public MMdaAudioOutputStreamCallback
+{
+public:
+ CMdaAudioOutputStream* create()
+ {
+ CMdaAudioOutputStream* stream = 0;
+ QT_TRAP_THROWING(stream = CMdaAudioOutputStream::NewL(*this));
+ return stream;
+ }
+private:
+ void MaoscOpenComplete(TInt /*aError*/) { }
+ void MaoscBufferCopied(TInt /*aError*/, const TDesC8& /*aBuffer*/) { }
+ void MaoscPlayComplete(TInt /*aError*/) { }
+};
+
+template<typename BackendNode>
+EffectFactory::EffectData EffectFactory::getData()
+{
+ EffectData data;
+
+ // Create a temporary CMdaAudioOutputStream object, so that the effects
+ // API can query DevSound to discover which effects are supported.
+ OutputStreamFactory streamFactory;
+ QScopedPointer<CMdaAudioOutputStream> stream(streamFactory.create());
+
+ EffectParameter param(
+ /* parameterId */ AbstractAudioEffect::ParameterEnable,
+ /* name */ tr("Enabled"),
+ /* hints */ EffectParameter::ToggledHint,
+ /* defaultValue */ QVariant(bool(true)));
+ data.m_parameters.append(param);
+
+ if (data.m_supported = BackendNode::getParameters
+ (stream.data(), data.m_parameters)) {
+ const QString description = QCoreApplication::translate
+ ("Phonon::MMF::EffectFactory", BackendNode::description());
+ data.m_descriptions.insert("name", description);
+ data.m_descriptions.insert("description", description);
+ data.m_descriptions.insert("available", true);
+ }
+
+ // Sanity check to ensure that all parameter IDs are unique
+ QSet<int> ids;
+ foreach (param, data.m_parameters) {
+ Q_ASSERT_X(ids.find(param.id()) == ids.end(), Q_FUNC_INFO,
+ "Parameter list contains duplicates");
+ ids.insert(param.id());
+ }
- return retval;
+ return data;
+}
+
+const EffectFactory::EffectData& EffectFactory::data(Type type) const
+{
+ QHash<Type, EffectData>::const_iterator i = m_effectData.find(type);
+ Q_ASSERT_X(i != m_effectData.end(), Q_FUNC_INFO, "Effect data not found");
+ return i.value();
}
QT_END_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/effectfactory.h b/src/3rdparty/phonon/mmf/effectfactory.h
index e83ad15..dd4b58d 100644
--- a/src/3rdparty/phonon/mmf/effectfactory.h
+++ b/src/3rdparty/phonon/mmf/effectfactory.h
@@ -20,6 +20,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#define PHONON_MMF_EFFECTFACTORY_H
#include "abstractaudioeffect.h"
+#include "effectparameter.h"
QT_BEGIN_NAMESPACE
@@ -31,14 +32,30 @@ namespace MMF
/**
* @short Contains utility functions related to effects.
*/
-class EffectFactory
+class EffectFactory : public QObject
{
+ Q_OBJECT
+
public:
+ EffectFactory(QObject *parent);
+ ~EffectFactory();
+
+ enum Type
+ {
+ TypeAudioEqualizer = 0
+ , TypeBassBoost
+ , TypeDistanceAttenuation
+ , TypeEnvironmentalReverb
+ , TypeListenerOrientation
+ , TypeLoudness
+ , TypeSourceOrientation
+ , TypeStereoWidening
+ };
+
/**
* @short Creates an audio effect of type @p type.
*/
- static AbstractAudioEffect *createAudioEffect(AbstractAudioEffect::Type type,
- QObject *parent);
+ AbstractAudioEffect *createAudioEffect(Type type, QObject *parent);
/**
* @short Return the properties for effect @p type.
@@ -46,7 +63,7 @@ public:
* This handles the effects for
* BackendInterface::objectDescriptionProperties().
*/
- static QHash<QByteArray, QVariant> audioEffectDescriptions(AbstractAudioEffect::Type type);
+ QHash<QByteArray, QVariant> audioEffectDescriptions(Type type);
/**
* @short Returns the indexes for the supported effects.
@@ -54,19 +71,27 @@ public:
* This handles the effects for
* BackendInterface::objectDescriptionIndexes().
*/
- static QList<int> effectIndexes();
+ QList<int> effectIndexes();
private:
- static inline QHash<QByteArray, QVariant> constructEffectDescription(const QString &name,
- const QString &description);
+ void initialize();
+
+ struct EffectData
+ {
+ bool m_supported;
+ QHash<QByteArray, QVariant> m_descriptions;
+ QList<EffectParameter> m_parameters;
+ };
+
+ template<typename BackendNode> EffectData getData();
+ const EffectData& data(Type type) const;
+
+private:
+ bool m_initialized;
+ QHash<Type, EffectData> m_effectData;
- /**
- * This class is not supposed to be instantiated, so disable
- * the default constructor.
- */
- inline EffectFactory();
- Q_DISABLE_COPY(EffectFactory)
};
+
}
}
diff --git a/src/3rdparty/phonon/mmf/effectparameter.cpp b/src/3rdparty/phonon/mmf/effectparameter.cpp
new file mode 100644
index 0000000..17c1315
--- /dev/null
+++ b/src/3rdparty/phonon/mmf/effectparameter.cpp
@@ -0,0 +1,71 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "effectparameter.h"
+
+QT_BEGIN_NAMESPACE
+
+using namespace Phonon;
+using namespace Phonon::MMF;
+
+/*! \class MMF::EffectParameter
+ \internal
+*/
+
+MMF::EffectParameter::EffectParameter()
+ : m_hasInternalRange(false)
+{
+
+}
+
+MMF::EffectParameter::EffectParameter(
+ int parameterId, const QString &name, Hints hints,
+ const QVariant &defaultValue, const QVariant &min,
+ const QVariant &max, const QVariantList &values,
+ const QString &description)
+ : Phonon::EffectParameter(parameterId, name, hints, defaultValue,
+ min, max, values, description)
+ , m_hasInternalRange(false)
+{
+
+}
+
+void MMF::EffectParameter::setInternalRange(qint32 min, qint32 max)
+{
+ Q_ASSERT_X(max >= min, Q_FUNC_INFO, "Invalid range");
+ m_internalRange = QPair<qint32, qint32>(min, max);
+ m_hasInternalRange = true;
+}
+
+qint32 MMF::EffectParameter::toInternalValue(qreal external) const
+{
+ Q_ASSERT_X(m_hasInternalRange, Q_FUNC_INFO, "Does not have internal range");
+ const qint32 range = m_internalRange.second - m_internalRange.first;
+ return m_internalRange.first + ((1.0 + external) / 2) * range;
+}
+
+qreal MMF::EffectParameter::toExternalValue
+ (qint32 value, qint32 min, qint32 max)
+{
+ Q_ASSERT_X(max >= min, Q_FUNC_INFO, "Invalid range");
+ const qint32 range = max - min;
+ return range == 0 ? 0.0 : ((2.0 * value - min) / range) - 1.0;
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/3rdparty/phonon/mmf/effectparameter.h b/src/3rdparty/phonon/mmf/effectparameter.h
new file mode 100644
index 0000000..27cc018
--- /dev/null
+++ b/src/3rdparty/phonon/mmf/effectparameter.h
@@ -0,0 +1,74 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef PHONON_MMF_EFFECTPARAMETER_H
+#define PHONON_MMF_EFFECTPARAMETER_H
+
+#include <Phonon/EffectParameter>
+
+QT_BEGIN_NAMESPACE
+
+namespace Phonon
+{
+namespace MMF
+{
+
+/**
+ * @short Parameter value for an audio effect
+ *
+ * The base class is extended in order to work around a shortcoming
+ * in Phonon::EffectWidget. This widget only displays sliders for
+ * parameters with numeric values if the variant type of the parameter
+ * is QReal and the range is exactly -1.0 to +1.0; otherwise, a
+ * spinbox is used to set numeric parameters. This is rather
+ * inconvenient for many effects, such as the audio equalizer, for
+ * which a slider is a much more natural UI control.
+ *
+ * For many such parameters, we therefore report the type to be QReal
+ * and the range to be -1.0 to +1.0. This class stores the actual
+ * integer range for the parameter, and provides the toInternalValue
+ * function for converting between the client-side floating point
+ * value and the internal integer value.
+ */
+class EffectParameter : public Phonon::EffectParameter
+{
+public:
+ EffectParameter();
+ EffectParameter(int parameterId, const QString &name, Hints hints,
+ const QVariant &defaultValue, const QVariant &min = QVariant(),
+ const QVariant &max = QVariant(), const QVariantList &values = QVariantList(),
+ const QString &description = QString());
+
+ void setInternalRange(qint32 min, qint32 max);
+ qint32 toInternalValue(qreal external) const;
+
+ static qreal toExternalValue(qint32 value, qint32 min, qint32 max);
+
+private:
+ bool m_hasInternalRange;
+ QPair<qint32, qint32> m_internalRange;
+
+};
+
+}
+}
+
+QT_END_NAMESPACE
+
+#endif
+
diff --git a/src/3rdparty/phonon/mmf/environmentalreverb.cpp b/src/3rdparty/phonon/mmf/environmentalreverb.cpp
new file mode 100644
index 0000000..89f8d60
--- /dev/null
+++ b/src/3rdparty/phonon/mmf/environmentalreverb.cpp
@@ -0,0 +1,201 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include <EnvironmentalReverbBase.h>
+#include "environmentalreverb.h"
+
+QT_BEGIN_NAMESPACE
+
+using namespace Phonon;
+using namespace Phonon::MMF;
+
+/*! \class MMF::EnvironmentalReverb
+ \internal
+*/
+
+// Define functions which depend on concrete native effect class name
+PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(EnvironmentalReverb)
+
+enum Parameters
+{
+ DecayHFRatio = AbstractAudioEffect::ParameterBase,
+ DecayTime,
+ Density,
+ Diffusion,
+ ReflectionsDelay,
+ ReflectionsLevel,
+ ReverbDelay,
+ ReverbLevel,
+ RoomHFLevel,
+ RoomLevel
+};
+
+EnvironmentalReverb::EnvironmentalReverb(QObject *parent, const QList<EffectParameter>& parameters)
+ : AbstractAudioEffect::AbstractAudioEffect(parent, parameters)
+{
+
+}
+
+int EnvironmentalReverb::effectParameterChanged(const EffectParameter &param,
+ const QVariant &value)
+{
+ const qreal externalLevel = value.toReal();
+ const int internalLevel = param.toInternalValue(externalLevel);
+
+ TInt err = 0;
+
+ switch(param.id()) {
+ case DecayHFRatio:
+ TRAP(err, concreteEffect()->SetDecayHFRatioL(internalLevel));
+ break;
+ case DecayTime:
+ TRAP(err, concreteEffect()->SetDecayTimeL(internalLevel));
+ break;
+ case Density:
+ TRAP(err, concreteEffect()->SetDensityL(internalLevel));
+ break;
+ case Diffusion:
+ TRAP(err, concreteEffect()->SetDiffusionL(internalLevel));
+ break;
+ case ReflectionsDelay:
+ TRAP(err, concreteEffect()->SetReflectionsDelayL(internalLevel));
+ break;
+ case ReflectionsLevel:
+ TRAP(err, concreteEffect()->SetReflectionsLevelL(internalLevel));
+ break;
+ case ReverbDelay:
+ TRAP(err, concreteEffect()->SetReverbDelayL(internalLevel));
+ break;
+ case ReverbLevel:
+ TRAP(err, concreteEffect()->SetReverbLevelL(internalLevel));
+ break;
+ case RoomHFLevel:
+ TRAP(err, concreteEffect()->SetRoomHFLevelL(internalLevel));
+ break;
+ case RoomLevel:
+ TRAP(err, concreteEffect()->SetRoomLevelL(internalLevel));
+ break;
+ default:
+ Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown parameter");
+ }
+
+ return err;
+}
+
+
+//-----------------------------------------------------------------------------
+// Static functions
+//-----------------------------------------------------------------------------
+
+const char* EnvironmentalReverb::description()
+{
+ return "Reverb";
+}
+
+// Internal helper function
+Phonon::MMF::EffectParameter createParameter(int id, const QString &name,
+ int defaultValue, int minValue, int maxValue,
+ Phonon::EffectParameter::Hint hint = Phonon::EffectParameter::IntegerHint)
+{
+ const qreal externalDefaultValue =
+ Phonon::MMF::EffectParameter::toExternalValue
+ (defaultValue, minValue, maxValue);
+
+ Phonon::MMF::EffectParameter param(id, name, hint,
+ /* defaultValue */ QVariant(externalDefaultValue),
+ /* minimumValue */ QVariant(qreal(-1.0)),
+ /* maximumValue */ QVariant(qreal(+1.0)));
+
+ param.setInternalRange(minValue, maxValue);
+ return param;
+}
+
+bool EnvironmentalReverb::getParameters(CMdaAudioOutputStream *stream,
+ QList<EffectParameter>& parameters)
+{
+ bool supported = false;
+
+ QScopedPointer<CEnvironmentalReverb> effect;
+ TRAPD(err, effect.reset(CEnvironmentalReverb::NewL(*stream)));
+
+ if (KErrNone == err) {
+ supported = true;
+
+ TInt32 min, max;
+ TUint32 umin, umax;
+
+ // DecayHFRatio
+ effect->DecayHFRatioRange(umin, umax);
+ parameters.append(createParameter(
+ DecayHFRatio, tr("Decay HF ratio (%)"), effect->DecayHFRatio(),
+ umin, umax));
+
+ // DecayTime
+ effect->DecayTimeRange(umin, umax);
+ parameters.append(createParameter(
+ DecayTime, tr("Decay time (ms)"), effect->DecayTime(),
+ umin, umax));
+
+ // Density
+ parameters.append(createParameter(
+ Density, tr("Density (%)"), effect->Density(), 0, 100));
+
+ // Diffusion
+ parameters.append(createParameter(
+ Diffusion, tr("Diffusion (%)"), effect->Diffusion(), 0, 100));
+
+ // ReflectionsDelay
+ parameters.append(createParameter(
+ ReflectionsDelay, tr("Reflections delay (ms)"),
+ effect->ReflectionsDelay(), 0, effect->ReflectionsDelayMax()));
+
+ // ReflectionsLevel
+ effect->ReflectionLevelRange(min, max);
+ parameters.append(createParameter(
+ ReflectionsLevel, tr("Reflections level (mB)"),
+ effect->ReflectionsLevel(),
+ min, max, EffectParameter::LogarithmicHint));
+
+ // ReverbDelay
+ parameters.append(createParameter(
+ ReverbDelay, tr("Reverb delay (ms)"), effect->ReverbDelay(),
+ 0, effect->ReverbDelayMax()));
+
+ // ReverbLevel
+ effect->ReverbLevelRange(min, max);
+ parameters.append(createParameter(
+ ReverbLevel, tr("Reverb level (mB)"), effect->ReverbLevel(),
+ min, max, EffectParameter::LogarithmicHint));
+
+ // RoomHFLevel
+ effect->RoomHFLevelRange(min, max);
+ parameters.append(createParameter(
+ RoomHFLevel, tr("Room HF level"), effect->RoomHFLevel(),
+ min, max));
+
+ // RoomLevel
+ effect->RoomLevelRange(min, max);
+ parameters.append(createParameter(
+ RoomLevel, tr("Room level (mB)"), effect->RoomLevel(),
+ min, max, EffectParameter::LogarithmicHint));
+ }
+
+ return supported;
+}
+
+QT_END_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/environmentalreverb.h b/src/3rdparty/phonon/mmf/environmentalreverb.h
new file mode 100644
index 0000000..eab68c6
--- /dev/null
+++ b/src/3rdparty/phonon/mmf/environmentalreverb.h
@@ -0,0 +1,62 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef PHONON_MMF_ENVIRONMENTALREVERB_H
+#define PHONON_MMF_ENVIRONMENTALREVERB_H
+
+#include "abstractaudioeffect.h"
+
+class CEnvironmentalReverb;
+
+QT_BEGIN_NAMESPACE
+
+namespace Phonon
+{
+namespace MMF
+{
+/**
+ * @short A reverb effect.
+ */
+class EnvironmentalReverb : public AbstractAudioEffect
+{
+ Q_OBJECT
+public:
+ EnvironmentalReverb(QObject *parent, const QList<EffectParameter>& parameters);
+
+ // Static interface required by EffectFactory
+ static const char* description();
+ static bool getParameters(CMdaAudioOutputStream *stream,
+ QList<EffectParameter>& parameters);
+
+protected:
+ // AbstractAudioEffect
+ virtual void createEffect(AudioPlayer::NativePlayer *player);
+ virtual int effectParameterChanged(const EffectParameter &param,
+ const QVariant &value);
+
+private:
+ CEnvironmentalReverb *concreteEffect();
+
+};
+}
+}
+
+QT_END_NAMESPACE
+
+#endif
+
diff --git a/src/3rdparty/phonon/mmf/loudness.cpp b/src/3rdparty/phonon/mmf/loudness.cpp
new file mode 100644
index 0000000..1079a35
--- /dev/null
+++ b/src/3rdparty/phonon/mmf/loudness.cpp
@@ -0,0 +1,58 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include <LoudnessBase.h>
+#include "loudness.h"
+
+QT_BEGIN_NAMESPACE
+
+using namespace Phonon;
+using namespace Phonon::MMF;
+
+// Define functions which depend on concrete native effect class name
+PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(Loudness)
+
+/*! \class MMF::Loudness
+ \internal
+*/
+
+Loudness::Loudness(QObject *parent, const QList<EffectParameter>& parameters)
+ : AbstractAudioEffect::AbstractAudioEffect(parent, parameters)
+{
+
+}
+
+//-----------------------------------------------------------------------------
+// Static functions
+//-----------------------------------------------------------------------------
+
+const char* Loudness::description()
+{
+ return "Loudness";
+}
+
+bool Loudness::getParameters(CMdaAudioOutputStream *stream,
+ QList<EffectParameter> &parameters)
+{
+ QScopedPointer<CLoudness> effect;
+ TRAPD(err, effect.reset(CLoudness::NewL(*stream)));
+ return (KErrNone == err);
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/3rdparty/phonon/mmf/loudness.h b/src/3rdparty/phonon/mmf/loudness.h
new file mode 100644
index 0000000..a688a67
--- /dev/null
+++ b/src/3rdparty/phonon/mmf/loudness.h
@@ -0,0 +1,60 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef PHONON_MMF_LOUDNESS_H
+#define PHONON_MMF_LOUDNESS_H
+
+#include "abstractaudioeffect.h"
+
+class CLoudness;
+
+QT_BEGIN_NAMESPACE
+
+namespace Phonon
+{
+namespace MMF
+{
+/**
+ * @short A "loudness" effect.
+ */
+class Loudness : public AbstractAudioEffect
+{
+ Q_OBJECT
+public:
+ Loudness(QObject *parent, const QList<EffectParameter>& parameters);
+
+ // Static interface required by EffectFactory
+ static const char* description();
+ static bool getParameters(CMdaAudioOutputStream *stream,
+ QList<EffectParameter>& parameters);
+
+protected:
+ // AbstractAudioEffect
+ virtual void createEffect(AudioPlayer::NativePlayer *player);
+
+private:
+ CLoudness *concreteEffect();
+
+};
+}
+}
+
+QT_END_NAMESPACE
+
+#endif
+
diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp
index 4653fee..9744774 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.cpp
+++ b/src/3rdparty/phonon/mmf/mediaobject.cpp
@@ -297,7 +297,10 @@ void MMF::MediaObject::createPlayer(const MediaSource &source)
break;
}
+ if (oldPlayer)
+ emit abstractPlayerChanged(0);
m_player.reset(newPlayer);
+ emit abstractPlayerChanged(newPlayer);
if (oldPlayerHasVideo != hasVideo()) {
emit hasVideoChanged(hasVideo());
diff --git a/src/3rdparty/phonon/mmf/mediaobject.h b/src/3rdparty/phonon/mmf/mediaobject.h
index 668b953..c87d755 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.h
+++ b/src/3rdparty/phonon/mmf/mediaobject.h
@@ -92,6 +92,7 @@ public Q_SLOTS:
void switchToNextSource();
Q_SIGNALS:
+ void abstractPlayerChanged(AbstractPlayer *player);
void totalTimeChanged(qint64 length);
void hasVideoChanged(bool hasVideo);
void seekableChanged(bool seekable);
@@ -101,8 +102,8 @@ Q_SIGNALS:
// TODO: emit metaDataChanged from MediaObject
void metaDataChanged(const QMultiMap<QString, QString>& metaData);
void currentSourceChanged(const MediaSource& source);
- void stateChanged(Phonon::State oldState,
- Phonon::State newState);
+ void stateChanged(Phonon::State newState,
+ Phonon::State oldState);
void finished();
void tick(qint64 time);
diff --git a/src/3rdparty/phonon/mmf/stereowidening.cpp b/src/3rdparty/phonon/mmf/stereowidening.cpp
new file mode 100644
index 0000000..f90651b
--- /dev/null
+++ b/src/3rdparty/phonon/mmf/stereowidening.cpp
@@ -0,0 +1,93 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include <StereoWideningBase.h>
+#include "stereowidening.h"
+
+QT_BEGIN_NAMESPACE
+
+using namespace Phonon;
+using namespace Phonon::MMF;
+
+// Define functions which depend on concrete native effect class name
+PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(StereoWidening)
+
+/*! \class MMF::StereoWidening
+ \internal
+*/
+
+StereoWidening::StereoWidening(QObject *parent, const QList<EffectParameter>& parameters)
+ : AbstractAudioEffect::AbstractAudioEffect(parent, parameters)
+{
+
+}
+
+int StereoWidening::parameterChanged(const EffectParameter &param,
+ const QVariant &value)
+{
+ Q_ASSERT_X(param.id() == ParameterBase, Q_FUNC_INFO, "Invalid parameter ID");
+
+ const qreal externalLevel = value.toReal();
+ const int internalLevel = param.toInternalValue(externalLevel);
+
+ TRAPD(err, concreteEffect()->SetStereoWideningLevelL(internalLevel));
+
+ return err;
+}
+
+//-----------------------------------------------------------------------------
+// Static functions
+//-----------------------------------------------------------------------------
+
+const char* StereoWidening::description()
+{
+ return "Stereo widening";
+}
+
+bool StereoWidening::getParameters(CMdaAudioOutputStream *stream,
+ QList<EffectParameter> &parameters)
+{
+ bool supported = false;
+
+ QScopedPointer<CStereoWidening> effect;
+ TRAPD(err, effect.reset(CStereoWidening::NewL(*stream)));
+
+ if (KErrNone == err) {
+ supported = true;
+
+ const qreal defaultValue =
+ Phonon::MMF::EffectParameter::toExternalValue
+ (effect->StereoWideningLevel(), 0, 100);
+
+ EffectParameter param(
+ /* parameterId */ ParameterBase,
+ /* name */ tr("Level (%)"),
+ /* hints */ EffectParameter::IntegerHint,
+ /* defaultValue */ QVariant(defaultValue),
+ /* minimumValue */ QVariant(qreal(-1.0)),
+ /* maximumValue */ QVariant(qreal(+1.0)));
+
+ param.setInternalRange(0, 100);
+ parameters.append(param);
+ }
+
+ return supported;
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/3rdparty/phonon/mmf/stereowidening.h b/src/3rdparty/phonon/mmf/stereowidening.h
new file mode 100644
index 0000000..c967e37
--- /dev/null
+++ b/src/3rdparty/phonon/mmf/stereowidening.h
@@ -0,0 +1,62 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef PHONON_MMF_STEREOWIDENING_H
+#define PHONON_MMF_STEREOWIDENING_H
+
+#include "abstractaudioeffect.h"
+
+class CStereoWidening;
+
+QT_BEGIN_NAMESPACE
+
+namespace Phonon
+{
+namespace MMF
+{
+/**
+ * @short A "bass boost" effect.
+ */
+class StereoWidening : public AbstractAudioEffect
+{
+ Q_OBJECT
+public:
+ StereoWidening(QObject *parent, const QList<EffectParameter>& parameters);
+
+ // Static interface required by EffectFactory
+ static const char* description();
+ static bool getParameters(CMdaAudioOutputStream *stream,
+ QList<EffectParameter>& parameters);
+
+protected:
+ // AbstractAudioEffect
+ virtual void createEffect(AudioPlayer::NativePlayer *player);
+ virtual int parameterChanged(const EffectParameter &param,
+ const QVariant &value);
+
+private:
+ CStereoWidening *concreteEffect();
+
+};
+}
+}
+
+QT_END_NAMESPACE
+
+#endif
+
diff --git a/src/3rdparty/phonon/phonon/effectwidget.cpp b/src/3rdparty/phonon/phonon/effectwidget.cpp
index 2334d7f..a2fe50f 100644
--- a/src/3rdparty/phonon/phonon/effectwidget.cpp
+++ b/src/3rdparty/phonon/phonon/effectwidget.cpp
@@ -15,7 +15,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
+ You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -151,7 +151,7 @@ void EffectWidgetPrivate::autogenerateUi()
bool minValueOk = false;
bool maxValueOk = false;
const int minValue = para.minimumValue().toInt(&minValueOk);
- const int maxValue = para.minimumValue().toInt(&maxValueOk);
+ const int maxValue = para.maximumValue().toInt(&maxValueOk);
sb->setRange(minValueOk ? minValue : DEFAULT_MIN_INT, maxValueOk ? maxValue : DEFAULT_MAX_INT);
sb->setValue(value.toInt());
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 0b88429..bc6d661 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -8,4 +8,4 @@ The commit imported was from the
and has the sha1 checksum
- 99ccc1c3e4db5354246720f9b9aa3d282e64497d
+ 8b9165d3bc84d1c8cc7df49a191cc3857b5530d4
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 516fadd..02daf86 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,28 @@
+2010-01-13 Miikka Heikkinen <miikka.heikkinen@digia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt/Symbian] Added missing vendor information to qtwebkit.sis
+
+ This information is necessary to Symbian sign the package.
+
+ http://bugreports.qt.nokia.com/browse/QTBUG-7290
+
+ * WebCore.pro:
+
+2010-01-12 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Adam Barth.
+
+ [Qt] XSL stylesheets can load documents from a different origin
+
+ https://bugs.webkit.org/show_bug.cgi?id=33423
+
+ * xml/XSLTProcessorQt.cpp:
+ (WebCore::XSLTUriResolver::XSLTUriResolver):
+ (WebCore::XSLTUriResolver::resolve):
+ (WebCore::XSLTProcessor::transformToString):
+
2010-01-07 Yael Aharon <yael.aharon@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 3eba696..9432217 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -9,6 +9,15 @@ symbian: {
webkitlibs.sources = QtWebKit.dll
webkitlibs.path = /sys/bin
+ vendorinfo = \
+ "; Localised Vendor name" \
+ "%{\"Nokia, Qt\"}" \
+ " " \
+ "; Unique Vendor name" \
+ ":\"Nokia, Qt\"" \
+ " "
+ webkitlibs.pkg_prerules = vendorinfo
+
DEPLOYMENT += webkitlibs
TARGET.UID3 = 0x200267C2
diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp
index 50ee427..3e05ca0 100644
--- a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp
+++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp
@@ -36,6 +36,7 @@
#include <wtf/Vector.h>
#include <qabstractmessagehandler.h>
+#include <qabstracturiresolver.h>
#include <qbuffer.h>
#include <qsourcelocation.h>
#include <qxmlquery.h>
@@ -87,6 +88,31 @@ void XSLTMessageHandler::handleMessage(QtMsgType type, const QString& descriptio
sourceLocation.line(), sourceLocation.uri().toString());
}
+class XSLTUriResolver : public QAbstractUriResolver {
+
+public:
+ XSLTUriResolver(Document* document);
+ virtual QUrl resolve(const QUrl& relative, const QUrl& baseURI) const;
+
+private:
+ Document* m_document;
+};
+
+XSLTUriResolver::XSLTUriResolver(Document* document)
+ : QAbstractUriResolver()
+ , m_document(document)
+{
+}
+
+QUrl XSLTUriResolver::resolve(const QUrl& relative, const QUrl& baseURI) const
+{
+ QUrl url = baseURI.resolved(relative);
+
+ if (!m_document->frame() || !m_document->securityOrigin()->canRequest(url))
+ return QUrl();
+ return url;
+}
+
bool XSLTProcessor::transformToString(Node* sourceNode, String&, String& resultString, String&)
{
bool success = false;
@@ -107,6 +133,7 @@ bool XSLTProcessor::transformToString(Node* sourceNode, String&, String& resultS
QXmlQuery query(QXmlQuery::XSLT20);
XSLTMessageHandler messageHandler(ownerDocument.get());
+ XSLTUriResolver uriResolver(ownerDocument.get());
query.setMessageHandler(&messageHandler);
XSLTProcessor::ParameterMap::iterator end = m_parameters.end();
@@ -132,6 +159,9 @@ bool XSLTProcessor::transformToString(Node* sourceNode, String&, String& resultS
query.setFocus(&inputBuffer);
query.setQuery(&styleSheetBuffer, QUrl(stylesheet->href()));
+
+ query.setUriResolver(&uriResolver);
+
success = query.evaluateTo(&outputBuffer);
outputBuffer.reset();
resultString = QString::fromUtf8(outputBuffer.readAll()).trimmed();
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index 90d98be..29bde0d 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -324,6 +324,45 @@ void QWebFramePrivate::renderPrivate(QPainter *painter, QWebFrame::RenderLayer l
}
}
+static bool webframe_scrollOverflow(WebCore::Frame* frame, int dx, int dy)
+{
+ if (!frame || !frame->document() || !frame->eventHandler())
+ return false;
+
+ Node* node = frame->document()->focusedNode();
+ if (!node)
+ node = frame->document()->elementFromPoint(frame->eventHandler()->currentMousePosition().x(),
+ frame->eventHandler()->currentMousePosition().y());
+ if (!node)
+ return false;
+
+ RenderObject* renderer = node->renderer();
+ if (!renderer)
+ return false;
+
+ if (renderer->isListBox())
+ return false;
+
+ RenderLayer* renderLayer = renderer->enclosingLayer();
+ if (!renderLayer)
+ return false;
+
+ bool scrolledHorizontal = false;
+ bool scrolledVertical = false;
+
+ if (dx > 0)
+ scrolledHorizontal = renderLayer->scroll(ScrollRight, ScrollByPixel, dx);
+ else if (dx < 0)
+ scrolledHorizontal = renderLayer->scroll(ScrollLeft, ScrollByPixel, qAbs(dx));
+
+ if (dy > 0)
+ scrolledVertical = renderLayer->scroll(ScrollDown, ScrollByPixel, dy);
+ else if (dy < 0)
+ scrolledVertical = renderLayer->scroll(ScrollUp, ScrollByPixel, qAbs(dy));
+
+ return (scrolledHorizontal || scrolledVertical);
+}
+
/*!
\class QWebFrame
\since 4.4
@@ -1008,6 +1047,51 @@ void QWebFrame::scroll(int dx, int dy)
}
/*!
+ \since 4.7
+ \internal
+ Scrolls nested frames starting at this frame, \a dx pixels to the right
+ and \a dy pixels downward. Both \a dx and \a dy may be negative. First attempts
+ to scroll elements with CSS overflow followed by this frame. If this
+ frame doesn't scroll, attempts to scroll the parent
+
+ \sa QWebFrame::scroll
+*/
+bool QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int dx, int dy)
+{
+ Frame* frame = QWebFramePrivate::core(qFrame);
+ bool scrolledHorizontal = false;
+ bool scrolledVertical = false;
+ bool scrolledOverflow = webframe_scrollOverflow(frame, dx, dy);
+
+ if (!scrolledOverflow) {
+ if (!frame || !frame->view())
+ return false;
+
+ do {
+ IntSize scrollOffset = frame->view()->scrollOffset();
+ IntPoint maxScrollOffset = frame->view()->maximumScrollPosition();
+
+ if (dx > 0) // scroll right
+ scrolledHorizontal = scrollOffset.width() < maxScrollOffset.x();
+ else if (dx < 0) // scroll left
+ scrolledHorizontal = scrollOffset.width() > 0;
+
+ if (dy > 0) // scroll down
+ scrolledVertical = scrollOffset.height() < maxScrollOffset.y();
+ else if (dy < 0) //scroll up
+ scrolledVertical = scrollOffset.height() > 0;
+
+ if (scrolledHorizontal || scrolledVertical) {
+ frame->view()->scrollBy(IntSize(dx, dy));
+ return true;
+ }
+ frame = frame->tree()->parent();
+ } while (frame && frame->view());
+ }
+ return (scrolledHorizontal || scrolledVertical || scrolledOverflow);
+}
+
+/*!
\property QWebFrame::scrollPosition
\since 4.5
\brief the position the frame is currently scrolled to.
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
index 081e65d..095d134 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
@@ -83,6 +83,8 @@ public:
void renderPrivate(QPainter*, QWebFrame::RenderLayer, const QRegion& clip);
+ bool scrollOverflow(int dx, int dy);
+
QWebFrame *q;
Qt::ScrollBarPolicy horizontalScrollBarPolicy;
Qt::ScrollBarPolicy verticalScrollBarPolicy;
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 31fad69..357b787 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,21 @@
+2009-12-18 Joe Ligman <joseph.ligman@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Add new API to QWebFrame to scrollRecursively starting with any css overflow
+ then checking current frame and then ancestors
+ https://bugs.webkit.org/show_bug.cgi?id=32668
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::scrollOverflow):
+ (QWebFrame::scrollRecursively):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ * tests/qwebframe/qwebframe.qrc:
+ * tests/qwebframe/testiframe.html: Added.
+ * tests/qwebframe/testiframe2.html: Added.
+ * tests/qwebframe/tst_qwebframe.cpp:
+
2010-01-07 Yael Aharon <yael.aharon@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc
index 9615e27..8afa0c1 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc
@@ -4,5 +4,7 @@
<file>style.css</file>
<file>test1.html</file>
<file>test2.html</file>
+<file>testiframe.html</file>
+<file>testiframe2.html</file>
</qresource>
</RCC>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/testiframe.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/testiframe.html
new file mode 100644
index 0000000..9f3ae85
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/testiframe.html
@@ -0,0 +1,54 @@
+</html>
+<html>
+<head>
+<title></title>
+<style type="text/css">
+<!--
+#header {
+ background: #0f0;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 800px;
+ height: 100px;
+}
+#content1 {
+ background: #ff0;
+ position: absolute;
+ top: 101px;
+ left: 0px;
+ width: 400px;
+ height: 400px;
+ overflow: scroll;
+}
+#content2 {
+ background: #ff7;
+ position: absolute;
+ top: 101px;
+ left: 401px;
+ width: 400px;
+ height: 400px;
+}
+#footer {
+ background: #0f0;
+ position: absolute;
+ top: 502px;
+ left: 0px;
+ width: 800px;
+ height: 200px;
+}
+-->
+</style>
+</head>
+<body>
+<div id="header"></div>
+<div id="content1">You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
+You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
+You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
+You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
+You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
+You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.</div>
+<iframe id="content2" name="control" src="testiframe2.html"> </iframe>
+<div id="footer"></div>
+</body>
+</html> \ No newline at end of file
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/testiframe2.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/testiframe2.html
new file mode 100644
index 0000000..1913a89
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/testiframe2.html
@@ -0,0 +1,21 @@
+</html>
+<html>
+<head>
+<title></title>
+<style type="text/css">
+<!--
+#content {
+ background: #fff;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 800px;
+ height: 800px;
+}
+-->
+</style>
+</head>
+<body>
+<div id="content"> </div>
+</body>
+</html> \ No newline at end of file
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index 8cc7953..609f8b4 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -606,6 +606,7 @@ private slots:
void scrollPosition();
void evaluateWillCauseRepaint();
void qObjectWrapperWithSameIdentity();
+ void scrollRecursively();
private:
QString evalJS(const QString&s) {
@@ -2824,5 +2825,71 @@ void tst_QWebFrame::qObjectWrapperWithSameIdentity()
QCOMPARE(mainFrame->toPlainText(), QString("test2"));
}
+bool QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int dx, int dy);
+
+void tst_QWebFrame::scrollRecursively()
+{
+ // The test content is
+ // a nested frame set
+ // The main frame scrolls
+ // and has two children
+ // an iframe and a div overflow
+ // both scroll
+ QWebView webView;
+ QWebPage* webPage = webView.page();
+ QSignalSpy loadSpy(webPage, SIGNAL(loadFinished(bool)));
+ QUrl url = QUrl("qrc:///testiframe.html");
+ webPage->mainFrame()->load(url);
+ QTRY_COMPARE(loadSpy.count(), 1);
+
+ QList<QWebFrame*> children = webPage->mainFrame()->childFrames();
+ QVERIFY(children.count() == 1);
+
+ // 1st test
+ // call scrollRecursively over mainframe
+ // verify scrolled
+ // verify scroll postion changed
+ QPoint scrollPosition(webPage->mainFrame()->scrollPosition());
+ QVERIFY(qtwebkit_webframe_scrollRecursively(webPage->mainFrame(), 10, 10));
+ QVERIFY(scrollPosition != webPage->mainFrame()->scrollPosition());
+
+ // 2nd test
+ // call scrollRecursively over child iframe
+ // verify scrolled
+ // verify child scroll position changed
+ // verify parent's scroll position did not change
+ scrollPosition = webPage->mainFrame()->scrollPosition();
+ QPoint childScrollPosition = children.at(0)->scrollPosition();
+ QVERIFY(qtwebkit_webframe_scrollRecursively(children.at(0), 10, 10));
+ QVERIFY(scrollPosition == webPage->mainFrame()->scrollPosition());
+ QVERIFY(childScrollPosition != children.at(0)->scrollPosition());
+
+ // 3rd test
+ // call scrollRecursively over div overflow
+ // verify scrolled == true
+ // verify parent and child frame's scroll postion did not change
+ QWebElement div = webPage->mainFrame()->documentElement().findFirst("#content1");
+ QMouseEvent evpres(QEvent::MouseMove, div.geometry().center(), Qt::NoButton, Qt::NoButton, Qt::NoModifier);
+ webPage->event(&evpres);
+ scrollPosition = webPage->mainFrame()->scrollPosition();
+ childScrollPosition = children.at(0)->scrollPosition();
+ QVERIFY(qtwebkit_webframe_scrollRecursively(webPage->mainFrame(), 5, 5));
+ QVERIFY(childScrollPosition == children.at(0)->scrollPosition());
+ QVERIFY(scrollPosition == webPage->mainFrame()->scrollPosition());
+
+ // 4th test
+ // call scrollRecursively twice over childs iframe
+ // verify scrolled == true first time
+ // verify parent's scroll == true second time
+ // verify parent and childs scroll position changed
+ childScrollPosition = children.at(0)->scrollPosition();
+ QVERIFY(qtwebkit_webframe_scrollRecursively(children.at(0), -10, -10));
+ QVERIFY(childScrollPosition != children.at(0)->scrollPosition());
+ scrollPosition = webPage->mainFrame()->scrollPosition();
+ QVERIFY(qtwebkit_webframe_scrollRecursively(children.at(0), -10, -10));
+ QVERIFY(scrollPosition != webPage->mainFrame()->scrollPosition());
+
+}
+
QTEST_MAIN(tst_QWebFrame)
#include "tst_qwebframe.moc"
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 9ef2101..871dd5c 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -514,45 +514,58 @@
/*!
\enum Qt::ConnectionType
- This enum describes the types of connection that can be used between signals and
- slots. In particular, it determines whether a particular signal is delivered to a
- slot immediately or queued for delivery at a later time.
+ This enum describes the types of connection that can be used
+ between signals and slots. In particular, it determines whether a
+ particular signal is delivered to a slot immediately or queued for
+ delivery at a later time.
+
+ \value AutoConnection
+ (default) Same as DirectConnection, if the emitter and
+ receiver are in the same thread. Same as QueuedConnection,
+ if the emitter and receiver are in different threads.
+
+ \value DirectConnection
+ The slot is invoked immediately, when the signal is
+ emitted.
+
+ \value QueuedConnection
+ The slot is invoked when control returns to the event loop
+ of the receiver's thread. The slot is executed in the
+ receiver's thread.
- \value DirectConnection When emitted, the signal is immediately delivered to the slot.
- \value QueuedConnection When emitted, the signal is queued until the event loop is
- able to deliver it to the slot.
\value BlockingQueuedConnection
- Same as QueuedConnection, except that the current thread blocks
- until the slot has been delivered. This connection type should
- only be used for receivers in a different thread. Note that misuse
- of this type can lead to deadlocks in your application.
- \value AutoConnection If the signal is emitted from the thread
- in which the receiving object lives, the
- slot is invoked directly, as with
- Qt::DirectConnection; otherwise the
- signal is queued, as with
- Qt::QueuedConnection.
- \value UniqueConnection Same as AutoConnection, but there will be a check that the signal is
- not already connected to the same slot before connecting, otherwise,
- the connection will fail.
- This value was introduced in Qt 4.6.
+ Same as QueuedConnection, except the current thread blocks
+ until the slot returns. This connection type should only be
+ used where the emitter and receiver are in different
+ threads. \note Violating this rule can cause your
+ application to deadlock.
+
+ \value UniqueConnection
+ Same as AutoConnection, but the connection is made only if
+ it does not duplicate an existing connection. i.e., if the
+ same signal is already connected to the same slot for the
+ same pair of objects, then the connection will fail. This
+ connection type was introduced in Qt 4.6.
+
\value AutoCompatConnection
- The default connection type for signals and slots when Qt 3 support
- is enabled. Equivalent to AutoConnection for connections but will cause warnings
- to be output under certain circumstances. See
- \l{Porting to Qt 4#Compatibility Signals and Slots}{Compatibility Signals and Slots}
- for further information.
+ The default type when Qt 3 support is enabled. Same as
+ AutoConnection but will also cause warnings to be output in
+ certain situations. See \l{Porting to Qt 4#Compatibility
+ Signals and Slots}{Compatibility Signals and Slots} for
+ further information.
- With queued connections, the parameters must be of types that are known to
- Qt's meta-object system, because Qt needs to copy the arguments to store them
- in an event behind the scenes. If you try to use a queued connection and
- get the error message
+ With queued connections, the parameters must be of types that are
+ known to Qt's meta-object system, because Qt needs to copy the
+ arguments to store them in an event behind the scenes. If you try
+ to use a queued connection and get the error message:
\snippet doc/src/snippets/code/doc_src_qnamespace.qdoc 0
- call qRegisterMetaType() to register the data type before you
+ Call qRegisterMetaType() to register the data type before you
establish the connection.
+ When using signals and slots with multiple threads, see \l{Signals and Slots Across Threads}.
+
\sa {Thread Support in Qt}, QObject::connect(), qRegisterMetaType()
*/
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index b4437db..e90529e 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -573,10 +573,13 @@ QString QFileInfo::canonicalFilePath() const
QString QFileInfo::absolutePath() const
{
Q_D(const QFileInfo);
- if (d->data->fileName.isEmpty())
+
+ if (!d->data->fileEngine) {
+ return QLatin1String("");
+ } else if (d->data->fileName.isEmpty()) {
qWarning("QFileInfo::absolutePath: Constructed with empty filename");
- if(!d->data->fileEngine)
return QLatin1String("");
+ }
return d->getFileName(QAbstractFileEngine::AbsolutePathName);
}
diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp
index 328fd3d..0fd965b 100644
--- a/src/corelib/kernel/qcore_unix.cpp
+++ b/src/corelib/kernel/qcore_unix.cpp
@@ -42,7 +42,9 @@
#include "qcore_unix_p.h"
#ifndef Q_OS_VXWORKS
+# if !defined(Q_OS_HPUX) || defined(__ia64)
# include <sys/select.h>
+# endif
# include <sys/time.h>
#else
# include <selectLib.h>
diff --git a/src/corelib/kernel/qmath.cpp b/src/corelib/kernel/qmath.cpp
index e89c1e6..a3586a4 100644
--- a/src/corelib/kernel/qmath.cpp
+++ b/src/corelib/kernel/qmath.cpp
@@ -44,262 +44,262 @@
QT_BEGIN_NAMESPACE
const qreal qt_sine_table[QT_SINE_TABLE_SIZE] = {
- 0.0,
- 0.024541228522912288,
- 0.049067674327418015,
- 0.073564563599667426,
- 0.098017140329560604,
- 0.1224106751992162,
- 0.14673047445536175,
- 0.17096188876030122,
- 0.19509032201612825,
- 0.2191012401568698,
- 0.24298017990326387,
- 0.26671275747489837,
- 0.29028467725446233,
- 0.31368174039889152,
- 0.33688985339222005,
- 0.35989503653498811,
- 0.38268343236508978,
- 0.40524131400498986,
- 0.42755509343028208,
- 0.44961132965460654,
- 0.47139673682599764,
- 0.49289819222978404,
- 0.51410274419322166,
- 0.53499761988709715,
- 0.55557023301960218,
- 0.57580819141784534,
- 0.59569930449243336,
- 0.61523159058062682,
- 0.63439328416364549,
- 0.65317284295377676,
- 0.67155895484701833,
- 0.68954054473706683,
- 0.70710678118654746,
- 0.72424708295146689,
- 0.74095112535495911,
- 0.75720884650648446,
- 0.77301045336273699,
- 0.78834642762660623,
- 0.80320753148064483,
- 0.81758481315158371,
- 0.83146961230254524,
- 0.84485356524970701,
- 0.85772861000027212,
- 0.87008699110871135,
- 0.88192126434835494,
- 0.89322430119551532,
- 0.90398929312344334,
- 0.91420975570353069,
- 0.92387953251128674,
- 0.93299279883473885,
- 0.94154406518302081,
- 0.94952818059303667,
- 0.95694033573220894,
- 0.96377606579543984,
- 0.97003125319454397,
- 0.97570213003852857,
- 0.98078528040323043,
- 0.98527764238894122,
- 0.98917650996478101,
- 0.99247953459870997,
- 0.99518472667219682,
- 0.99729045667869021,
- 0.99879545620517241,
- 0.99969881869620425,
- 1.0,
- 0.99969881869620425,
- 0.99879545620517241,
- 0.99729045667869021,
- 0.99518472667219693,
- 0.99247953459870997,
- 0.98917650996478101,
- 0.98527764238894122,
- 0.98078528040323043,
- 0.97570213003852857,
- 0.97003125319454397,
- 0.96377606579543984,
- 0.95694033573220894,
- 0.94952818059303667,
- 0.94154406518302081,
- 0.93299279883473885,
- 0.92387953251128674,
- 0.91420975570353069,
- 0.90398929312344345,
- 0.89322430119551521,
- 0.88192126434835505,
- 0.87008699110871146,
- 0.85772861000027212,
- 0.84485356524970723,
- 0.83146961230254546,
- 0.81758481315158371,
- 0.80320753148064494,
- 0.78834642762660634,
- 0.7730104533627371,
- 0.75720884650648468,
- 0.74095112535495899,
- 0.72424708295146689,
- 0.70710678118654757,
- 0.68954054473706705,
- 0.67155895484701855,
- 0.65317284295377664,
- 0.63439328416364549,
- 0.61523159058062693,
- 0.59569930449243347,
- 0.57580819141784545,
- 0.55557023301960218,
- 0.53499761988709715,
- 0.51410274419322177,
- 0.49289819222978415,
- 0.47139673682599786,
- 0.44961132965460687,
- 0.42755509343028203,
- 0.40524131400498992,
- 0.38268343236508989,
- 0.35989503653498833,
- 0.33688985339222033,
- 0.31368174039889141,
- 0.29028467725446239,
- 0.26671275747489848,
- 0.24298017990326407,
- 0.21910124015687005,
- 0.19509032201612861,
- 0.17096188876030122,
- 0.1467304744553618,
- 0.12241067519921635,
- 0.098017140329560826,
- 0.073564563599667732,
- 0.049067674327417966,
- 0.024541228522912326,
- 0.0,
- -0.02454122852291208,
- -0.049067674327417724,
- -0.073564563599667496,
- -0.09801714032956059,
- -0.1224106751992161,
- -0.14673047445536158,
- -0.17096188876030097,
- -0.19509032201612836,
- -0.2191012401568698,
- -0.24298017990326382,
- -0.26671275747489825,
- -0.29028467725446211,
- -0.31368174039889118,
- -0.33688985339222011,
- -0.35989503653498811,
- -0.38268343236508967,
- -0.40524131400498969,
- -0.42755509343028181,
- -0.44961132965460665,
- -0.47139673682599764,
- -0.49289819222978393,
- -0.51410274419322155,
- -0.53499761988709693,
- -0.55557023301960196,
- -0.57580819141784534,
- -0.59569930449243325,
- -0.61523159058062671,
- -0.63439328416364527,
- -0.65317284295377653,
- -0.67155895484701844,
- -0.68954054473706683,
- -0.70710678118654746,
- -0.72424708295146678,
- -0.74095112535495888,
- -0.75720884650648423,
- -0.77301045336273666,
- -0.78834642762660589,
- -0.80320753148064505,
- -0.81758481315158382,
- -0.83146961230254524,
- -0.84485356524970701,
- -0.85772861000027201,
- -0.87008699110871135,
- -0.88192126434835494,
- -0.89322430119551521,
- -0.90398929312344312,
- -0.91420975570353047,
- -0.92387953251128652,
- -0.93299279883473896,
- -0.94154406518302081,
- -0.94952818059303667,
- -0.95694033573220882,
- -0.96377606579543984,
- -0.97003125319454397,
- -0.97570213003852846,
- -0.98078528040323032,
- -0.98527764238894111,
- -0.9891765099647809,
- -0.99247953459871008,
- -0.99518472667219693,
- -0.99729045667869021,
- -0.99879545620517241,
- -0.99969881869620425,
- -1.0,
- -0.99969881869620425,
- -0.99879545620517241,
- -0.99729045667869021,
- -0.99518472667219693,
- -0.99247953459871008,
- -0.9891765099647809,
- -0.98527764238894122,
- -0.98078528040323043,
- -0.97570213003852857,
- -0.97003125319454397,
- -0.96377606579543995,
- -0.95694033573220894,
- -0.94952818059303679,
- -0.94154406518302092,
- -0.93299279883473907,
- -0.92387953251128663,
- -0.91420975570353058,
- -0.90398929312344334,
- -0.89322430119551532,
- -0.88192126434835505,
- -0.87008699110871146,
- -0.85772861000027223,
- -0.84485356524970723,
- -0.83146961230254546,
- -0.81758481315158404,
- -0.80320753148064528,
- -0.78834642762660612,
- -0.77301045336273688,
- -0.75720884650648457,
- -0.74095112535495911,
- -0.724247082951467,
- -0.70710678118654768,
- -0.68954054473706716,
- -0.67155895484701866,
- -0.65317284295377709,
- -0.63439328416364593,
- -0.61523159058062737,
- -0.59569930449243325,
- -0.57580819141784523,
- -0.55557023301960218,
- -0.53499761988709726,
- -0.51410274419322188,
- -0.49289819222978426,
- -0.47139673682599792,
- -0.44961132965460698,
- -0.42755509343028253,
- -0.40524131400499042,
- -0.38268343236509039,
- -0.359895036534988,
- -0.33688985339222,
- -0.31368174039889152,
- -0.2902846772544625,
- -0.26671275747489859,
- -0.24298017990326418,
- -0.21910124015687016,
- -0.19509032201612872,
- -0.17096188876030177,
- -0.14673047445536239,
- -0.12241067519921603,
- -0.098017140329560506,
- -0.073564563599667412,
- -0.049067674327418091,
- -0.024541228522912448
+ qreal(0.0),
+ qreal(0.024541228522912288),
+ qreal(0.049067674327418015),
+ qreal(0.073564563599667426),
+ qreal(0.098017140329560604),
+ qreal(0.1224106751992162),
+ qreal(0.14673047445536175),
+ qreal(0.17096188876030122),
+ qreal(0.19509032201612825),
+ qreal(0.2191012401568698),
+ qreal(0.24298017990326387),
+ qreal(0.26671275747489837),
+ qreal(0.29028467725446233),
+ qreal(0.31368174039889152),
+ qreal(0.33688985339222005),
+ qreal(0.35989503653498811),
+ qreal(0.38268343236508978),
+ qreal(0.40524131400498986),
+ qreal(0.42755509343028208),
+ qreal(0.44961132965460654),
+ qreal(0.47139673682599764),
+ qreal(0.49289819222978404),
+ qreal(0.51410274419322166),
+ qreal(0.53499761988709715),
+ qreal(0.55557023301960218),
+ qreal(0.57580819141784534),
+ qreal(0.59569930449243336),
+ qreal(0.61523159058062682),
+ qreal(0.63439328416364549),
+ qreal(0.65317284295377676),
+ qreal(0.67155895484701833),
+ qreal(0.68954054473706683),
+ qreal(0.70710678118654746),
+ qreal(0.72424708295146689),
+ qreal(0.74095112535495911),
+ qreal(0.75720884650648446),
+ qreal(0.77301045336273699),
+ qreal(0.78834642762660623),
+ qreal(0.80320753148064483),
+ qreal(0.81758481315158371),
+ qreal(0.83146961230254524),
+ qreal(0.84485356524970701),
+ qreal(0.85772861000027212),
+ qreal(0.87008699110871135),
+ qreal(0.88192126434835494),
+ qreal(0.89322430119551532),
+ qreal(0.90398929312344334),
+ qreal(0.91420975570353069),
+ qreal(0.92387953251128674),
+ qreal(0.93299279883473885),
+ qreal(0.94154406518302081),
+ qreal(0.94952818059303667),
+ qreal(0.95694033573220894),
+ qreal(0.96377606579543984),
+ qreal(0.97003125319454397),
+ qreal(0.97570213003852857),
+ qreal(0.98078528040323043),
+ qreal(0.98527764238894122),
+ qreal(0.98917650996478101),
+ qreal(0.99247953459870997),
+ qreal(0.99518472667219682),
+ qreal(0.99729045667869021),
+ qreal(0.99879545620517241),
+ qreal(0.99969881869620425),
+ qreal(1.0),
+ qreal(0.99969881869620425),
+ qreal(0.99879545620517241),
+ qreal(0.99729045667869021),
+ qreal(0.99518472667219693),
+ qreal(0.99247953459870997),
+ qreal(0.98917650996478101),
+ qreal(0.98527764238894122),
+ qreal(0.98078528040323043),
+ qreal(0.97570213003852857),
+ qreal(0.97003125319454397),
+ qreal(0.96377606579543984),
+ qreal(0.95694033573220894),
+ qreal(0.94952818059303667),
+ qreal(0.94154406518302081),
+ qreal(0.93299279883473885),
+ qreal(0.92387953251128674),
+ qreal(0.91420975570353069),
+ qreal(0.90398929312344345),
+ qreal(0.89322430119551521),
+ qreal(0.88192126434835505),
+ qreal(0.87008699110871146),
+ qreal(0.85772861000027212),
+ qreal(0.84485356524970723),
+ qreal(0.83146961230254546),
+ qreal(0.81758481315158371),
+ qreal(0.80320753148064494),
+ qreal(0.78834642762660634),
+ qreal(0.7730104533627371),
+ qreal(0.75720884650648468),
+ qreal(0.74095112535495899),
+ qreal(0.72424708295146689),
+ qreal(0.70710678118654757),
+ qreal(0.68954054473706705),
+ qreal(0.67155895484701855),
+ qreal(0.65317284295377664),
+ qreal(0.63439328416364549),
+ qreal(0.61523159058062693),
+ qreal(0.59569930449243347),
+ qreal(0.57580819141784545),
+ qreal(0.55557023301960218),
+ qreal(0.53499761988709715),
+ qreal(0.51410274419322177),
+ qreal(0.49289819222978415),
+ qreal(0.47139673682599786),
+ qreal(0.44961132965460687),
+ qreal(0.42755509343028203),
+ qreal(0.40524131400498992),
+ qreal(0.38268343236508989),
+ qreal(0.35989503653498833),
+ qreal(0.33688985339222033),
+ qreal(0.31368174039889141),
+ qreal(0.29028467725446239),
+ qreal(0.26671275747489848),
+ qreal(0.24298017990326407),
+ qreal(0.21910124015687005),
+ qreal(0.19509032201612861),
+ qreal(0.17096188876030122),
+ qreal(0.1467304744553618),
+ qreal(0.12241067519921635),
+ qreal(0.098017140329560826),
+ qreal(0.073564563599667732),
+ qreal(0.049067674327417966),
+ qreal(0.024541228522912326),
+ qreal(0.0),
+ qreal(-0.02454122852291208),
+ qreal(-0.049067674327417724),
+ qreal(-0.073564563599667496),
+ qreal(-0.09801714032956059),
+ qreal(-0.1224106751992161),
+ qreal(-0.14673047445536158),
+ qreal(-0.17096188876030097),
+ qreal(-0.19509032201612836),
+ qreal(-0.2191012401568698),
+ qreal(-0.24298017990326382),
+ qreal(-0.26671275747489825),
+ qreal(-0.29028467725446211),
+ qreal(-0.31368174039889118),
+ qreal(-0.33688985339222011),
+ qreal(-0.35989503653498811),
+ qreal(-0.38268343236508967),
+ qreal(-0.40524131400498969),
+ qreal(-0.42755509343028181),
+ qreal(-0.44961132965460665),
+ qreal(-0.47139673682599764),
+ qreal(-0.49289819222978393),
+ qreal(-0.51410274419322155),
+ qreal(-0.53499761988709693),
+ qreal(-0.55557023301960196),
+ qreal(-0.57580819141784534),
+ qreal(-0.59569930449243325),
+ qreal(-0.61523159058062671),
+ qreal(-0.63439328416364527),
+ qreal(-0.65317284295377653),
+ qreal(-0.67155895484701844),
+ qreal(-0.68954054473706683),
+ qreal(-0.70710678118654746),
+ qreal(-0.72424708295146678),
+ qreal(-0.74095112535495888),
+ qreal(-0.75720884650648423),
+ qreal(-0.77301045336273666),
+ qreal(-0.78834642762660589),
+ qreal(-0.80320753148064505),
+ qreal(-0.81758481315158382),
+ qreal(-0.83146961230254524),
+ qreal(-0.84485356524970701),
+ qreal(-0.85772861000027201),
+ qreal(-0.87008699110871135),
+ qreal(-0.88192126434835494),
+ qreal(-0.89322430119551521),
+ qreal(-0.90398929312344312),
+ qreal(-0.91420975570353047),
+ qreal(-0.92387953251128652),
+ qreal(-0.93299279883473896),
+ qreal(-0.94154406518302081),
+ qreal(-0.94952818059303667),
+ qreal(-0.95694033573220882),
+ qreal(-0.96377606579543984),
+ qreal(-0.97003125319454397),
+ qreal(-0.97570213003852846),
+ qreal(-0.98078528040323032),
+ qreal(-0.98527764238894111),
+ qreal(-0.9891765099647809),
+ qreal(-0.99247953459871008),
+ qreal(-0.99518472667219693),
+ qreal(-0.99729045667869021),
+ qreal(-0.99879545620517241),
+ qreal(-0.99969881869620425),
+ qreal(-1.0),
+ qreal(-0.99969881869620425),
+ qreal(-0.99879545620517241),
+ qreal(-0.99729045667869021),
+ qreal(-0.99518472667219693),
+ qreal(-0.99247953459871008),
+ qreal(-0.9891765099647809),
+ qreal(-0.98527764238894122),
+ qreal(-0.98078528040323043),
+ qreal(-0.97570213003852857),
+ qreal(-0.97003125319454397),
+ qreal(-0.96377606579543995),
+ qreal(-0.95694033573220894),
+ qreal(-0.94952818059303679),
+ qreal(-0.94154406518302092),
+ qreal(-0.93299279883473907),
+ qreal(-0.92387953251128663),
+ qreal(-0.91420975570353058),
+ qreal(-0.90398929312344334),
+ qreal(-0.89322430119551532),
+ qreal(-0.88192126434835505),
+ qreal(-0.87008699110871146),
+ qreal(-0.85772861000027223),
+ qreal(-0.84485356524970723),
+ qreal(-0.83146961230254546),
+ qreal(-0.81758481315158404),
+ qreal(-0.80320753148064528),
+ qreal(-0.78834642762660612),
+ qreal(-0.77301045336273688),
+ qreal(-0.75720884650648457),
+ qreal(-0.74095112535495911),
+ qreal(-0.724247082951467),
+ qreal(-0.70710678118654768),
+ qreal(-0.68954054473706716),
+ qreal(-0.67155895484701866),
+ qreal(-0.65317284295377709),
+ qreal(-0.63439328416364593),
+ qreal(-0.61523159058062737),
+ qreal(-0.59569930449243325),
+ qreal(-0.57580819141784523),
+ qreal(-0.55557023301960218),
+ qreal(-0.53499761988709726),
+ qreal(-0.51410274419322188),
+ qreal(-0.49289819222978426),
+ qreal(-0.47139673682599792),
+ qreal(-0.44961132965460698),
+ qreal(-0.42755509343028253),
+ qreal(-0.40524131400499042),
+ qreal(-0.38268343236509039),
+ qreal(-0.359895036534988),
+ qreal(-0.33688985339222),
+ qreal(-0.31368174039889152),
+ qreal(-0.2902846772544625),
+ qreal(-0.26671275747489859),
+ qreal(-0.24298017990326418),
+ qreal(-0.21910124015687016),
+ qreal(-0.19509032201612872),
+ qreal(-0.17096188876030177),
+ qreal(-0.14673047445536239),
+ qreal(-0.12241067519921603),
+ qreal(-0.098017140329560506),
+ qreal(-0.073564563599667412),
+ qreal(-0.049067674327418091),
+ qreal(-0.024541228522912448)
};
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 3564a35..8346fe4 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -2456,7 +2456,7 @@ int QObject::receivers(const char *signal) const
If you pass the Qt::UniqueConnection \a type, the connection will only
be made if it is not a duplicate. If there is already a duplicate
(exact same signal to the exact same slot on the same objects),
- the connection will fail and connect will return false
+ the connection will fail and connect will return false.
The optional \a type parameter describes the type of connection
to establish. In particular, it determines whether a particular
diff --git a/src/corelib/thread/qreadwritelock.cpp b/src/corelib/thread/qreadwritelock.cpp
index 3463eab..bd07a97 100644
--- a/src/corelib/thread/qreadwritelock.cpp
+++ b/src/corelib/thread/qreadwritelock.cpp
@@ -82,7 +82,7 @@ QT_BEGIN_NAMESPACE
Like QMutex, a QReadWriteLock can be recursively locked by the
same thread when constructed in
- \l{QReadWriteLock::RecursionMode}recursive mode}. In such cases,
+ \l{QReadWriteLock::RecursionMode}. In such cases,
unlock() must be called the same number of times lockForWrite() or
lockForRead() was called. Note that the lock type cannot be
changed when trying to lock recursively, i.e. it is not possible
@@ -266,12 +266,12 @@ bool QReadWriteLock::tryLockForRead(int timeout)
return true;
}
- /*!
+/*!
Locks the lock for writing. This function will block the current
thread if another thread has locked for reading or writing.
\sa unlock() lockForRead() tryLockForWrite()
- */
+*/
void QReadWriteLock::lockForWrite()
{
QMutexLocker lock(&d->mutex);
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 572c050..30fa0b6 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -1826,7 +1826,7 @@ QDBusMessage QDBusConnectionPrivate::sendWithReply(const QDBusMessage &message,
QDBusPendingCallPrivate *pcall = sendWithReplyAsync(message, timeout);
Q_ASSERT(pcall);
- if (pcall->replyMessage.type() != QDBusMessage::InvalidMessage) {
+ if (pcall->replyMessage.type() == QDBusMessage::InvalidMessage) {
pcall->watcherHelper = new QDBusPendingCallWatcherHelper;
QEventLoop loop;
loop.connect(pcall->watcherHelper, SIGNAL(reply(QDBusMessage)), SLOT(quit()));
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index c70650d..3d59463 100644
--- a/src/gui/dialogs/qfiledialog.cpp
+++ b/src/gui/dialogs/qfiledialog.cpp
@@ -3245,6 +3245,10 @@ QString QFSCompleter::pathFromIndex(const QModelIndex &index) const
QString currentLocation = dirModel->rootPath();
QString path = index.data(QFileSystemModel::FilePathRole).toString();
if (!currentLocation.isEmpty() && path.startsWith(currentLocation)) {
+#if defined(Q_OS_UNIX) || defined(Q_OS_WINCE)
+ if (currentLocation == QDir::separator())
+ return path.mid(currentLocation.length());
+#endif
return path.mid(currentLocation.length() + 1);
}
return index.data(QFileSystemModel::FilePathRole).toString();
@@ -3300,6 +3304,10 @@ QStringList QFSCompleter::splitPath(const QString &path) const
else
dirModel = sourceModel;
QString currentLocation = QDir::toNativeSeparators(dirModel->rootPath());
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+ if (currentLocation.endsWith(QLatin1Char(':')))
+ currentLocation.append(sep);
+#endif
if (currentLocation.contains(sep) && path != currentLocation) {
QStringList currentLocationList = splitPath(currentLocation);
while (!currentLocationList.isEmpty()
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 2a1fba5..cbd9a8a 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -146,9 +146,16 @@ void QAbstractItemViewPrivate::setHoverIndex(const QPersistentModelIndex &index)
if (hover == index)
return;
- q->update(hover); //update the old one
+ if (selectionBehavior != QAbstractItemView::SelectRows) {
+ q->update(hover); //update the old one
+ q->update(index); //update the new one
+ } else {
+ QRect oldHoverRect = q->visualRect(hover);
+ QRect newHoverRect = q->visualRect(index);
+ viewport->update(QRect(0, newHoverRect.y(), viewport->width(), newHoverRect.height()));
+ viewport->update(QRect(0, oldHoverRect.y(), viewport->width(), oldHoverRect.height()));
+ }
hover = index;
- q->update(hover); //update the new one
}
void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index)
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index e9643aa..d0fa22d 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -178,7 +178,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- Constructs a table view with a \a parent to represent a model's
+ Constructs a tree view with a \a parent to represent a model's
data. Use setModel() to set the model.
\sa QAbstractItemModel
@@ -1241,15 +1241,6 @@ bool QTreeView::viewportEvent(QEvent *event)
viewport()->update(newRect);
}
}
- if (selectionBehavior() == QAbstractItemView::SelectRows) {
- QModelIndex newHoverIndex = indexAt(he->pos());
- if (d->hover != newHoverIndex) {
- QRect oldHoverRect = visualRect(d->hover);
- QRect newHoverRect = visualRect(newHoverIndex);
- viewport()->update(QRect(0, newHoverRect.y(), viewport()->width(), newHoverRect.height()));
- viewport()->update(QRect(0, oldHoverRect.y(), viewport()->width(), oldHoverRect.height()));
- }
- }
break; }
default:
break;
@@ -2644,10 +2635,13 @@ void QTreeView::selectAll()
return;
SelectionMode mode = d->selectionMode;
d->executePostedLayout(); //make sure we lay out the items
- if (mode != SingleSelection && !d->viewItems.isEmpty())
- d->select(d->viewItems.first().index, d->viewItems.last().index,
+ if (mode != SingleSelection && !d->viewItems.isEmpty()) {
+ const QModelIndex &idx = d->viewItems.last().index;
+ QModelIndex lastItemIndex = idx.sibling(idx.row(), d->model->columnCount(idx.parent()) - 1);
+ d->select(d->viewItems.first().index, lastItemIndex,
QItemSelectionModel::ClearAndSelect
|QItemSelectionModel::Rows);
+ }
}
/*!
diff --git a/src/gui/kernel/qwidget_qws.cpp b/src/gui/kernel/qwidget_qws.cpp
index 1f1dac6..b827e8b 100644
--- a/src/gui/kernel/qwidget_qws.cpp
+++ b/src/gui/kernel/qwidget_qws.cpp
@@ -287,7 +287,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
} else {
// release previous focus information participating with
// preedit preservation of qic -- while we still have a winId
- QInputContext *qic = inputContext();
+ QInputContext *qic = QApplicationPrivate::inputContext;
if (qic)
qic->widgetDestroyed(this);
}
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 75c2e31..c65a162 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -1152,7 +1152,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
if (d->ic) {
delete d->ic;
} else {
- QInputContext *ic = inputContext();
+ QInputContext *ic = QApplicationPrivate::inputContext;
if (ic) {
ic->widgetDestroyed(this);
}
diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp
index 51b3691..ad0c2eb 100644
--- a/src/gui/painting/qoutlinemapper.cpp
+++ b/src/gui/painting/qoutlinemapper.cpp
@@ -225,9 +225,10 @@ void QOutlineMapper::endOutline()
controlPointRect = boundingRect(elements, element_count);
#ifdef QT_DEBUG_CONVERT
- printf(" - control point rect (%.2f, %.2f) %.2f x %.2f\n",
+ printf(" - control point rect (%.2f, %.2f) %.2f x %.2f, clip=(%d,%d, %dx%d)\n",
controlPointRect.x(), controlPointRect.y(),
- controlPointRect.width(), controlPointRect.height());
+ controlPointRect.width(), controlPointRect.height(),
+ m_clip_rect.x(), m_clip_rect.y(), m_clip_rect.width(), m_clip_rect.height());
#endif
@@ -235,7 +236,9 @@ void QOutlineMapper::endOutline()
const bool do_clip = (controlPointRect.left() < -QT_RASTER_COORD_LIMIT
|| controlPointRect.right() > QT_RASTER_COORD_LIMIT
|| controlPointRect.top() < -QT_RASTER_COORD_LIMIT
- || controlPointRect.bottom() > QT_RASTER_COORD_LIMIT);
+ || controlPointRect.bottom() > QT_RASTER_COORD_LIMIT
+ || controlPointRect.width() > QT_RASTER_COORD_LIMIT
+ || controlPointRect.height() > QT_RASTER_COORD_LIMIT);
if (do_clip) {
clipElements(elements, elementTypes(), element_count);
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 0e7adf3..3f2322e 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -475,8 +475,10 @@ bool QRasterPaintEngine::begin(QPaintDevice *device)
QRasterPaintEngineState *s = state();
ensureOutlineMapper();
d->outlineMapper->m_clip_rect = d->deviceRect.adjusted(-10, -10, 10, 10);
+
+ // This is the upp
QRect bounds(-QT_RASTER_COORD_LIMIT, -QT_RASTER_COORD_LIMIT,
- 2*QT_RASTER_COORD_LIMIT, 2*QT_RASTER_COORD_LIMIT);
+ QT_RASTER_COORD_LIMIT*2 - 1, QT_RASTER_COORD_LIMIT * 2 - 1);
d->outlineMapper->m_clip_rect = bounds.intersected(d->outlineMapper->m_clip_rect);
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 3c07451..058f226 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -860,7 +860,7 @@ void QPaintEngineEx::drawPoints(const QPointF *points, int pointCount)
for (int i=0; i<count; ++i) {
pts[++oset] = points[i].x();
pts[++oset] = points[i].y();
- pts[++oset] = points[i].x() + 0.001;
+ pts[++oset] = points[i].x() + 1/63.;
pts[++oset] = points[i].y();
}
QVectorPath path(pts, count * 2, qpaintengineex_line_types_16, QVectorPath::LinesHint);
@@ -870,7 +870,7 @@ void QPaintEngineEx::drawPoints(const QPointF *points, int pointCount)
}
} else {
for (int i=0; i<pointCount; ++i) {
- qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + 0.001, points[i].y() };
+ qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + 1/63., points[i].y() };
QVectorPath path(pts, 2, 0);
stroke(path, pen);
}
@@ -891,7 +891,7 @@ void QPaintEngineEx::drawPoints(const QPoint *points, int pointCount)
for (int i=0; i<count; ++i) {
pts[++oset] = points[i].x();
pts[++oset] = points[i].y();
- pts[++oset] = points[i].x() + 0.001;
+ pts[++oset] = points[i].x() + 1/63;
pts[++oset] = points[i].y();
}
QVectorPath path(pts, count * 2, qpaintengineex_line_types_16, QVectorPath::LinesHint);
@@ -901,7 +901,7 @@ void QPaintEngineEx::drawPoints(const QPoint *points, int pointCount)
}
} else {
for (int i=0; i<pointCount; ++i) {
- qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + 0.001, points[i].y() };
+ qreal pts[] = { points[i].x(), points[i].y(), points[i].x() +1/63., points[i].y() };
QVectorPath path(pts, 2, 0);
stroke(path, pen);
}
diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h
index be01549..43f548f 100644
--- a/src/gui/painting/qpainterpath_p.h
+++ b/src/gui/painting/qpainterpath_p.h
@@ -97,6 +97,7 @@ public:
flags(0)
{
int ptsPos = 0;
+ bool isLines = true;
for (int i=0; i<path.size(); ++i) {
const QPainterPath::Element &e = path.at(i);
elements[i] = e.type;
@@ -104,6 +105,11 @@ public:
points[ptsPos++] = e.y;
if (e.type == QPainterPath::CurveToElement)
flags |= QVectorPath::CurvedShapeMask;
+
+ // This is to check if the path contains only alternating lineTo/moveTo,
+ // in which case we can set the LinesHint in the path. MoveTo is 0 and
+ // LineTo is 1 so the i%2 gets us what we want cheaply.
+ isLines = isLines && e.type == (QPainterPath::ElementType) (i%2);
}
if (fillRule == Qt::WindingFill)
@@ -111,8 +117,14 @@ public:
else
flags |= QVectorPath::OddEvenFill;
- if (!convex)
- flags |= QVectorPath::NonConvexShapeMask;
+ if (isLines)
+ flags |= QVectorPath::LinesShapeMask;
+ else {
+ flags |= QVectorPath::AreaShapeMask;
+ if (!convex)
+ flags |= QVectorPath::NonConvexShapeMask;
+ }
+
}
QVarLengthArray<QPainterPath::ElementType> elements;
QVarLengthArray<qreal> points;
diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp
index 49dd47d..0f39b23 100644
--- a/src/gui/styles/qcleanlooksstyle.cpp
+++ b/src/gui/styles/qcleanlooksstyle.cpp
@@ -2069,7 +2069,7 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o
// This is mainly to handle cases where someone sets the font on the window
// and then the combo inherits it and passes it onward. At that point the resolve mask
// is very, very weak. This makes it stonger.
- font.setPointSizeF(menuItem->font.pointSizeF());
+ font.setPointSizeF(QFontInfo(menuItem->font).pointSizeF());
if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem)
font.setBold(true);
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index ecb7453..97d69b2 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -3996,7 +3996,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// This is mainly to handle cases where someone sets the font on the window
// and then the combo inherits it and passes it onward. At that point the resolve mask
// is very, very weak. This makes it stonger.
- myFont.setPointSizeF(mi->font.pointSizeF());
+ myFont.setPointSizeF(QFontInfo(mi->font).pointSizeF());
p->setFont(myFont);
p->drawText(xpos, yPos, contentRect.width() - xm - tabwidth + 1,
contentRect.height(), text_flags ^ Qt::AlignRight, s);
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 7adbacd..ca0b8c7 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -343,7 +343,8 @@ bool QS60StylePrivate::drawsOwnThemeBackground(const QWidget *widget)
}
QFont QS60StylePrivate::s60Font(
- QS60StyleEnums::FontCategories fontCategory, int pointSize) const
+ QS60StyleEnums::FontCategories fontCategory,
+ int pointSize, bool resolveFontSize) const
{
QFont result;
int actualPointSize = pointSize;
@@ -356,7 +357,7 @@ QFont QS60StylePrivate::s60Font(
Q_ASSERT(actualPointSize > 0);
const QPair<QS60StyleEnums::FontCategories, int> key(fontCategory, actualPointSize);
if (!m_mappedFontsCache.contains(key)) {
- result = s60Font_specific(fontCategory, actualPointSize);
+ result = s60Font_specific(fontCategory, actualPointSize, resolveFontSize);
m_mappedFontsCache.insert(key, result);
} else {
result = m_mappedFontsCache.value(key);
@@ -620,8 +621,10 @@ void QS60StylePrivate::setFont(QWidget *widget) const
fontCategory = QS60StyleEnums::FC_Title;
}
if (fontCategory != QS60StyleEnums::FC_Undefined) {
+ const bool resolveFontSize = widget->testAttribute(Qt::WA_SetFont)
+ && (widget->font().resolve() & QFont::SizeResolved);
const QFont suggestedFont =
- s60Font(fontCategory, widget->font().pointSizeF());
+ s60Font(fontCategory, widget->font().pointSizeF(), resolveFontSize);
widget->setFont(suggestedFont);
}
}
@@ -1363,7 +1366,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
}
}
- int rightValue = widget ? widget->contentsRect().right() : 0;
+ int rightValue = widget ? widget->contentsRect().right() : voptAdj.rect.right();
if (isScrollBarVisible)
rightValue -= scrollBarWidth;
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index 11137a4..1417552 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -401,7 +401,7 @@ public:
static bool drawsOwnThemeBackground(const QWidget *widget);
QFont s60Font(QS60StyleEnums::FontCategories fontCategory,
- int pointSize = -1) const;
+ int pointSize = -1, bool resolveFontSize = true) const;
// clears all style caches (fonts, colors, pixmaps)
void clearCaches(CacheClearReason reason = CC_UndefinedChange);
@@ -484,7 +484,8 @@ private:
static QPixmap part(QS60StyleEnums::SkinParts part, const QSize &size,
QPainter *painter, SkinElementFlags flags = KDefaultSkinElementFlags);
- static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize);
+ static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory,
+ int pointSize, bool resolveFontSize);
static QSize screenSize();
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 4767264..be61073 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -909,8 +909,11 @@ TAknsItemID QS60StyleModeSpecifics::partSpecificThemeId(int part)
}
QFont QS60StylePrivate::s60Font_specific(
- QS60StyleEnums::FontCategories fontCategory, int pointSize)
+ QS60StyleEnums::FontCategories fontCategory,
+ int pointSize, bool resolveFontSize)
{
+ Q_UNUSED(resolveFontSize);
+
TAknFontCategory aknFontCategory = EAknFontCategoryUndefined;
switch (fontCategory) {
case QS60StyleEnums::FC_Primary:
diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp
index 4499f06..bd43eb7 100644
--- a/src/gui/styles/qs60style_simulated.cpp
+++ b/src/gui/styles/qs60style_simulated.cpp
@@ -342,10 +342,13 @@ bool QS60StylePrivate::hasSliderGrooveGraphic()
return false;
}
-QFont QS60StylePrivate::s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize)
+QFont QS60StylePrivate::s60Font_specific(
+ QS60StyleEnums::FontCategories fontCategory,
+ int pointSize, bool resolveFontSize)
{
QFont result;
- result.setPointSize(pointSize);
+ if (resolveFontSize)
+ result.setPointSize(pointSize);
switch (fontCategory) {
case QS60StyleEnums::FC_Primary:
result.setBold(true);
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index d147ad7..4c57dff 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -1780,7 +1780,7 @@ Q_GLOBAL_STATIC(QFontSubst, globalFontSubst)
static void initFontSubst()
{
// default substitutions
- static const char *initTbl[] = {
+ static const char * const initTbl[] = {
#if defined(Q_WS_X11)
"arial", "helvetica",
@@ -1812,7 +1812,6 @@ static void initFontSubst()
}
}
-
/*!
Returns the first family name to be used whenever \a familyName is
specified. The lookup is case insensitive.
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp
index f8c2c37..4625667 100644
--- a/src/gui/text/qfontengine_s60.cpp
+++ b/src/gui/text/qfontengine_s60.cpp
@@ -45,12 +45,11 @@
#include <private/qapplication_p.h>
#include "qimage.h"
#include "qt_s60_p.h"
-#include "qpixmap_s60_p.h"
#include <e32base.h>
#include <e32std.h>
-#include <EIKENV.H>
-#include <GDI.H>
+#include <eikenv.h>
+#include <gdi.h>
QT_BEGIN_NAMESPACE
@@ -135,42 +134,21 @@ QFontEngineS60::QFontEngineS60(const QFontDef &request, const QFontEngineS60Exte
{
QFontEngine::fontDef = request;
m_fontSizeInPixels = (request.pixelSize >= 0)?
- request.pixelSize:pointsToPixels(request.pointSize);
-
- QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock);
-
- m_textRenderBitmap = q_check_ptr(new CFbsBitmap()); // CBase derived object needs check on new
- const TSize bitmapSize(1, 1); // It is just a dummy bitmap that I need to keep the font alive (or maybe not)
- qt_symbian_throwIfError(m_textRenderBitmap->Create(bitmapSize, EGray256));
- QT_TRAP_THROWING(m_textRenderBitmapDevice = CFbsBitmapDevice::NewL(m_textRenderBitmap));
- qt_symbian_throwIfError(m_textRenderBitmapDevice->CreateContext(m_textRenderBitmapGc));
- cache_cost = sizeof(QFontEngineS60) + bitmapSize.iHeight * bitmapSize.iWidth * 4;
+ request.pixelSize:pointsToPixels(request.pointSize);
TFontSpec fontSpec(qt_QString2TPtrC(request.family), m_fontSizeInPixels);
fontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
fontSpec.iFontStyle.SetPosture(request.style == QFont::StyleNormal?EPostureUpright:EPostureItalic);
fontSpec.iFontStyle.SetStrokeWeight(request.weight > QFont::Normal?EStrokeWeightBold:EStrokeWeightNormal);
- const TInt errorCode = m_textRenderBitmapDevice->GetNearestFontInPixels(m_font, fontSpec);
+ const TInt errorCode = S60->screenDevice()->GetNearestFontToDesignHeightInPixels(m_font, fontSpec);
Q_ASSERT(errorCode == 0);
- m_textRenderBitmapGc->UseFont(m_font);
-
- lock.relock();
+
+ cache_cost = sizeof(QFontEngineS60);
}
QFontEngineS60::~QFontEngineS60()
{
- QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock);
-
- m_textRenderBitmapGc->DiscardFont();
- delete m_textRenderBitmapGc;
- m_textRenderBitmapGc = NULL;
- m_textRenderBitmapDevice->ReleaseFont(m_font);
- delete m_textRenderBitmapDevice;
- m_textRenderBitmapDevice = NULL;
- delete m_textRenderBitmap;
- m_textRenderBitmap = NULL;
-
- lock.relock();
+ S60->screenDevice()->ReleaseFont(m_font);
}
bool QFontEngineS60::stringToCMap(const QChar *characters, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const
diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h
index dfe6bcd..ff819e2 100644
--- a/src/gui/text/qfontengine_s60_p.h
+++ b/src/gui/text/qfontengine_s60_p.h
@@ -126,9 +126,6 @@ private:
QFixed glyphAdvance(HB_Glyph glyph) const;
- CFbsBitmap *m_textRenderBitmap;
- CFbsBitmapDevice *m_textRenderBitmapDevice;
- CFbsBitGc *m_textRenderBitmapGc;
CFont* m_font;
const QFontEngineS60Extensions *m_extensions;
qreal m_fontSizeInPixels;
diff --git a/src/gui/widgets/qspinbox.cpp b/src/gui/widgets/qspinbox.cpp
index f00296c..726426d 100644
--- a/src/gui/widgets/qspinbox.cpp
+++ b/src/gui/widgets/qspinbox.cpp
@@ -99,6 +99,10 @@ public:
Q_Q(QDoubleSpinBox);
q->setInputMethodHints(Qt::ImhFormattedNumbersOnly);
}
+
+ // When fiddling with the decimals property, we may lose precision in these properties.
+ double actualMin;
+ double actualMax;
};
@@ -762,6 +766,7 @@ double QDoubleSpinBox::minimum() const
void QDoubleSpinBox::setMinimum(double minimum)
{
Q_D(QDoubleSpinBox);
+ d->actualMin = minimum;
const QVariant m(d->round(minimum));
d->setRange(m, (d->variantCompare(d->maximum, m) > 0 ? d->maximum : m));
}
@@ -792,6 +797,7 @@ double QDoubleSpinBox::maximum() const
void QDoubleSpinBox::setMaximum(double maximum)
{
Q_D(QDoubleSpinBox);
+ d->actualMax = maximum;
const QVariant m(d->round(maximum));
d->setRange((d->variantCompare(d->minimum, m) < 0 ? d->minimum : m), m);
}
@@ -813,6 +819,8 @@ void QDoubleSpinBox::setMaximum(double maximum)
void QDoubleSpinBox::setRange(double minimum, double maximum)
{
Q_D(QDoubleSpinBox);
+ d->actualMin = minimum;
+ d->actualMax = maximum;
d->setRange(QVariant(d->round(minimum)), QVariant(d->round(maximum)));
}
@@ -843,7 +851,7 @@ void QDoubleSpinBox::setDecimals(int decimals)
Q_D(QDoubleSpinBox);
d->decimals = qBound(0, decimals, DBL_MAX_10_EXP + DBL_DIG);
- setRange(minimum(), maximum()); // make sure values are rounded
+ setRange(d->actualMin, d->actualMax); // make sure values are rounded
setValue(value());
}
@@ -1051,8 +1059,10 @@ QVariant QSpinBoxPrivate::validateAndInterpret(QString &input, int &pos,
QDoubleSpinBoxPrivate::QDoubleSpinBoxPrivate()
{
- minimum = QVariant(0.0);
- maximum = QVariant(99.99);
+ actualMin = 0.0;
+ actualMax = 99.99;
+ minimum = QVariant(actualMin);
+ maximum = QVariant(actualMax);
value = minimum;
singleStep = QVariant(1.0);
decimals = 2;
diff --git a/src/multimedia/audio/qaudioinput.cpp b/src/multimedia/audio/qaudioinput.cpp
index 6fc4284..da39c4a 100644
--- a/src/multimedia/audio/qaudioinput.cpp
+++ b/src/multimedia/audio/qaudioinput.cpp
@@ -103,7 +103,7 @@ QT_BEGIN_NAMESPACE
audio = new QAudioInput(format, this);
QTimer::singleShot(3000, this, SLOT(stopRecording()));
- audio->start(outputFile);
+ audio->start(&outputFile);
// Records audio for 3000ms
}
\endcode
diff --git a/src/multimedia/audio/qaudiooutput.cpp b/src/multimedia/audio/qaudiooutput.cpp
index 613056c..b61aa4f 100644
--- a/src/multimedia/audio/qaudiooutput.cpp
+++ b/src/multimedia/audio/qaudiooutput.cpp
@@ -98,7 +98,7 @@ QT_BEGIN_NAMESPACE
audio = new QAudioOutput(format, this);
connect(audio,SIGNAL(stateChanged(QAudio::State)),SLOT(finishedPlaying(QAudio::State)));
- audio->start(inputFile);
+ audio->start(&inputFile);
\endcode
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 2c56524..20baac8 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -691,19 +691,31 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
channels[i].sendRequest();
}
}
+
+ // dequeue new ones
+
QAbstractSocket *socket = 0;
for (int i = 0; i < channelCount; ++i) {
QAbstractSocket *chSocket = channels[i].socket;
- // send the request using the idle socket
- if (!channels[i].isSocketBusy()) {
+ // try to get a free AND connected socket
+ if (!channels[i].isSocketBusy() && channels[i].socket->state() == QAbstractSocket::ConnectedState) {
socket = chSocket;
+ dequeueAndSendRequest(socket);
break;
}
}
- // this socket is free,
- if (socket)
- dequeueAndSendRequest(socket);
+ if (!socket) {
+ for (int i = 0; i < channelCount; ++i) {
+ QAbstractSocket *chSocket = channels[i].socket;
+ // try to get a free unconnected socket
+ if (!channels[i].isSocketBusy()) {
+ socket = chSocket;
+ dequeueAndSendRequest(socket);
+ break;
+ }
+ }
+ }
// try to push more into all sockets
// ### FIXME we should move this to the beginning of the function
@@ -731,6 +743,16 @@ void QHttpNetworkConnectionPrivate::_q_restartAuthPendingRequests()
}
}
+void QHttpNetworkConnectionPrivate::readMoreLater(QHttpNetworkReply *reply)
+{
+ for (int i = 0 ; i < channelCount; ++i) {
+ if (channels[i].reply == reply) {
+ // emulate a readyRead() from the socket
+ QMetaObject::invokeMethod(&channels[i], "_q_readyRead", Qt::QueuedConnection);
+ return;
+ }
+ }
+}
QHttpNetworkConnection::QHttpNetworkConnection(const QString &hostName, quint16 port, bool encrypt, QObject *parent)
: QObject(*(new QHttpNetworkConnectionPrivate(hostName, port, encrypt)), parent)
diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h
index 00eb1ef..76da883 100644
--- a/src/network/access/qhttpnetworkconnection_p.h
+++ b/src/network/access/qhttpnetworkconnection_p.h
@@ -174,6 +174,9 @@ public:
void fillPipeline(QAbstractSocket *socket);
bool fillPipeline(QList<HttpMessagePair> &queue, QHttpNetworkConnectionChannel &channel);
+ // read more HTTP body after the next event loop spin
+ void readMoreLater(QHttpNetworkReply *reply);
+
void copyCredentials(int fromChannel, QAuthenticator *auth, bool isProxy);
// private slots
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 7cf632f..39d09aa 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -326,43 +326,56 @@ void QHttpNetworkConnectionChannel::_q_receiveReply()
lastStatus = reply->d_func()->statusCode;
break;
}
- case QHttpNetworkReplyPrivate::ReadingHeaderState:
- bytes += reply->d_func()->readHeader(socket);
- if (reply->d_func()->state == QHttpNetworkReplyPrivate::ReadingDataState) {
- if (reply->d_func()->isGzipped() && reply->d_func()->autoDecompress) {
+ case QHttpNetworkReplyPrivate::ReadingHeaderState: {
+ QHttpNetworkReplyPrivate *replyPrivate = reply->d_func();
+ bytes += replyPrivate->readHeader(socket);
+ if (replyPrivate->state == QHttpNetworkReplyPrivate::ReadingDataState) {
+ if (replyPrivate->isGzipped() && replyPrivate->autoDecompress) {
// remove the Content-Length from header
- reply->d_func()->removeAutoDecompressHeader();
+ replyPrivate->removeAutoDecompressHeader();
} else {
- reply->d_func()->autoDecompress = false;
+ replyPrivate->autoDecompress = false;
}
- if (reply && reply->d_func()->statusCode == 100) {
- reply->d_func()->state = QHttpNetworkReplyPrivate::ReadingStatusState;
+ if (replyPrivate->statusCode == 100) {
+ replyPrivate->state = QHttpNetworkReplyPrivate::ReadingStatusState;
break; // ignore
}
- if (reply->d_func()->shouldEmitSignals())
+ if (replyPrivate->shouldEmitSignals())
emit reply->headerChanged();
- if (!reply->d_func()->expectContent()) {
- reply->d_func()->state = QHttpNetworkReplyPrivate::AllDoneState;
+ if (!replyPrivate->expectContent()) {
+ replyPrivate->state = QHttpNetworkReplyPrivate::AllDoneState;
this->state = QHttpNetworkConnectionChannel::IdleState;
allDone();
return;
}
}
break;
+ }
case QHttpNetworkReplyPrivate::ReadingDataState: {
- if (!reply->d_func()->isChunked() && !reply->d_func()->autoDecompress
- && reply->d_func()->bodyLength > 0) {
+ QHttpNetworkReplyPrivate *replyPrivate = reply->d_func();
+ if (replyPrivate->downstreamLimited && !replyPrivate->responseData.isEmpty() && replyPrivate->shouldEmitSignals()) {
+ // 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.
+ // We only do this when shouldEmitSignals==true because our HTTP parsing
+ // always needs to parse the 401/407 replies. Therefore they don't really obey
+ // to the read buffer maximum size, but we don't care since they should be small.
+ return;
+ }
+
+ if (!replyPrivate->isChunked() && !replyPrivate->autoDecompress
+ && replyPrivate->bodyLength > 0) {
// bulk files like images should fulfill these properties and
// we can therefore save on memory copying
- bytes = reply->d_func()->readBodyFast(socket, &reply->d_func()->responseData);
- reply->d_func()->totalProgress += bytes;
- if (reply->d_func()->shouldEmitSignals()) {
+ bytes = replyPrivate->readBodyFast(socket, &replyPrivate->responseData);
+ replyPrivate->totalProgress += bytes;
+ if (replyPrivate->shouldEmitSignals()) {
QPointer<QHttpNetworkReply> replyPointer = reply;
emit reply->readyRead();
// make sure that the reply is valid
if (replyPointer.isNull())
return;
- emit reply->dataReadProgress(reply->d_func()->totalProgress, reply->d_func()->bodyLength);
+ emit reply->dataReadProgress(replyPrivate->totalProgress, replyPrivate->bodyLength);
// make sure that the reply is valid
if (replyPointer.isNull())
return;
@@ -373,16 +386,16 @@ void QHttpNetworkConnectionChannel::_q_receiveReply()
// use the traditional slower reading (for compressed encoding, chunked encoding,
// no content-length etc)
QByteDataBuffer byteDatas;
- bytes = reply->d_func()->readBody(socket, &byteDatas);
+ bytes = replyPrivate->readBody(socket, &byteDatas);
if (bytes) {
- if (reply->d_func()->autoDecompress)
- reply->d_func()->appendCompressedReplyData(byteDatas);
+ if (replyPrivate->autoDecompress)
+ replyPrivate->appendCompressedReplyData(byteDatas);
else
- reply->d_func()->appendUncompressedReplyData(byteDatas);
+ replyPrivate->appendUncompressedReplyData(byteDatas);
- if (!reply->d_func()->autoDecompress) {
- reply->d_func()->totalProgress += bytes;
- if (reply->d_func()->shouldEmitSignals()) {
+ if (!replyPrivate->autoDecompress) {
+ replyPrivate->totalProgress += bytes;
+ if (replyPrivate->shouldEmitSignals()) {
QPointer<QHttpNetworkReply> replyPointer = reply;
// important: At the point of this readyRead(), the byteDatas list must be empty,
// else implicit sharing will trigger memcpy when the user is reading data!
@@ -390,7 +403,7 @@ void QHttpNetworkConnectionChannel::_q_receiveReply()
// make sure that the reply is valid
if (replyPointer.isNull())
return;
- emit reply->dataReadProgress(reply->d_func()->totalProgress, reply->d_func()->bodyLength);
+ emit reply->dataReadProgress(replyPrivate->totalProgress, replyPrivate->bodyLength);
// make sure that the reply is valid
if (replyPointer.isNull())
return;
@@ -403,7 +416,7 @@ void QHttpNetworkConnectionChannel::_q_receiveReply()
#endif
}
}
- if (reply->d_func()->state == QHttpNetworkReplyPrivate::ReadingDataState)
+ if (replyPrivate->state == QHttpNetworkReplyPrivate::ReadingDataState)
break;
// everything done, fall through
}
@@ -419,15 +432,24 @@ void QHttpNetworkConnectionChannel::_q_receiveReply()
bool QHttpNetworkConnectionChannel::ensureConnection()
{
+ QAbstractSocket::SocketState socketState = socket->state();
+
+ // resend this request after we receive the disconnected signal
+ if (socketState == QAbstractSocket::ClosingState) {
+ resendCurrent = true;
+ return false;
+ }
+
+ // already trying to connect?
+ if (socketState == QAbstractSocket::HostLookupState ||
+ socketState == QAbstractSocket::ConnectingState) {
+ return false;
+ }
+
// make sure that this socket is in a connected state, if not initiate
// connection to the host.
- if (socket->state() != QAbstractSocket::ConnectedState) {
+ if (socketState != QAbstractSocket::ConnectedState) {
// connect to the host if not already connected.
- // resend this request after we receive the disconnected signal
- if (socket->state() == QAbstractSocket::ClosingState) {
- resendCurrent = true;
- return false;
- }
state = QHttpNetworkConnectionChannel::ConnectingState;
pendingEncrypt = connection->d_func()->encrypt;
@@ -618,10 +640,17 @@ void QHttpNetworkConnectionChannel::requeueCurrentlyPipelinedRequests()
void QHttpNetworkConnectionChannel::eatWhitespace()
{
char c;
- while (socket->bytesAvailable()) {
- if (socket->peek(&c, 1) != 1)
+ do {
+ qint64 ret = socket->peek(&c, 1);
+
+ // nothing read, fine.
+ if (ret == 0)
return;
+ // EOF from socket?
+ if (ret == -1)
+ return; // FIXME, we need to stop processing. however the next stuff done will also do that.
+
// read all whitespace and line endings
if (c == 11 || c == '\n' || c == '\r' || c == ' ' || c == 31) {
socket->read(&c, 1);
@@ -629,7 +658,7 @@ void QHttpNetworkConnectionChannel::eatWhitespace()
} else {
break;
}
- }
+ } while(true);
}
void QHttpNetworkConnectionChannel::handleStatus()
diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp
index 7025f1d..a5223d1 100644
--- a/src/network/access/qhttpnetworkreply.cpp
+++ b/src/network/access/qhttpnetworkreply.cpp
@@ -179,9 +179,19 @@ qint64 QHttpNetworkReply::bytesAvailableNextBlock() const
QByteArray QHttpNetworkReply::readAny()
{
Q_D(QHttpNetworkReply);
+ // we'll take the last buffer, so schedule another read from http
+ if (d->downstreamLimited && d->responseData.bufferCount() == 1)
+ d->connection->d_func()->readMoreLater(this);
return d->responseData.read();
}
+void QHttpNetworkReply::setDownstreamLimited(bool dsl)
+{
+ Q_D(QHttpNetworkReply);
+ d->downstreamLimited = dsl;
+ d->connection->d_func()->readMoreLater(this);
+}
+
bool QHttpNetworkReply::isFinished() const
{
return d_func()->state == QHttpNetworkReplyPrivate::AllDoneState;
@@ -201,7 +211,7 @@ QHttpNetworkReplyPrivate::QHttpNetworkReplyPrivate(const QUrl &newUrl)
forceConnectionCloseEnabled(false),
currentChunkSize(0), currentChunkRead(0), connection(0), initInflate(false),
autoDecompress(false), responseData(), requestIsPrepared(false)
- ,pipeliningUsed(false)
+ ,pipeliningUsed(false), downstreamLimited(false)
{
}
diff --git a/src/network/access/qhttpnetworkreply_p.h b/src/network/access/qhttpnetworkreply_p.h
index a8b4a79..af9266b 100644
--- a/src/network/access/qhttpnetworkreply_p.h
+++ b/src/network/access/qhttpnetworkreply_p.h
@@ -125,6 +125,7 @@ public:
qint64 bytesAvailable() const;
qint64 bytesAvailableNextBlock() const;
QByteArray readAny();
+ void setDownstreamLimited(bool t);
bool isFinished() const;
@@ -229,6 +230,7 @@ public:
bool requestIsPrepared;
bool pipeliningUsed;
+ bool downstreamLimited;
};
diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp
index de947e8..8ac64d2 100644
--- a/src/network/access/qnetworkaccessbackend.cpp
+++ b/src/network/access/qnetworkaccessbackend.cpp
@@ -161,6 +161,12 @@ void QNetworkAccessBackend::downstreamReadyWrite()
// do nothing
}
+void QNetworkAccessBackend::setDownstreamLimited(bool b)
+{
+ Q_UNUSED(b);
+ // do nothing
+}
+
void QNetworkAccessBackend::copyFinished(QIODevice *)
{
// do nothing
diff --git a/src/network/access/qnetworkaccessbackend_p.h b/src/network/access/qnetworkaccessbackend_p.h
index 30ef5b3..43d993c 100644
--- a/src/network/access/qnetworkaccessbackend_p.h
+++ b/src/network/access/qnetworkaccessbackend_p.h
@@ -116,6 +116,7 @@ public:
// slot-like:
virtual void downstreamReadyWrite();
+ virtual void setDownstreamLimited(bool b);
virtual void copyFinished(QIODevice *);
virtual void ignoreSslErrors();
virtual void ignoreSslErrors(const QList<QSslError> &errors);
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index ada00df..58123b2 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -144,7 +144,7 @@ static QHash<QByteArray, QByteArray> parseHttpOptionHeader(const QByteArray &hea
QByteArray key = QByteArray(header.constData() + pos, end - pos).trimmed().toLower();
pos = end + 1;
- if (equal != -1) {
+ if (uint(equal) < uint(comma)) {
// case: token "=" (token | quoted-string)
// skip spaces
pos = nextNonWhitespace(header, pos);
@@ -596,7 +596,7 @@ void QNetworkAccessHttpBackend::open()
// unsuitable proxies
QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection,
Q_ARG(QNetworkReply::NetworkError, QNetworkReply::ProxyNotFoundError),
- Q_ARG(QString, QCoreApplication::translate("QNetworkAccessHttpBackend", "No suitable proxy found")));
+ Q_ARG(QString, tr("No suitable proxy found")));
QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
return;
}
@@ -657,6 +657,12 @@ void QNetworkAccessHttpBackend::downstreamReadyWrite()
replyFinished();
}
+void QNetworkAccessHttpBackend::setDownstreamLimited(bool b)
+{
+ if (httpReply)
+ httpReply->setDownstreamLimited(b);
+}
+
void QNetworkAccessHttpBackend::replyReadyRead()
{
readFromHttp();
diff --git a/src/network/access/qnetworkaccesshttpbackend_p.h b/src/network/access/qnetworkaccesshttpbackend_p.h
index 705323d..0eaf003 100644
--- a/src/network/access/qnetworkaccesshttpbackend_p.h
+++ b/src/network/access/qnetworkaccesshttpbackend_p.h
@@ -82,6 +82,8 @@ public:
virtual bool waitForDownstreamReadyRead(int msecs);
virtual void downstreamReadyWrite();
+ virtual void setDownstreamLimited(bool b);
+
virtual void copyFinished(QIODevice *);
#ifndef QT_NO_OPENSSL
virtual void ignoreSslErrors();
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index 285864d..59c7d76 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -652,6 +652,9 @@ void QNetworkReplyImpl::setReadBufferSize(qint64 size)
d->backendNotify(QNetworkReplyImplPrivate::NotifyDownstreamReadyWrite);
QNetworkReply::setReadBufferSize(size);
+
+ if (d->backend)
+ d->backend->setDownstreamLimited(d->readBufferMaxSize > 0);
}
#ifndef QT_NO_OPENSSL
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index 5615685..8e22664 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -83,9 +83,6 @@ public:
QList<QSslError> ignoreErrorsList;
bool* readyReadEmittedPointer;
- QRingBuffer readBuffer;
- QRingBuffer writeBuffer;
-
QSslConfigurationPrivate configuration;
QList<QSslError> sslErrors;
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 6b65886..caa679b 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -580,19 +580,19 @@ void QGL2PaintEngineExPrivate::transferMode(EngineMode newMode)
}
if (newMode == TextDrawingMode) {
- glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray.data());
- glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray.data());
+ setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, (GLfloat*)vertexCoordinateArray.data());
+ setVertexAttributePointer(QT_TEXTURE_COORDS_ATTR, (GLfloat*)textureCoordinateArray.data());
}
if (newMode == ImageDrawingMode) {
- glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, staticVertexCoordinateArray);
- glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, staticTextureCoordinateArray);
+ setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, staticVertexCoordinateArray);
+ setVertexAttributePointer(QT_TEXTURE_COORDS_ATTR, staticTextureCoordinateArray);
}
if (newMode == ImageArrayDrawingMode) {
- glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray.data());
- glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray.data());
- glVertexAttribPointer(QT_OPACITY_ATTR, 1, GL_FLOAT, GL_FALSE, 0, opacityArray.data());
+ setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, (GLfloat*)vertexCoordinateArray.data());
+ setVertexAttributePointer(QT_TEXTURE_COORDS_ATTR, (GLfloat*)textureCoordinateArray.data());
+ setVertexAttributePointer(QT_OPACITY_ATTR, (GLfloat*)opacityArray.data());
}
// This needs to change when we implement high-quality anti-aliasing...
@@ -707,9 +707,9 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path)
prepareForDraw(currentBrush.isOpaque());
#ifdef QT_OPENGL_CACHE_AS_VBOS
glBindBuffer(GL_ARRAY_BUFFER, cache->vbo);
- glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, false, 0, 0);
+ setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, 0);
#else
- glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, false, 0, cache->vertices);
+ setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, cache->vertices);
#endif
glDrawArrays(cache->primitiveType, 0, cache->vertexCount);
@@ -829,7 +829,7 @@ void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(const float *data,
glStencilMask(GL_STENCIL_HIGH_BIT);
#if 0
glStencilOp(GL_KEEP, GL_KEEP, GL_INVERT); // Simply invert the stencil bit
- glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, data);
+ setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, data);
glDrawArrays(GL_TRIANGLE_STRIP, 0, count);
#else
@@ -840,7 +840,7 @@ void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(const float *data,
} else {
glStencilFunc(GL_ALWAYS, GL_STENCIL_HIGH_BIT, 0xff);
}
- glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, data);
+ setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, data);
glDrawArrays(GL_TRIANGLE_STRIP, 0, count);
#endif
}
@@ -954,15 +954,8 @@ bool QGL2PaintEngineExPrivate::prepareForDraw(bool srcPixelsAreOpaque)
void QGL2PaintEngineExPrivate::composite(const QGLRect& boundingRect)
{
- // Setup a vertex array for the bounding rect:
- GLfloat rectVerts[] = {
- boundingRect.left, boundingRect.top,
- boundingRect.left, boundingRect.bottom,
- boundingRect.right, boundingRect.bottom,
- boundingRect.right, boundingRect.top
- };
-
- glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, rectVerts);
+ setCoords(staticVertexCoordinateArray, boundingRect);
+ setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, staticVertexCoordinateArray);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
@@ -971,7 +964,7 @@ void QGL2PaintEngineExPrivate::drawVertexArrays(const float *data, int *stops, i
GLenum primitive)
{
// Now setup the pointer to the vertex array:
- glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, data);
+ setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, (GLfloat*)data);
int previousStop = 0;
for (int i=0; i<stopCount; ++i) {
@@ -1070,7 +1063,7 @@ void QGL2PaintEngineExPrivate::stroke(const QVectorPath &path, const QPen &pen)
if (opaque) {
prepareForDraw(opaque);
- glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, false, 0, stroker.vertices());
+ setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, stroker.vertices());
glDrawArrays(GL_TRIANGLE_STRIP, 0, stroker.vertexCount() / 2);
// QBrush b(Qt::green);
@@ -1291,9 +1284,6 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, QFontEngineGly
GLfloat dx = 1.0 / cache->width();
GLfloat dy = 1.0 / cache->height();
- QGLPoint *oldVertexCoordinateDataPtr = vertexCoordinateArray.data();
- QGLPoint *oldTextureCoordinateDataPtr = textureCoordinateArray.data();
-
vertexCoordinateArray.clear();
textureCoordinateArray.clear();
@@ -1306,10 +1296,8 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, QFontEngineGly
textureCoordinateArray.addRect(QRectF(c.x*dx, c.y*dy, c.w * dx, c.h * dy));
}
- if (vertexCoordinateArray.data() != oldVertexCoordinateDataPtr)
- glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray.data());
- if (textureCoordinateArray.data() != oldTextureCoordinateDataPtr)
- glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray.data());
+ setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, (GLfloat*)vertexCoordinateArray.data());
+ setVertexAttributePointer(QT_TEXTURE_COORDS_ATTR, (GLfloat*)textureCoordinateArray.data());
if (addOffset) {
addOffset = false;
@@ -1640,6 +1628,8 @@ void QGL2PaintEngineEx::ensureActive()
d->needsSync = false;
d->shaderManager->setDirty();
d->ctx->d_func()->syncGlState();
+ for (int i = 0; i < 3; ++i)
+ d->vertexAttribPointers[i] = (GLfloat*)-1; // Assume the pointers are clobbered
setState(state());
}
}
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 37bae6f..ce1b538 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -196,6 +196,9 @@ public:
void drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints hints);
void drawCachedGlyphs(const QPointF &p, QFontEngineGlyphCache::Type glyphType, const QTextItemInt &ti);
+ // Calls glVertexAttributePointer if the pointer has changed
+ inline void setVertexAttributePointer(unsigned int arrayIndex, const GLfloat *pointer);
+
// draws whatever is in the vertex array:
void drawVertexArrays(const float *data, int *stops, int stopCount, GLenum primitive);
void drawVertexArrays(QGL2PEXVertexArray &vertexArray, GLenum primitive) {
@@ -230,6 +233,7 @@ public:
void regenerateClip();
void systemStateChanged();
+
static QGLEngineShaderManager* shaderManagerForEngine(QGL2PaintEngineEx *engine) { return engine->d_func()->shaderManager; }
static QGL2PaintEngineExPrivate *getData(QGL2PaintEngineEx *engine) { return engine->d_func(); }
static void cleanupVectorPath(QPaintEngineEx *engine, void *data);
@@ -291,8 +295,24 @@ public:
QSet<QVectorPath::CacheEntry *> pathCaches;
QVector<GLuint> unusedVBOSToClean;
+
+ const GLfloat *vertexAttribPointers[3];
};
+
+void QGL2PaintEngineExPrivate::setVertexAttributePointer(unsigned int arrayIndex, const GLfloat *pointer)
+{
+ Q_ASSERT(arrayIndex < 3);
+ if (pointer == vertexAttribPointers[arrayIndex])
+ return;
+
+ vertexAttribPointers[arrayIndex] = pointer;
+ if (arrayIndex == QT_OPACITY_ATTR)
+ glVertexAttribPointer(arrayIndex, 1, GL_FLOAT, GL_FALSE, 0, pointer);
+ else
+ glVertexAttribPointer(arrayIndex, 2, GL_FLOAT, GL_FALSE, 0, pointer);
+}
+
QT_END_NAMESPACE
#endif
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index 047876f..0720170 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -81,7 +81,7 @@ void QGLTextureGlyphCache::createTextureData(int width, int height)
data[i] = 0;
if (m_type == QFontEngineGlyphCache::Raster_RGBMask)
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, &data[0]);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, &data[0]);
else
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, &data[0]);
@@ -127,11 +127,28 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height)
glViewport(0, 0, oldWidth, oldHeight);
- float vertexCoordinateArray[] = { -1, -1, 1, -1, 1, 1, -1, 1 };
- float textureCoordinateArray[] = { 0, 0, 1, 0, 1, 1, 0, 1 };
-
- glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray);
- glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray);
+ GLfloat* vertexCoordinateArray = pex->staticVertexCoordinateArray;
+ vertexCoordinateArray[0] = -1.0f;
+ vertexCoordinateArray[1] = -1.0f;
+ vertexCoordinateArray[2] = 1.0f;
+ vertexCoordinateArray[3] = -1.0f;
+ vertexCoordinateArray[4] = 1.0f;
+ vertexCoordinateArray[5] = 1.0f;
+ vertexCoordinateArray[6] = -1.0f;
+ vertexCoordinateArray[7] = 1.0f;
+
+ GLfloat* textureCoordinateArray = pex->staticTextureCoordinateArray;
+ textureCoordinateArray[0] = 0.0f;
+ textureCoordinateArray[1] = 0.0f;
+ textureCoordinateArray[2] = 1.0f;
+ textureCoordinateArray[3] = 0.0f;
+ textureCoordinateArray[4] = 1.0f;
+ textureCoordinateArray[5] = 1.0f;
+ textureCoordinateArray[6] = 0.0f;
+ textureCoordinateArray[7] = 1.0f;
+
+ pex->setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, vertexCoordinateArray);
+ pex->setVertexAttributePointer(QT_TEXTURE_COORDS_ATTR, textureCoordinateArray);
pex->shaderManager->useBlitProgram();
pex->shaderManager->blitProgram()->setUniformValue("imageTexture", QT_IMAGE_TEXTURE_UNIT);
@@ -179,8 +196,20 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph)
for (int x = 0; x < maskWidth; ++x)
src[x] = -src[x]; // convert 0 and 1 into 0 and 255
}
- }
-
+ } else if (mask.format() == QImage::Format_RGB32) {
+ // Make the alpha component equal to the average of the RGB values.
+ // This is needed when drawing sub-pixel antialiased text on translucent targets.
+ for (int y = 0; y < maskHeight; ++y) {
+ quint32 *src = (quint32 *) mask.scanLine(y);
+ for (int x = 0; x < maskWidth; ++x) {
+ uchar r = src[x] >> 16;
+ uchar g = src[x] >> 8;
+ uchar b = src[x];
+ quint32 avg = (quint32(r) + quint32(g) + quint32(b) + 1) / 3; // "+1" for rounding.
+ src[x] = (src[x] & 0x00ffffff) | (avg << 24);
+ }
+ }
+ }
glBindTexture(GL_TEXTURE_2D, m_texture);
if (mask.format() == QImage::Format_RGB32) {
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 547b33e..a262ded 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1555,7 +1555,7 @@ QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include
QImage qt_gl_read_texture(const QSize &size, bool alpha_format, bool include_alpha)
{
- QImage img(size, alpha_format ? QImage::Format_ARGB32 : QImage::Format_RGB32);
+ QImage img(size, alpha_format ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32);
int w = size.width();
int h = size.height();
#if !defined(QT_OPENGL_ES_2) && !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index cc58c09..c823187 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -4931,7 +4931,8 @@ void QOpenGLPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- bool antialias = !(ti.fontEngine->fontDef.styleStrategy & QFont::NoAntialias);
+ bool antialias = !(ti.fontEngine->fontDef.styleStrategy & QFont::NoAntialias)
+ && (d->matrix.type() > QTransform::TxTranslate);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, antialias ? GL_LINEAR : GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, antialias ? GL_LINEAR : GL_NEAREST);
diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro
index 854f893..cfaca9d 100644
--- a/src/plugins/phonon/mmf/mmf.pro
+++ b/src/plugins/phonon/mmf/mmf.pro
@@ -35,9 +35,13 @@ HEADERS += \
$$PHONON_MMF_DIR/defs.h \
$$PHONON_MMF_DIR/dummyplayer.h \
$$PHONON_MMF_DIR/effectfactory.h \
+ $$PHONON_MMF_DIR/effectparameter.h \
+ $$PHONON_MMF_DIR/environmentalreverb.h \
+ $$PHONON_MMF_DIR/loudness.h \
$$PHONON_MMF_DIR/mediaobject.h \
$$PHONON_MMF_DIR/mmf_medianode.h \
$$PHONON_MMF_DIR/mmf_videoplayer.h \
+ $$PHONON_MMF_DIR/stereowidening.h \
$$PHONON_MMF_DIR/objectdump.h \
$$PHONON_MMF_DIR/objectdump_symbian.h \
$$PHONON_MMF_DIR/objecttree.h \
@@ -57,9 +61,13 @@ SOURCES += \
$$PHONON_MMF_DIR/bassboost.cpp \
$$PHONON_MMF_DIR/dummyplayer.cpp \
$$PHONON_MMF_DIR/effectfactory.cpp \
+ $$PHONON_MMF_DIR/effectparameter.cpp \
+ $$PHONON_MMF_DIR/environmentalreverb.cpp \
+ $$PHONON_MMF_DIR/loudness.cpp \
$$PHONON_MMF_DIR/mediaobject.cpp \
$$PHONON_MMF_DIR/mmf_medianode.cpp \
$$PHONON_MMF_DIR/mmf_videoplayer.cpp \
+ $$PHONON_MMF_DIR/stereowidening.cpp \
$$PHONON_MMF_DIR/objectdump.cpp \
$$PHONON_MMF_DIR/objectdump_symbian.cpp \
$$PHONON_MMF_DIR/objecttree.cpp \
@@ -81,6 +89,7 @@ LIBS += -lws32 # For RWindow
LIBS += -lefsrv # For file server
LIBS += -lapgrfx -lapmime # For recognizer
LIBS += -lmmfcontrollerframework # For CMMFMetaDataEntry
+LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream
# These are for effects.
LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index eb35419..bbc758b 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -36,7 +36,7 @@ symbian: {
sqlitedeployment = \
"; Deploy sqlite onto phone that does not have it already" \
- "@\"sqlite3.sis\", (0x2002af5f)"
+ "@\"$$PWD/sqlite3.sis\", (0x2002af5f)"
qtlibraries.pkg_postrules += sqlitedeployment
qtlibraries.path = c:/sys/bin
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index 0866053..1db2e1b 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -54,6 +54,7 @@
#include "bridge/qscriptvariant_p.h"
#include "bridge/qscriptqobject_p.h"
#include "bridge/qscriptdeclarativeclass_p.h"
+#include "bridge/qscriptdeclarativeobject_p.h"
/*!
\since 4.3
@@ -1570,9 +1571,10 @@ QObject *QScriptValue::toQObject() const
Q_D(const QScriptValue);
if (isQObject()) {
QScriptObject *object = static_cast<QScriptObject*>(JSC::asObject(d->jscValue));
- return static_cast<QScript::QObjectDelegate*>(object->delegate())->value();
- } else if (QScriptDeclarativeClass *dc = QScriptDeclarativeClass::scriptClass(*this)) {
- return dc->toQObject(QScriptDeclarativeClass::object(*this));
+ QScriptObjectDelegate *delegate = object->delegate();
+ if (delegate->type() == QScriptObjectDelegate::DeclarativeClassObject)
+ return static_cast<QScript::DeclarativeObjectDelegate*>(delegate)->scriptClass()->toQObject(QScriptDeclarativeClass::object(*this));
+ return static_cast<QScript::QObjectDelegate*>(delegate)->value();
} else if (isVariant()) {
QVariant var = toVariant();
int type = var.userType();
@@ -2245,7 +2247,9 @@ bool QScriptValue::isQObject() const
return false;
QScriptObject *object = static_cast<QScriptObject*>(JSC::asObject(d->jscValue));
QScriptObjectDelegate *delegate = object->delegate();
- return (delegate && (delegate->type() == QScriptObjectDelegate::QtObject));
+ return (delegate && (delegate->type() == QScriptObjectDelegate::QtObject ||
+ (delegate->type() == QScriptObjectDelegate::DeclarativeClassObject &&
+ static_cast<QScript::DeclarativeObjectDelegate*>(delegate)->scriptClass()->isQObject())));
}
/*!
diff --git a/src/script/bridge/qscriptdeclarativeclass.cpp b/src/script/bridge/qscriptdeclarativeclass.cpp
index eae5a0a..24037e1 100644
--- a/src/script/bridge/qscriptdeclarativeclass.cpp
+++ b/src/script/bridge/qscriptdeclarativeclass.cpp
@@ -319,6 +319,11 @@ QStringList QScriptDeclarativeClass::propertyNames(Object *object)
return QStringList();
}
+bool QScriptDeclarativeClass::isQObject() const
+{
+ return false;
+}
+
QObject *QScriptDeclarativeClass::toQObject(Object *, bool *ok)
{
if (ok) *ok = false;
diff --git a/src/script/bridge/qscriptdeclarativeclass_p.h b/src/script/bridge/qscriptdeclarativeclass_p.h
index 255e5b3..d28a371 100644
--- a/src/script/bridge/qscriptdeclarativeclass_p.h
+++ b/src/script/bridge/qscriptdeclarativeclass_p.h
@@ -97,6 +97,7 @@ public:
virtual QStringList propertyNames(Object *);
+ virtual bool isQObject() const;
virtual QObject *toQObject(Object *, bool *ok = 0);
virtual QVariant toVariant(Object *, bool *ok = 0);
diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.cpp b/src/sql/drivers/sqlite2/qsql_sqlite2.cpp
index fe61358..ea476e5 100644
--- a/src/sql/drivers/sqlite2/qsql_sqlite2.cpp
+++ b/src/sql/drivers/sqlite2/qsql_sqlite2.cpp
@@ -110,10 +110,11 @@ public:
const char *currentTail;
sqlite_vm *currentMachine;
- uint skippedStatus: 1; // the status of the fetchNext() that's skipped
- uint skipRow: 1; // skip the next fetchNext()?
- uint utf8: 1;
+ bool skippedStatus; // the status of the fetchNext() that's skipped
+ bool skipRow; // skip the next fetchNext()?
+ bool utf8;
QSqlRecord rInf;
+ QVector<QVariant> firstRow;
};
static const uint initial_cache_size = 128;
@@ -192,6 +193,8 @@ bool QSQLite2ResultPrivate::fetchNext(QSqlCachedResult::ValueCache &values, int
// already fetched
Q_ASSERT(!initialFetch);
skipRow = false;
+ for(int i=0;i<firstRow.count(); i++)
+ values[i] = firstRow[i];
return skippedStatus;
}
skipRow = initialFetch;
@@ -209,6 +212,11 @@ bool QSQLite2ResultPrivate::fetchNext(QSqlCachedResult::ValueCache &values, int
#endif
}
+ if(initialFetch) {
+ firstRow.clear();
+ firstRow.resize(colNum);
+ }
+
switch(res) {
case SQLITE_ROW:
// check to see if should fill out columns
@@ -299,7 +307,7 @@ bool QSQLite2Result::reset (const QString& query)
}
// we have to fetch one row to find out about
// the structure of the result set
- d->skippedStatus = d->fetchNext(cache(), 0, true);
+ d->skippedStatus = d->fetchNext(d->firstRow, 0, true);
if (lastError().isValid()) {
setSelect(false);
setActive(false);