diff options
32 files changed, 239 insertions, 147 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index 544762a..6356c21 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -369,6 +369,13 @@ void MMF::AbstractMediaPlayer::playbackComplete(int error) { stopTimers(); + if (KErrNone == error && !m_aboutToFinishSent) { + const qint64 total = totalTime(); + emit MMF::AbstractPlayer::tick(total); + m_aboutToFinishSent = true; + emit aboutToFinish(); + } + if (KErrNone == error) { changeState(StoppedState); @@ -393,15 +400,13 @@ qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds void MMF::AbstractMediaPlayer::positionTick() { - emitMarksIfReached(); - const qint64 current = currentTime(); + emitMarksIfReached(current); emit MMF::AbstractPlayer::tick(current); } -void MMF::AbstractMediaPlayer::emitMarksIfReached() +void MMF::AbstractMediaPlayer::emitMarksIfReached(qint64 current) { - const qint64 current = currentTime(); const qint64 total = totalTime(); const qint64 remaining = total - current; diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h index abd6bff..308b5af 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h @@ -91,7 +91,7 @@ private: void stopBufferStatusTimer(); void stopTimers(); void doVolumeChanged(); - void emitMarksIfReached(); + void emitMarksIfReached(qint64 position); void resetMarksIfRewound(); private Q_SLOTS: diff --git a/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp b/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp index 226d079..d607f1d 100644 --- a/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp +++ b/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp @@ -217,7 +217,7 @@ void getDsaRegion(RWsSession &session, const RWindowBase &window) void MMF::DsaVideoPlayer::handleParametersChanged(VideoParameters parameters) { TRACE_CONTEXT(DsaVideoPlayer::handleParametersChanged, EVideoInternal); - TRACE_ENTRY("parameters 0x%x", parameters); + TRACE_ENTRY("parameters 0x%x", parameters.operator int()); if (!m_window) return; diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 4de7ad8..45608c5 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 - ecfa4583e573ce4dff1f0df12f6bdba3022376e5 + e3dc4ef2b801d91e115c54f833fa7766d392ceda diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 2bd506b..a2bd5c3 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,17 @@ +2009-11-15 Dave Tapuska <dtapuska@rim.com> + + Reviewed by George Staikos. + + Compare UChars single unit at a time as opposed to the uint32_t + approach as casting to unaligned addresses may cause a bus failure + on ARMv5 and below. This change replicates the same defines that + exists in AtomicString.cpp + + https://bugs.webkit.org/show_bug.cgi?id=31475 + + * platform/text/StringHash.h: + (WebCore::StringHash::equal): + 2010-03-25 yael aharon <yael.aharon@nokia.com> Reviewed by Laszlo Gombos. diff --git a/src/3rdparty/webkit/WebCore/platform/text/StringHash.h b/src/3rdparty/webkit/WebCore/platform/text/StringHash.h index 336dce3..5d01ea8 100644 --- a/src/3rdparty/webkit/WebCore/platform/text/StringHash.h +++ b/src/3rdparty/webkit/WebCore/platform/text/StringHash.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved + * Copyright (C) Research In Motion Limited 2009. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -47,6 +48,16 @@ namespace WebCore { if (aLength != bLength) return false; +#if PLATFORM(ARM) || PLATFORM(SH4) + const UChar* aChars = a->characters(); + const UChar* bChars = b->characters(); + for (unsigned i = 0; i != aLength; ++i) { + if (*aChars++ != *bChars++) + return false; + } + return true; +#else + /* Do it 4-bytes-at-a-time on architectures where it's safe */ const uint32_t* aChars = reinterpret_cast<const uint32_t*>(a->characters()); const uint32_t* bChars = reinterpret_cast<const uint32_t*>(b->characters()); @@ -59,6 +70,7 @@ namespace WebCore { return false; return true; +#endif } static unsigned hash(const RefPtr<StringImpl>& key) { return key->hash(); } diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp index f321ab3..5dbd1f0 100644 --- a/src/gui/itemviews/qfileiconprovider.cpp +++ b/src/gui/itemviews/qfileiconprovider.cpp @@ -254,7 +254,9 @@ QIcon QFileIconProviderPrivate::getWinIcon(const QFileInfo &fileInfo) const val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(), 0, &info, sizeof(SHFILEINFO), SHGFI_SMALLICON|SHGFI_SYSICONINDEX); #endif - if (val) { + + // Even if GetFileInfo returns a valid result, hIcon can be empty in some cases + if (val && info.hIcon) { if (fileInfo.isDir() && !fileInfo.isRoot()) { //using the unique icon index provided by windows save us from duplicate keys key = QString::fromLatin1("qt_dir_%1").arg(info.iIcon); @@ -293,7 +295,7 @@ QIcon QFileIconProviderPrivate::getWinIcon(const QFileInfo &fileInfo) const val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(), 0, &info, sizeof(SHFILEINFO), SHGFI_LARGEICON|SHGFI_SYSICONINDEX); #endif - if (val) { + if (val && info.hIcon) { if (fileInfo.isDir() && !fileInfo.isRoot()) { //using the unique icon index provided by windows save us from duplicate keys key = QString::fromLatin1("qt_dir_%1").arg(info.iIcon); diff --git a/src/gui/kernel/qgridlayout.cpp b/src/gui/kernel/qgridlayout.cpp index dbd3c01..81a4d04 100644 --- a/src/gui/kernel/qgridlayout.cpp +++ b/src/gui/kernel/qgridlayout.cpp @@ -1852,7 +1852,7 @@ void QGridLayout::invalidate() /*! \fn int QGridLayout::colSpacing(int col) const - Use columnSpacing() instead. + Use columnMinimumWidth() instead. */ /*! diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 923144a..23f1481 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -242,6 +242,7 @@ bool QSoftKeyManager::handleUpdateSoftKeys() d->requestedSoftKeyActions.clear(); bool recursiveMerging = false; QWidget *source = softkeySource(NULL, recursiveMerging); + d->initialSoftKeySource = source; while (source) { if (appendSoftkeys(*source, level)) ++level; diff --git a/src/gui/kernel/qsoftkeymanager_common_p.h b/src/gui/kernel/qsoftkeymanager_common_p.h index 460d0dc..04ddf7d 100644 --- a/src/gui/kernel/qsoftkeymanager_common_p.h +++ b/src/gui/kernel/qsoftkeymanager_common_p.h @@ -70,6 +70,7 @@ protected: static QSoftKeyManager *self; QHash<QAction*, Qt::Key> keyedActions; QMultiHash<int, QAction*> requestedSoftKeyActions; + QWidget *initialSoftKeySource; }; @@ -79,4 +80,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QSOFTKEYMANAGER_COMMON_P_H
\ No newline at end of file +#endif // QSOFTKEYMANAGER_COMMON_P_H diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index 9812d72..7d643c2 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -312,17 +312,8 @@ bool QSoftKeyManagerPrivateS60::setMiddleSoftkey(CEikButtonGroupContainer &cba) bool QSoftKeyManagerPrivateS60::setRightSoftkey(CEikButtonGroupContainer &cba) { if (!setSoftkey(cba, QAction::NegativeSoftKey, RSK_POSITION)) { - Qt::WindowType windowType = Qt::Window; - QAction *action = requestedSoftKeyActions.value(0); - if (action) { - QWidget *actionParent = action->parentWidget(); - Q_ASSERT_X(actionParent, Q_FUNC_INFO, "No parent set for softkey action!"); - - QWidget *actionWindow = actionParent->window(); - Q_ASSERT_X(actionWindow, Q_FUNC_INFO, "Softkey action does not have window!"); - windowType = actionWindow->windowType(); - } - + const Qt::WindowType windowType = initialSoftKeySource + ? initialSoftKeySource->window()->windowType() : Qt::Window; if (windowType != Qt::Dialog && windowType != Qt::Popup) { QString text(QSoftKeyManager::tr("Exit")); TPtrC nativeText = qt_QString2TPtrC(text); diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index a82d0f9..182cce9 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -989,7 +989,8 @@ QDebug operator<<(QDebug dbg, const QBrush &b) "LinearGradientPattern", "RadialGradientPattern", "ConicalGradientPattern", - "TexturePattern" + 0, 0, 0, 0, 0, 0, + "TexturePattern" // 24 }; dbg.nospace() << "QBrush(" << b.color() << ',' << BRUSH_STYLES[b.style()] << ')'; diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 3ea084b..c9ff661 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -79,6 +79,31 @@ QByteArray QFontEngineS60Extensions::getSfntTable(uint tag) const return result; } +bool QFontEngineS60Extensions::getSfntTableData(uint tag, uchar *buffer, uint *length) const +{ + if (!m_trueTypeExtension->HasTrueTypeTable(tag)) + return false; + + bool result = true; + TInt error = KErrNone; + TInt tableByteLength; + TAny *table = + q_check_ptr(m_trueTypeExtension->GetTrueTypeTable(error, tag, &tableByteLength)); + + if (error != KErrNone) { + return false; + } else if (*length > 0 && *length < tableByteLength) { + result = false; // Caller did not allocate enough memory + } else { + *length = tableByteLength; + if (buffer) + qMemCopy(buffer, table, tableByteLength); + } + + m_trueTypeExtension->ReleaseTrueTypeTable(table); + return result; +} + const unsigned char *QFontEngineS60Extensions::cmap() const { if (!m_cmap) { @@ -326,6 +351,11 @@ QByteArray QFontEngineS60::getSfntTable(uint tag) const return m_extensions->getSfntTable(tag); } +bool QFontEngineS60::getSfntTableData(uint tag, uchar *buffer, uint *length) const +{ + return m_extensions->getSfntTableData(tag, buffer, length); +} + QFontEngine::Type QFontEngineS60::type() const { return QFontEngine::S60FontEngine; diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h index 5834cc4..a80af4d 100644 --- a/src/gui/text/qfontengine_s60_p.h +++ b/src/gui/text/qfontengine_s60_p.h @@ -69,6 +69,7 @@ public: QFontEngineS60Extensions(CFont* fontOwner, COpenFont *font); QByteArray getSfntTable(uint tag) const; + bool getSfntTableData(uint tag, uchar *buffer, uint *length) const; const unsigned char *cmap() const; QPainterPath glyphOutline(glyph_t glyph) const; CFont *fontOwner() const; @@ -106,6 +107,7 @@ public: qreal minRightBearing() const { return 0; } QByteArray getSfntTable(uint tag) const; + bool getSfntTableData(uint tag, uchar *buffer, uint *length) const; static qreal pixelsToPoints(qreal pixels, Qt::Orientation orientation = Qt::Horizontal); static qreal pointsToPixels(qreal points, Qt::Orientation orientation = Qt::Horizontal); diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 7dc2c26..6485966 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1647,7 +1647,7 @@ glyph_metrics_t QTextEngine::boundingBox(int from, int len) const } } - glyph_t glyph = glyphs.glyphs[logClusters[pos + ilen - 1]]; + glyph_t glyph = glyphs.glyphs[logClusters[ilen - 1]]; glyph_metrics_t gi = fe->boundingBox(glyph); if (gi.isValid()) gm.width -= qRound(gi.xoff - gi.x - gi.width); diff --git a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp index 67dc90c..aee0807 100644 --- a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp @@ -78,6 +78,8 @@ QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(QByteArray dev, QAudio::Mode { device = QLatin1String(dev); this->mode = mode; + + updateLists(); } QAudioDeviceInfoInternal::~QAudioDeviceInfoInternal() @@ -176,22 +178,70 @@ bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const // See if what is in settings will work (return value). bool failed = false; + bool match = false; - // For now, just accept only audio/pcm codec - if(!format.codec().startsWith(QLatin1String("audio/pcm"))) - failed = true; + // check codec + for( int i = 0; i < codecz.count(); i++) { + if (format.codec() == codecz.at(i)) + match = true; + } + if (!match) failed = true; + + // check channel + match = false; + if (!failed) { + for( int i = 0; i < channelz.count(); i++) { + if (format.channels() == channelz.at(i)) { + match = true; + break; + } + } + } + if (!match) failed = true; + + // check frequency + match = false; + if (!failed) { + for( int i = 0; i < freqz.count(); i++) { + if (format.frequency() == freqz.at(i)) { + match = true; + break; + } + } + } - if(!failed && !(format.channels() == 1 || format.channels() == 2)) - failed = true; + // check sample size + match = false; + if (!failed) { + for( int i = 0; i < sizez.count(); i++) { + if (format.sampleSize() == sizez.at(i)) { + match = true; + break; + } + } + } - if(!failed) { - if(!(format.frequency() == 8000 || format.frequency() == 11025 || format.frequency() == 22050 || - format.frequency() == 44100 || format.frequency() == 48000 || format.frequency() == 96000)) - failed = true; + // check byte order + match = false; + if (!failed) { + for( int i = 0; i < byteOrderz.count(); i++) { + if (format.byteOrder() == byteOrderz.at(i)) { + match = true; + break; + } + } } - if(!failed && !(format.sampleSize() == 8 || format.sampleSize() == 16)) - failed = true; + // check sample type + match = false; + if (!failed) { + for( int i = 0; i < typez.count(); i++) { + if (format.sampleType() == typez.at(i)) { + match = true; + break; + } + } + } if(!failed) { // settings work @@ -332,6 +382,8 @@ void QAudioDeviceInfoInternal::updateLists() codecz.append(QLatin1String("audio/pcm")); } + if (freqz.count() > 0) + freqz.prepend(8000); } QList<QByteArray> QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode) diff --git a/src/multimedia/audio/qaudioinput_alsa_p.cpp b/src/multimedia/audio/qaudioinput_alsa_p.cpp index ead9995..6b15008 100644 --- a/src/multimedia/audio/qaudioinput_alsa_p.cpp +++ b/src/multimedia/audio/qaudioinput_alsa_p.cpp @@ -428,7 +428,6 @@ bool QAudioInputPrivate::open() void QAudioInputPrivate::close() { - deviceState = QAudio::StoppedState; timer->stop(); if ( handle ) { diff --git a/src/multimedia/audio/qaudioinput_win32_p.cpp b/src/multimedia/audio/qaudioinput_win32_p.cpp index 180cbda..b5d673e 100644 --- a/src/multimedia/audio/qaudioinput_win32_p.cpp +++ b/src/multimedia/audio/qaudioinput_win32_p.cpp @@ -57,8 +57,6 @@ QT_BEGIN_NAMESPACE //#define DEBUG_AUDIO 1 -static CRITICAL_SECTION waveInCriticalSection; - static const int minimumIntervalTime = 50; QAudioInputPrivate::QAudioInputPrivate(const QByteArray &device, const QAudioFormat& audioFormat): @@ -104,16 +102,16 @@ void QT_WIN_CALLBACK QAudioInputPrivate::waveInProc( HWAVEIN hWaveIn, UINT uMsg, case WIM_OPEN: break; case WIM_DATA: - EnterCriticalSection(&waveInCriticalSection); + EnterCriticalSection(&qAudio->waveInCriticalSection); if(qAudio->waveFreeBlockCount > 0) qAudio->waveFreeBlockCount--; qAudio->feedback(); - LeaveCriticalSection(&waveInCriticalSection); + LeaveCriticalSection(&qAudio->waveInCriticalSection); break; case WIM_CLOSE: - EnterCriticalSection(&waveInCriticalSection); + EnterCriticalSection(&qAudio->waveInCriticalSection); qAudio->finished = true; - LeaveCriticalSection(&waveInCriticalSection); + LeaveCriticalSection(&qAudio->waveInCriticalSection); break; default: return; @@ -226,8 +224,8 @@ bool QAudioInputPrivate::open() #endif header = 0; if(buffer_size == 0) { - // Default buffer size, 100ms, default period size is 20ms - buffer_size = settings.frequency()*settings.channels()*(settings.sampleSize()/8)*0.1; + // Default buffer size, 200ms, default period size is 40ms + buffer_size = settings.frequency()*settings.channels()*(settings.sampleSize()/8)*0.2; period_size = buffer_size/5; } else { period_size = buffer_size/5; diff --git a/src/multimedia/audio/qaudioinput_win32_p.h b/src/multimedia/audio/qaudioinput_win32_p.h index a2cf2ea..66c2535 100644 --- a/src/multimedia/audio/qaudioinput_win32_p.h +++ b/src/multimedia/audio/qaudioinput_win32_p.h @@ -122,6 +122,7 @@ private: volatile int waveFreeBlockCount; int waveCurrentBlock; + CRITICAL_SECTION waveInCriticalSection; static void QT_WIN_CALLBACK waveInProc( HWAVEIN hWaveIn, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 ); diff --git a/src/multimedia/audio/qaudiooutput_alsa_p.cpp b/src/multimedia/audio/qaudiooutput_alsa_p.cpp index 1cef335..cf3726b 100644 --- a/src/multimedia/audio/qaudiooutput_alsa_p.cpp +++ b/src/multimedia/audio/qaudiooutput_alsa_p.cpp @@ -485,7 +485,6 @@ bool QAudioOutputPrivate::open() void QAudioOutputPrivate::close() { - deviceState = QAudio::StoppedState; timer->stop(); if ( handle ) { @@ -701,6 +700,7 @@ bool QAudioOutputPrivate::deviceReady() } else if(l < 0) { close(); + deviceState = QAudio::StoppedState; errorState = QAudio::IOError; emit stateChanged(deviceState); } diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp index 4bcbd09..13bce58 100644 --- a/src/multimedia/audio/qaudiooutput_win32_p.cpp +++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp @@ -56,8 +56,6 @@ QT_BEGIN_NAMESPACE -static CRITICAL_SECTION waveOutCriticalSection; - static const int minimumIntervalTime = 50; QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, const QAudioFormat& audioFormat): @@ -107,16 +105,16 @@ void CALLBACK QAudioOutputPrivate::waveOutProc( HWAVEOUT hWaveOut, UINT uMsg, case WOM_CLOSE: return; case WOM_DONE: - EnterCriticalSection(&waveOutCriticalSection); + EnterCriticalSection(&qAudio->waveOutCriticalSection); if(qAudio->finished || qAudio->buffer_size == 0 || qAudio->period_size == 0) { - LeaveCriticalSection(&waveOutCriticalSection); + LeaveCriticalSection(&qAudio->waveOutCriticalSection); return; } qAudio->waveFreeBlockCount++; if(qAudio->waveFreeBlockCount >= qAudio->buffer_size/qAudio->period_size) qAudio->waveFreeBlockCount = qAudio->buffer_size/qAudio->period_size; qAudio->feedback(); - LeaveCriticalSection(&waveOutCriticalSection); + LeaveCriticalSection(&qAudio->waveOutCriticalSection); break; default: return; diff --git a/src/multimedia/audio/qaudiooutput_win32_p.h b/src/multimedia/audio/qaudiooutput_win32_p.h index bb176a0..68a40f7 100644 --- a/src/multimedia/audio/qaudiooutput_win32_p.h +++ b/src/multimedia/audio/qaudiooutput_win32_p.h @@ -119,6 +119,8 @@ private: static void QT_WIN_CALLBACK waveOutProc( HWAVEOUT hWaveOut, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 ); + CRITICAL_SECTION waveOutCriticalSection; + WAVEHDR* allocateBlocks(int size, int count); void freeBlocks(WAVEHDR* blockArray); bool open(); diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp index ec6817a..cce6bd9 100644 --- a/src/network/access/qnetworkdiskcache.cpp +++ b/src/network/access/qnetworkdiskcache.cpp @@ -41,7 +41,6 @@ //#define QNETWORKDISKCACHE_DEBUG -#ifndef QT_NO_NETWORKDISKCACHE #include "qnetworkdiskcache.h" #include "qnetworkdiskcache_p.h" @@ -60,6 +59,8 @@ #define CACHE_POSTFIX QLatin1String(".cache") #define MAX_COMPRESSION_SIZE (1024 * 1024 * 3) +#ifndef QT_NO_NETWORKDISKCACHE + QT_BEGIN_NAMESPACE /*! diff --git a/src/network/access/qnetworkdiskcache_p.h b/src/network/access/qnetworkdiskcache_p.h index ad46602..b6df179 100644 --- a/src/network/access/qnetworkdiskcache_p.h +++ b/src/network/access/qnetworkdiskcache_p.h @@ -59,6 +59,8 @@ #include <qhash.h> #include <qtemporaryfile.h> +#ifndef QT_NO_NETWORKDISKCACHE + QT_BEGIN_NAMESPACE class QFile; @@ -119,4 +121,6 @@ public: QT_END_NAMESPACE +#endif // QT_NO_NETWORKDISKCACHE + #endif // QNETWORKDISKCACHE_P_H diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 55fd922..83b4b21 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -999,17 +999,18 @@ GLuint QGLShaderProgram::programId() const Any attributes that have not been explicitly bound when the program is linked will be assigned locations automatically. + When this function is called after the program has been linked, + the program will need to be relinked for the change to take effect. + \sa attributeLocation() */ void QGLShaderProgram::bindAttributeLocation(const char *name, int location) { Q_D(QGLShaderProgram); - if (!d->linked) { - glBindAttribLocation(d->programGuard.id(), location, name); - } else { - qWarning() << "QGLShaderProgram::bindAttributeLocation(" << name - << "): cannot bind after shader program is linked"; - } + if (!init()) + return; + glBindAttribLocation(d->programGuard.id(), location, name); + d->linked = false; // Program needs to be relinked. } /*! @@ -1020,6 +1021,9 @@ void QGLShaderProgram::bindAttributeLocation(const char *name, int location) Any attributes that have not been explicitly bound when the program is linked will be assigned locations automatically. + When this function is called after the program has been linked, + the program will need to be relinked for the change to take effect. + \sa attributeLocation() */ void QGLShaderProgram::bindAttributeLocation(const QByteArray& name, int location) @@ -1035,6 +1039,9 @@ void QGLShaderProgram::bindAttributeLocation(const QByteArray& name, int locatio Any attributes that have not been explicitly bound when the program is linked will be assigned locations automatically. + When this function is called after the program has been linked, + the program will need to be relinked for the change to take effect. + \sa attributeLocation() */ void QGLShaderProgram::bindAttributeLocation(const QString& name, int location) diff --git a/tests/auto/qbrush/tst_qbrush.cpp b/tests/auto/qbrush/tst_qbrush.cpp index 628e859..7e94f37 100644 --- a/tests/auto/qbrush/tst_qbrush.cpp +++ b/tests/auto/qbrush/tst_qbrush.cpp @@ -75,9 +75,10 @@ private slots: void gradientStops(); void textures(); - + void nullBrush(); void isOpaque(); + void debug(); }; Q_DECLARE_METATYPE(QBrush) @@ -399,5 +400,15 @@ void tst_QBrush::isOpaque() QVERIFY(!brush.isOpaque()); } +void tst_QBrush::debug() +{ + QPixmap pixmap_source(10, 10); + fill(&pixmap_source); + QBrush pixmap_brush; + pixmap_brush.setTexture(pixmap_source); + QCOMPARE(pixmap_brush.style(), Qt::TexturePattern); + qDebug() << pixmap_brush; // don't crash +} + QTEST_MAIN(tst_QBrush) #include "tst_qbrush.moc" diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp index 49b840f..dbd4a23 100644 --- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp +++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp @@ -277,9 +277,8 @@ void tst_QGraphicsEffect::draw() // Make sure installing the effect triggers a repaint. CustomEffect *effect = new CustomEffect; item->setGraphicsEffect(effect); - QTest::qWait(50); - QCOMPARE(effect->numRepaints, 1); - QCOMPARE(item->numRepaints, 1); + QTRY_COMPARE(effect->numRepaints, 1); + QTRY_COMPARE(item->numRepaints, 1); // Make sure QPainter* and QStyleOptionGraphicsItem* stays persistent // during QGraphicsEffect::draw/QGraphicsItem::paint. @@ -293,26 +292,23 @@ void tst_QGraphicsEffect::draw() // Make sure updating the source triggers a repaint. item->update(); - QTest::qWait(50); - QCOMPARE(effect->numRepaints, 1); - QCOMPARE(item->numRepaints, 1); + QTRY_COMPARE(effect->numRepaints, 1); + QTRY_COMPARE(item->numRepaints, 1); QVERIFY(effect->m_sourceChangedFlags & QGraphicsEffect::SourceInvalidated); effect->reset(); item->reset(); // Make sure changing the effect's bounding rect triggers a repaint. effect->setMargin(20); - QTest::qWait(50); - QCOMPARE(effect->numRepaints, 1); - QCOMPARE(item->numRepaints, 1); + QTRY_COMPARE(effect->numRepaints, 1); + QTRY_COMPARE(item->numRepaints, 1); effect->reset(); item->reset(); // Make sure change the item's bounding rect triggers a repaint. item->setRect(0, 0, 50, 50); - QTest::qWait(50); - QCOMPARE(effect->numRepaints, 1); - QCOMPARE(item->numRepaints, 1); + QTRY_COMPARE(effect->numRepaints, 1); + QTRY_COMPARE(item->numRepaints, 1); QVERIFY(effect->m_sourceChangedFlags & QGraphicsEffect::SourceBoundingRectChanged); effect->reset(); item->reset(); @@ -320,8 +316,7 @@ void tst_QGraphicsEffect::draw() // Make sure the effect is the one to issue a repaint of the item. effect->doNothingInDraw = true; item->update(); - QTest::qWait(50); - QCOMPARE(effect->numRepaints, 1); + QTRY_COMPARE(effect->numRepaints, 1); QCOMPARE(item->numRepaints, 0); effect->doNothingInDraw = false; effect->reset(); @@ -336,9 +331,8 @@ void tst_QGraphicsEffect::draw() item->reset(); effect->setEnabled(true); - QTest::qWait(50); - QCOMPARE(effect->numRepaints, 1); - QCOMPARE(item->numRepaints, 1); + QTRY_COMPARE(effect->numRepaints, 1); + QTRY_COMPARE(item->numRepaints, 1); effect->reset(); item->reset(); @@ -352,8 +346,7 @@ void tst_QGraphicsEffect::draw() QPointer<CustomEffect> ptr = effect; item->setGraphicsEffect(0); QVERIFY(!ptr); - QTest::qWait(50); - QCOMPARE(item->numRepaints, 1); + QTRY_COMPARE(item->numRepaints, 1); } void tst_QGraphicsEffect::opacity() @@ -515,7 +508,6 @@ void tst_QGraphicsEffect::drawPixmapItem() QTRY_VERIFY(effect->repaints >= 1); item->rotate(180); - QTest::qWait(50); QTRY_VERIFY(effect->repaints >= 2); } @@ -560,9 +552,8 @@ void tst_QGraphicsEffect::deviceCoordinateTranslateCaching() int numRepaints = item->numRepaints; item->translate(10, 0); - QTest::qWait(50); - QVERIFY(item->numRepaints == numRepaints); + QTRY_VERIFY(item->numRepaints == numRepaints); } void tst_QGraphicsEffect::inheritOpacity() @@ -588,7 +579,6 @@ void tst_QGraphicsEffect::inheritOpacity() int numRepaints = item->numRepaints; rectItem->setOpacity(1); - QTest::qWait(50); // item should have been rerendered due to opacity changing QTRY_VERIFY(item->numRepaints > numRepaints); diff --git a/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp b/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp index be03481..49f110e 100644 --- a/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp +++ b/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp @@ -48,6 +48,8 @@ #include <private/qgraphicseffect_p.h> +#include "../../shared/util.h" + //TESTED_CLASS= //TESTED_FILES= @@ -220,9 +222,8 @@ void tst_QGraphicsEffectSource::styleOption() QCOMPARE(item->numRepaints, 0); QCOMPARE(effect->numRepaints, 0); item->update(); - QTest::qWait(50); - QCOMPARE(item->numRepaints, 1); - QCOMPARE(effect->numRepaints, 1); + QTRY_COMPARE(item->numRepaints, 1); + QTRY_COMPARE(effect->numRepaints, 1); } void tst_QGraphicsEffectSource::isPixmap() @@ -255,10 +256,9 @@ void tst_QGraphicsEffectSource::update() QCOMPARE(effect->numRepaints, 0); effect->source()->update(); - QTest::qWait(50); - QCOMPARE(item->numRepaints, 1); - QCOMPARE(effect->numRepaints, 1); + QTRY_COMPARE(item->numRepaints, 1); + QTRY_COMPARE(effect->numRepaints, 1); } void tst_QGraphicsEffectSource::boundingRect() @@ -273,22 +273,20 @@ void tst_QGraphicsEffectSource::boundingRect() // We can at least check that the device bounding rect was correct in QGraphicsEffect::draw. effect->storeDeviceDependentStuff = true; effect->source()->update(); - QTest::qWait(50); const QTransform deviceTransform = item->deviceTransform(view->viewportTransform()); - QCOMPARE(effect->sourceDeviceBoundingRect, deviceTransform.mapRect(itemBoundingRect)); + QTRY_COMPARE(effect->sourceDeviceBoundingRect, deviceTransform.mapRect(itemBoundingRect)); // Bounding rect in logical coordinates is of course fine. - QCOMPARE(effect->source()->boundingRect(Qt::LogicalCoordinates), itemBoundingRect); + QTRY_COMPARE(effect->source()->boundingRect(Qt::LogicalCoordinates), itemBoundingRect); // Make sure default value is Qt::LogicalCoordinates. - QCOMPARE(effect->source()->boundingRect(), itemBoundingRect); + QTRY_COMPARE(effect->source()->boundingRect(), itemBoundingRect); } void tst_QGraphicsEffectSource::deviceRect() { effect->storeDeviceDependentStuff = true; effect->source()->update(); - QTest::qWait(50); - QCOMPARE(effect->deviceRect, view->viewport()->rect()); + QTRY_COMPARE(effect->deviceRect, view->viewport()->rect()); } void tst_QGraphicsEffectSource::pixmap() @@ -299,8 +297,7 @@ void tst_QGraphicsEffectSource::pixmap() // We can at least verify a valid pixmap from QGraphicsEffect::draw. effect->storeDeviceDependentStuff = true; effect->source()->update(); - QTest::qWait(50); - QVERIFY(!effect->deviceCoordinatesPixmap.isNull()); + QTRY_VERIFY(!effect->deviceCoordinatesPixmap.isNull()); // Pixmaps in logical coordinates we can do fine. QPixmap pixmap1 = effect->source()->pixmap(Qt::LogicalCoordinates); diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 89d5958..03ce45a 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -6882,8 +6882,8 @@ void tst_QGraphicsItem::cacheMode() testerChild2->rotate(22); QTest::qWait(25); QTRY_COMPARE(tester->repaints, 4); - QCOMPARE(testerChild->repaints, 4); - QCOMPARE(testerChild2->repaints, 3); + QTRY_COMPARE(testerChild->repaints, 4); + QTRY_COMPARE(testerChild2->repaints, 3); tester->resetTransform(); testerChild->resetTransform(); testerChild2->resetTransform(); @@ -6961,33 +6961,30 @@ void tst_QGraphicsItem::cacheMode() testerChild->setPos(1, 1); QTest::qWait(25); QTRY_COMPARE(tester->repaints, 11); - QCOMPARE(testerChild->repaints, 10); - QCOMPARE(testerChild2->repaints, 5); + QTRY_COMPARE(testerChild->repaints, 10); + QTRY_COMPARE(testerChild2->repaints, 5); tester->resetTransform(); // Make a huge item tester->setGeometry(QRectF(-4000, -4000, 8000, 8000)); - QTest::qWait(25); QTRY_COMPARE(tester->repaints, 12); - QCOMPARE(testerChild->repaints, 11); - QCOMPARE(testerChild2->repaints, 5); + QTRY_COMPARE(testerChild->repaints, 11); + QTRY_COMPARE(testerChild2->repaints, 5); // Move the large item - will cause a repaint as the // cache is clipped. tester->setPos(5, 0); - QTest::qWait(25); QTRY_COMPARE(tester->repaints, 13); - QCOMPARE(testerChild->repaints, 11); - QCOMPARE(testerChild2->repaints, 5); + QTRY_COMPARE(testerChild->repaints, 11); + QTRY_COMPARE(testerChild2->repaints, 5); // Hiding and showing should invalidate the cache tester->hide(); QTest::qWait(25); tester->show(); - QTest::qWait(25); QTRY_COMPARE(tester->repaints, 14); - QCOMPARE(testerChild->repaints, 12); - QCOMPARE(testerChild2->repaints, 6); + QTRY_COMPARE(testerChild->repaints, 12); + QTRY_COMPARE(testerChild2->repaints, 6); } void tst_QGraphicsItem::cacheMode2() diff --git a/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp index fb2e145..dad3279 100644 --- a/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp +++ b/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp @@ -44,6 +44,8 @@ #include <QtGui> #include <math.h> +#include "../../shared/util.h" + //TESTED_CLASS=QGraphicsLayout //TESTED_FILES= @@ -423,22 +425,15 @@ void tst_QGraphicsLayout::alternativeLayoutItems() view.resize(150, 150); view.show(); - QApplication::processEvents(); - QTest::qWait(750); - QApplication::processEvents(); - - QCOMPARE(static_cast<QGraphicsRectItem*>(li1->graphicsItem())->rect(), QRectF( 0, 0, 33, 99)); - QCOMPARE(static_cast<QGraphicsRectItem*>(li2->graphicsItem())->rect(), QRectF(33, 0, 33, 99)); - QCOMPARE(static_cast<QGraphicsRectItem*>(li3->graphicsItem())->rect(), QRectF(66, 0, 33, 99)); + QTRY_COMPARE(static_cast<QGraphicsRectItem*>(li1->graphicsItem())->rect(), QRectF( 0, 0, 33, 99)); + QTRY_COMPARE(static_cast<QGraphicsRectItem*>(li2->graphicsItem())->rect(), QRectF(33, 0, 33, 99)); + QTRY_COMPARE(static_cast<QGraphicsRectItem*>(li3->graphicsItem())->rect(), QRectF(66, 0, 33, 99)); lout->setOrientation(Qt::Vertical); - QApplication::processEvents(); - QTest::qWait(750); - QApplication::processEvents(); - QCOMPARE(static_cast<QGraphicsRectItem*>(li1->graphicsItem())->rect(), QRectF(0, 0, 99, 33)); - QCOMPARE(static_cast<QGraphicsRectItem*>(li2->graphicsItem())->rect(), QRectF(0, 33, 99, 33)); - QCOMPARE(static_cast<QGraphicsRectItem*>(li3->graphicsItem())->rect(), QRectF(0, 66, 99, 33)); + QTRY_COMPARE(static_cast<QGraphicsRectItem*>(li1->graphicsItem())->rect(), QRectF(0, 0, 99, 33)); + QTRY_COMPARE(static_cast<QGraphicsRectItem*>(li2->graphicsItem())->rect(), QRectF(0, 33, 99, 33)); + QTRY_COMPARE(static_cast<QGraphicsRectItem*>(li3->graphicsItem())->rect(), QRectF(0, 66, 99, 33)); } diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 23b3458..e46709b 100644 --- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -787,7 +787,6 @@ void tst_QGraphicsProxyWidget::focusNextPrevChild() view.show(); QApplication::setActiveWindow(&view); QTest::qWaitForWindowShown(&view); - QApplication::processEvents(); QTRY_COMPARE(QApplication::activeWindow(), &view); if (hasScene) { scene.addItem(proxy); @@ -836,7 +835,6 @@ void tst_QGraphicsProxyWidget::focusOutEvent() view.activateWindow(); view.setFocus(); QTest::qWaitForWindowShown(&view); - QApplication::processEvents(); QTRY_VERIFY(view.isVisible()); QTRY_COMPARE(QApplication::activeWindow(), &view); @@ -989,7 +987,6 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent() // in QTest::mouseMove(&view, QPoint(50, 50)); - QTest::qWait(25); QTRY_COMPARE(widget->testAttribute(Qt::WA_UnderMouse), hasWidget ? true : false); // ### this attribute isn't supported QCOMPARE(widget->enterCount, hasWidget ? 1 : 0); @@ -999,11 +996,10 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent() // out QTest::mouseMove(&view, QPoint(10, 10)); - QTest::qWait(25); // QTRY_COMPARE(widget->testAttribute(Qt::WA_UnderMouse), false); // ### this attribute isn't supported - QCOMPARE(widget->leaveCount, hasWidget ? 1 : 0); - QCOMPARE(widget->hoverLeave, (hasWidget && hoverEnabled) ? 1 : 0); + QTRY_COMPARE(widget->leaveCount, hasWidget ? 1 : 0); + QTRY_COMPARE(widget->hoverLeave, (hasWidget && hoverEnabled) ? 1 : 0); // does not work on all platforms //QCOMPARE(widget->moveCount, 0); @@ -1071,7 +1067,6 @@ void tst_QGraphicsProxyWidget::hoverMoveEvent() // move a little bit QTest::mouseMove(&view, QPoint(60, 60)); - QTest::qWait(12); QTRY_COMPARE(widget->hoverEnter, (hasWidget && hoverEnabled) ? 1 : 0); QCOMPARE(widget->moveCount, (hasWidget && mouseTracking) || (hasWidget && mouseDown) ? 1 : 0); @@ -1097,7 +1092,6 @@ void tst_QGraphicsProxyWidget::keyPressEvent() view.viewport()->setFocus(); QApplication::setActiveWindow(&view); QTest::qWaitForWindowShown(&view); - QApplication::processEvents(); QTRY_COMPARE(QApplication::activeWindow(), &view); SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget; @@ -1305,13 +1299,11 @@ void tst_QGraphicsProxyWidget::paintEvent() scene.addItem(&proxy); //make sure we flush all the paint events - QTest::qWait(30); QTRY_VERIFY(proxy.paintCount > 1); QTest::qWait(30); proxy.paintCount = 0; w->update(); - QTest::qWait(30); QTRY_COMPARE(proxy.paintCount, 1); //the widget should have been painted now } @@ -1504,7 +1496,6 @@ void tst_QGraphicsProxyWidget::scrollUpdate() view.paintEventRegion = QRegion(); view.npaints = 0; QTimer::singleShot(0, widget, SLOT(updateScroll())); - QTest::qWait(50); QTRY_COMPARE(view.npaints, 2); // QRect(0, 0, 200, 12) is the first update, expanded (-2, -2, 2, 2) // QRect(0, 12, 102, 10) is the scroll update, expanded (-2, -2, 2, 2), @@ -2483,9 +2474,7 @@ void tst_QGraphicsProxyWidget::popup_basic() QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center()))); - QTest::qWait(12); - - QCOMPARE(box->pos(), QPoint()); + QTRY_COMPARE(box->pos(), QPoint()); QCOMPARE(proxy->childItems().count(), 1); QGraphicsProxyWidget *child = (QGraphicsProxyWidget*)(proxy->childItems())[0]; @@ -2498,7 +2487,6 @@ void tst_QGraphicsProxyWidget::popup_basic() QSKIP("Does not work due to SH_Combobox_Popup", SkipAll); QCOMPARE(child->widget()->parent(), static_cast<QObject*>(box)); - QTest::qWait(12); QTRY_COMPARE(proxy->pos(), QPointF(box->pos())); QCOMPARE(child->x(), qreal(box->x())); QCOMPARE(child->y(), qreal(box->rect().bottom())); @@ -2583,13 +2571,11 @@ void tst_QGraphicsProxyWidget::changingCursor_basic() // in QTest::mouseMove(view.viewport(), view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center()))); sendMouseMove(view.viewport(), view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center()))); - QTest::qWait(12); QTRY_COMPARE(view.viewport()->cursor().shape(), Qt::IBeamCursor); // out QTest::mouseMove(view.viewport(), QPoint(1, 1)); sendMouseMove(view.viewport(), QPoint(1, 1)); - QTest::qWait(12); QTRY_COMPARE(view.viewport()->cursor().shape(), Qt::ArrowCursor); #endif } @@ -2615,9 +2601,8 @@ void tst_QGraphicsProxyWidget::tooltip_basic() // in QTest::mouseMove(view.viewport(), view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center()))); - QTest::qWait(3000); - QCOMPARE(proxy->childItems().count(), 1); + QTRY_COMPARE(proxy->childItems().count(), 1); QGraphicsProxyWidget *child = (QGraphicsProxyWidget*)(proxy->childItems())[0]; QVERIFY(child->isWidget()); QVERIFY(child->widget()); @@ -3348,7 +3333,6 @@ void tst_QGraphicsProxyWidget::updateAndDelete() #ifdef Q_WS_X11 qt_x11_wait_for_window_manager(&view); #endif - QTest::qWait(20); QTRY_VERIFY(view.npaints > 0); const QRect itemDeviceBoundingRect = proxy->deviceTransform(view.viewportTransform()) @@ -3361,8 +3345,7 @@ void tst_QGraphicsProxyWidget::updateAndDelete() // Update and hide. proxy->update(); proxy->hide(); - QTest::qWait(50); - QCOMPARE(view.npaints, 1); + QTRY_COMPARE(view.npaints, 1); QCOMPARE(view.paintEventRegion, expectedRegion); proxy->show(); @@ -3373,8 +3356,7 @@ void tst_QGraphicsProxyWidget::updateAndDelete() // Update and delete. proxy->update(); delete proxy; - QTest::qWait(50); - QCOMPARE(view.npaints, 1); + QTRY_COMPARE(view.npaints, 1); QCOMPARE(view.paintEventRegion, expectedRegion); } @@ -3439,7 +3421,6 @@ void tst_QGraphicsProxyWidget::clickFocus() qt_x11_wait_for_window_manager(&view); #endif QApplication::setActiveWindow(&view); - QTest::qWait(25); QTRY_COMPARE(QApplication::activeWindow(), &view); QVERIFY(!proxy->hasFocus()); diff --git a/translations/designer_fr.ts b/translations/designer_fr.ts index b3bf4de..bfdbb73 100644 --- a/translations/designer_fr.ts +++ b/translations/designer_fr.ts @@ -1166,7 +1166,7 @@ <message> <location filename="../tools/designer/src/components/formeditor/formwindowsettings.ui" line="166"/> <source>&Pixmap Function</source> - <translation>Function de &pixmap</translation> + <translation>Fonction de &pixmap</translation> </message> <message> <location filename="../tools/designer/src/components/formeditor/formwindowsettings.ui" line="219"/> |