diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-07-06 10:21:00 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-07-06 12:18:17 (GMT) |
commit | 14ed83f4e65b26cea12b128043c1c67c5489832d (patch) | |
tree | 6b99ea399c602a64db702601cebc1d2ba29a4528 /src/3rdparty/phonon | |
parent | 039c800f728054a56ae1584d269ee1ddadd1312f (diff) | |
download | Qt-14ed83f4e65b26cea12b128043c1c67c5489832d.zip Qt-14ed83f4e65b26cea12b128043c1c67c5489832d.tar.gz Qt-14ed83f4e65b26cea12b128043c1c67c5489832d.tar.bz2 |
Phonon: Some work done on binary size
removing foreach seems to help on Windows
Diffstat (limited to 'src/3rdparty/phonon')
-rw-r--r-- | src/3rdparty/phonon/ds9/iodevicereader.cpp | 10 | ||||
-rw-r--r-- | src/3rdparty/phonon/ds9/videorenderer_soft.cpp | 32 | ||||
-rw-r--r-- | src/3rdparty/phonon/ds9/volumeeffect.cpp | 12 | ||||
-rw-r--r-- | src/3rdparty/phonon/phonon/audiooutput.cpp | 14 | ||||
-rw-r--r-- | src/3rdparty/phonon/phonon/backendcapabilities.cpp | 14 | ||||
-rw-r--r-- | src/3rdparty/phonon/phonon/effect.cpp | 6 | ||||
-rw-r--r-- | src/3rdparty/phonon/phonon/effectwidget.cpp | 10 | ||||
-rw-r--r-- | src/3rdparty/phonon/phonon/factory.cpp | 43 | ||||
-rw-r--r-- | src/3rdparty/phonon/phonon/medianode.cpp | 4 | ||||
-rw-r--r-- | src/3rdparty/phonon/phonon/mediaobject.cpp | 12 | ||||
-rw-r--r-- | src/3rdparty/phonon/phonon/objectdescriptionmodel.cpp | 4 | ||||
-rw-r--r-- | src/3rdparty/phonon/phonon/objectdescriptionmodel.h | 8 | ||||
-rw-r--r-- | src/3rdparty/phonon/phonon/path.cpp | 24 |
13 files changed, 88 insertions, 105 deletions
diff --git a/src/3rdparty/phonon/ds9/iodevicereader.cpp b/src/3rdparty/phonon/ds9/iodevicereader.cpp index ec10278..2dff1fe 100644 --- a/src/3rdparty/phonon/ds9/iodevicereader.cpp +++ b/src/3rdparty/phonon/ds9/iodevicereader.cpp @@ -36,15 +36,7 @@ namespace Phonon //these mediatypes define a stream, its type will be autodetected by DirectShow static QVector<AM_MEDIA_TYPE> getMediaTypes() { - AM_MEDIA_TYPE mt; - mt.majortype = MEDIATYPE_Stream; - mt.bFixedSizeSamples = TRUE; - mt.bTemporalCompression = FALSE; - mt.lSampleSize = 1; - mt.formattype = GUID_NULL; - mt.pUnk = 0; - mt.cbFormat = 0; - mt.pbFormat = 0; + AM_MEDIA_TYPE mt = { MEDIATYPE_Stream, MEDIASUBTYPE_NULL, TRUE, FALSE, 1, GUID_NULL, 0, 0, 0}; QVector<AM_MEDIA_TYPE> ret; //normal auto-detect stream diff --git a/src/3rdparty/phonon/ds9/videorenderer_soft.cpp b/src/3rdparty/phonon/ds9/videorenderer_soft.cpp index dd6e076..2112267 100644 --- a/src/3rdparty/phonon/ds9/videorenderer_soft.cpp +++ b/src/3rdparty/phonon/ds9/videorenderer_soft.cpp @@ -63,9 +63,9 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. static const char yv12ToRgb[] = "!!ARBfp1.0" "PARAM c[5] = { program.local[0..1]," -" { 1.164, 0, 1.596, 0.5 }," -" { 0.0625, 1.164, -0.391, -0.81300002 }," -" { 1.164, 2.0179999, 0 } };" +"{ 1.164, 0, 1.596, 0.5 }," +"{ 0.0625, 1.164, -0.391, -0.81300002 }," +"{ 1.164, 2.0179999, 0 } };" "TEMP R0;" "TEX R0.x, fragment.texcoord[0], texture[1], 2D;" "ADD R0.y, R0.x, -c[2].w;" @@ -89,11 +89,11 @@ static const char yv12ToRgb[] = "END"; static const char yuy2ToRgb[] = - "!!ARBfp1.0" +"!!ARBfp1.0" "PARAM c[5] = { program.local[0..1]," -" { 0.5, 2, 1, 0.0625 }," -" { 1.164, 0, 1.596, 2.0179999 }," -" { 1.164, -0.391, -0.81300002 } };" +"{ 0.5, 2, 1, 0.0625 }," +"{ 1.164, 0, 1.596, 2.0179999 }," +"{ 1.164, -0.391, -0.81300002 } };" "TEMP R0;" "TEMP R1;" "TEMP R2;" @@ -149,24 +149,16 @@ namespace Phonon { static const QVector<AM_MEDIA_TYPE> videoMediaTypes() { - AM_MEDIA_TYPE mt; - qMemSet(&mt, 0, sizeof(AM_MEDIA_TYPE)); - mt.majortype = MEDIATYPE_Video; - - //we accept any video format - mt.formattype = GUID_NULL; - mt.cbFormat = 0; - mt.pbFormat = 0; + AM_MEDIA_TYPE mt = { MEDIATYPE_Video, MEDIASUBTYPE_YV12, 0, 0, 0, GUID_NULL, 0, 0, 0 }; QVector<AM_MEDIA_TYPE> ret; - //we support YUV (YV12 and YUY2) and RGB32 - mt.subtype = MEDIASUBTYPE_YV12; - ret << mt; + //we add all the subtypes we support + ret << mt; //YV12 mt.subtype = MEDIASUBTYPE_YUY2; - ret << mt; + ret << mt; //YUY2 mt.subtype = MEDIASUBTYPE_RGB32; - ret << mt; + ret << mt; //RGB32 return ret; } diff --git a/src/3rdparty/phonon/ds9/volumeeffect.cpp b/src/3rdparty/phonon/ds9/volumeeffect.cpp index 2fd1afc..b9a5fce 100644 --- a/src/3rdparty/phonon/ds9/volumeeffect.cpp +++ b/src/3rdparty/phonon/ds9/volumeeffect.cpp @@ -68,17 +68,7 @@ namespace Phonon static const QVector<AM_MEDIA_TYPE> audioMediaType() { QVector<AM_MEDIA_TYPE> ret; - - AM_MEDIA_TYPE mt; - mt.majortype = MEDIATYPE_Audio; - mt.subtype = MEDIASUBTYPE_PCM; - mt.bFixedSizeSamples = 1; - mt.bTemporalCompression = 0; - mt.pUnk = 0; - mt.lSampleSize = 1; - mt.cbFormat = 0; - mt.pbFormat = 0; - mt.formattype = GUID_NULL; + AM_MEDIA_TYPE mt = { MEDIATYPE_Audio, MEDIASUBTYPE_PCM, 1, 0, 1, GUID_NULL, 0, 0, 0}; ret << mt; return ret; } diff --git a/src/3rdparty/phonon/phonon/audiooutput.cpp b/src/3rdparty/phonon/phonon/audiooutput.cpp index 752580a..00b2ebd 100644 --- a/src/3rdparty/phonon/phonon/audiooutput.cpp +++ b/src/3rdparty/phonon/phonon/audiooutput.cpp @@ -264,8 +264,8 @@ void AudioOutputPrivate::setupBackendObject() if (deviceList.isEmpty()) { return; } - foreach (int devIndex, deviceList) { - const AudioOutputDevice &dev = AudioOutputDevice::fromIndex(devIndex); + for (int i = 0; i < deviceList.count(); ++i) { + const AudioOutputDevice &dev = AudioOutputDevice::fromIndex(deviceList.at(i)); if (callSetOutputDevice(this, dev)) { handleAutomaticDeviceChange(dev, AudioOutputPrivate::FallbackChange); return; // found one that works @@ -305,8 +305,9 @@ void AudioOutputPrivate::_k_audioDeviceFailed() pDebug() << Q_FUNC_INFO; // outputDeviceIndex identifies a failing device // fall back in the preference list of output devices - QList<int> deviceList = GlobalConfig().audioOutputDeviceListFor(category, GlobalConfig::AdvancedDevicesFromSettings | GlobalConfig::HideUnavailableDevices); - foreach (int devIndex, deviceList) { + const QList<int> deviceList = GlobalConfig().audioOutputDeviceListFor(category, GlobalConfig::AdvancedDevicesFromSettings | GlobalConfig::HideUnavailableDevices); + for (int i = 0; i < deviceList.count(); ++i) { + const int devIndex = deviceList.at(i); // if it's the same device as the one that failed, ignore it if (device.index() != devIndex) { const AudioOutputDevice &info = AudioOutputDevice::fromIndex(devIndex); @@ -326,9 +327,10 @@ void AudioOutputPrivate::_k_deviceListChanged() { pDebug() << Q_FUNC_INFO; // let's see if there's a usable device higher in the preference list - QList<int> deviceList = GlobalConfig().audioOutputDeviceListFor(category, GlobalConfig::AdvancedDevicesFromSettings); + const QList<int> deviceList = GlobalConfig().audioOutputDeviceListFor(category, GlobalConfig::AdvancedDevicesFromSettings); DeviceChangeType changeType = HigherPreferenceChange; - foreach (int devIndex, deviceList) { + for (int i = 0; i < deviceList.count(); ++i) { + const int devIndex = deviceList.at(i); const AudioOutputDevice &info = AudioOutputDevice::fromIndex(devIndex); if (!info.property("available").toBool()) { if (device.index() == devIndex) { diff --git a/src/3rdparty/phonon/phonon/backendcapabilities.cpp b/src/3rdparty/phonon/phonon/backendcapabilities.cpp index 5dee6a0..62c9cc9 100644 --- a/src/3rdparty/phonon/phonon/backendcapabilities.cpp +++ b/src/3rdparty/phonon/phonon/backendcapabilities.cpp @@ -76,8 +76,8 @@ QList<AudioOutputDevice> BackendCapabilities::availableAudioOutputDevices() { QList<AudioOutputDevice> ret; const QList<int> deviceIndexes = GlobalConfig().audioOutputDeviceListFor(Phonon::NoCategory); - foreach (int i, deviceIndexes) { - ret.append(AudioOutputDevice::fromIndex(i)); + for (int i = 0; i < deviceIndexes.count(); ++i) { + ret.append(AudioOutputDevice::fromIndex(deviceIndexes.at(i))); } return ret; } @@ -88,8 +88,8 @@ QList<AudioCaptureDevice> BackendCapabilities::availableAudioCaptureDevices() { QList<AudioCaptureDevice> ret; const QList<int> deviceIndexes = GlobalConfig().audioCaptureDeviceListFor(Phonon::NoCategory); - foreach (int i, deviceIndexes) { - ret.append(AudioCaptureDevice::fromIndex(i)); + for (int i = 0; i < deviceIndexes.count(); ++i) { + ret.append(AudioCaptureDevice::fromIndex(deviceIndexes.at(i))); } return ret; } @@ -101,9 +101,9 @@ QList<EffectDescription> BackendCapabilities::availableAudioEffects() BackendInterface *backendIface = qobject_cast<BackendInterface *>(Factory::backend()); QList<EffectDescription> ret; if (backendIface) { - QList<int> deviceIndexes = backendIface->objectDescriptionIndexes(Phonon::EffectType); - foreach (int i, deviceIndexes) { - ret.append(EffectDescription::fromIndex(i)); + const QList<int> deviceIndexes = backendIface->objectDescriptionIndexes(Phonon::EffectType); + for (int i = 0; i < deviceIndexes.count(); ++i) { + ret.append(EffectDescription::fromIndex(deviceIndexes.at(i))); } } return ret; diff --git a/src/3rdparty/phonon/phonon/effect.cpp b/src/3rdparty/phonon/phonon/effect.cpp index c125232..98662a5 100644 --- a/src/3rdparty/phonon/phonon/effect.cpp +++ b/src/3rdparty/phonon/phonon/effect.cpp @@ -107,7 +107,8 @@ bool EffectPrivate::aboutToDeleteBackendObject() { if (m_backendObject) { const QList<EffectParameter> parameters = pINTERFACE_CALL(parameters()); - foreach (const EffectParameter &p, parameters) { + for (int i = 0; i < parameters.count(); ++i) { + const EffectParameter &p = parameters.at(i); parameterValues[p] = pINTERFACE_CALL(parameterValue(p)); } } @@ -120,7 +121,8 @@ void EffectPrivate::setupBackendObject() // set up attributes const QList<EffectParameter> parameters = pINTERFACE_CALL(parameters()); - foreach (const EffectParameter &p, parameters) { + for (int i = 0; i < parameters.count(); ++i) { + const EffectParameter &p = parameters.at(i); pINTERFACE_CALL(setParameterValue(p, parameterValues[p])); } } diff --git a/src/3rdparty/phonon/phonon/effectwidget.cpp b/src/3rdparty/phonon/phonon/effectwidget.cpp index d5c6c81..99478f7 100644 --- a/src/3rdparty/phonon/phonon/effectwidget.cpp +++ b/src/3rdparty/phonon/phonon/effectwidget.cpp @@ -97,7 +97,8 @@ void EffectWidgetPrivate::autogenerateUi() Q_Q(EffectWidget); QVBoxLayout *mainLayout = new QVBoxLayout(q); mainLayout->setMargin(0); - foreach (const EffectParameter ¶, effect->parameters()) { + for (int i = 0; i < effect->parameters().count(); ++i) { + const EffectParameter ¶ = effect->parameters().at(i); QVariant value = effect->parameterValue(para); QHBoxLayout *pLayout = new QHBoxLayout; mainLayout->addLayout(pLayout); @@ -117,13 +118,14 @@ void EffectWidgetPrivate::autogenerateUi() control = cb; if (value.type() == QVariant::Int) { //value just defines the item index - foreach (const QVariant &item, para.possibleValues()) { - cb->addItem(item.toString()); + for (int i = 0; i < para.possibleValues().count(); ++i) { + cb->addItem(para.possibleValues().at(i).toString()); } cb->setCurrentIndex(value.toInt()); QObject::connect(cb, SIGNAL(currentIndexChanged(int)), q, SLOT(_k_setIntParameter(int))); } else { - foreach (const QVariant &item, para.possibleValues()) { + for (int i = 0; i < para.possibleValues().count(); ++i) { + const QVariant &item = para.possibleValues().at(i); cb->addItem(item.toString()); if (item == value) { cb->setCurrentIndex(cb->count() - 1); diff --git a/src/3rdparty/phonon/phonon/factory.cpp b/src/3rdparty/phonon/phonon/factory.cpp index 43c45ee..fef88f0 100644 --- a/src/3rdparty/phonon/phonon/factory.cpp +++ b/src/3rdparty/phonon/phonon/factory.cpp @@ -124,15 +124,18 @@ bool FactoryPrivate::createBackend() // could not load a backend through the platform plugin. Falling back to the default // (finding the first loadable backend). const QLatin1String suffix("/phonon_backend/"); - foreach (QString libPath, QCoreApplication::libraryPaths()) { - libPath += suffix; + const QStringList paths = QCoreApplication::libraryPaths(); + for (int i = 0; i < paths.count(); ++i) { + const QString libPath = paths.at(i) + suffix; const QDir dir(libPath); if (!dir.exists()) { pDebug() << Q_FUNC_INFO << dir.absolutePath() << "does not exist"; continue; } - foreach (const QString &pluginName, dir.entryList(QDir::Files)) { - QPluginLoader pluginLoader(libPath + pluginName); + + const QStringList files = dir.entryList(QDir::Files); + for (int i = 0; i < files.count(); ++i) { + QPluginLoader pluginLoader(libPath + files.at(i)); if (!pluginLoader.load()) { pDebug() << Q_FUNC_INFO << " load failed:" << pluginLoader.errorString(); @@ -183,14 +186,8 @@ FactoryPrivate::FactoryPrivate() FactoryPrivate::~FactoryPrivate() { - foreach (QObject *o, objects) { - MediaObject *m = qobject_cast<MediaObject *>(o); - if (m) { - m->stop(); - } - } - foreach (MediaNodePrivate *bp, mediaNodePrivateList) { - bp->deleteBackendObject(); + for (int i = 0; i < mediaNodePrivateList.count(); ++i) { + mediaNodePrivateList.at(i)->deleteBackendObject(); } if (objects.size() > 0) { pError() << "The backend objects are not deleted as was requested."; @@ -258,8 +255,8 @@ void Factory::deregisterFrontendObject(MediaNodePrivate *bp) void FactoryPrivate::phononBackendChanged() { if (m_backendObject) { - foreach (MediaNodePrivate *bp, mediaNodePrivateList) { - bp->deleteBackendObject(); + for (int i = 0; i < mediaNodePrivateList.count(); ++i) { + mediaNodePrivateList.at(i)->deleteBackendObject(); } if (objects.size() > 0) { pDebug() << "WARNING: we were asked to change the backend but the application did\n" @@ -268,8 +265,8 @@ void FactoryPrivate::phononBackendChanged() "backendswitching possible."; // in case there were objects deleted give 'em a chance to recreate // them now - foreach (MediaNodePrivate *bp, mediaNodePrivateList) { - bp->createBackendObject(); + for (int i = 0; i < mediaNodePrivateList.count(); ++i) { + mediaNodePrivateList.at(i)->createBackendObject(); } return; } @@ -277,8 +274,8 @@ void FactoryPrivate::phononBackendChanged() m_backendObject = 0; } createBackend(); - foreach (MediaNodePrivate *bp, mediaNodePrivateList) { - bp->createBackendObject(); + for (int i = 0; i < mediaNodePrivateList.count(); ++i) { + mediaNodePrivateList.at(i)->createBackendObject(); } emit backendChanged(); } @@ -362,15 +359,17 @@ PlatformPlugin *FactoryPrivate::platformPlugin() QStringList()) ); dir.setFilter(QDir::Files); + const QStringList libPaths = QCoreApplication::libraryPaths(); forever { - foreach (QString libPath, QCoreApplication::libraryPaths()) { - libPath += suffix; + for (int i = 0; i < libPaths.count(); ++i) { + const QString libPath = libPaths.at(i) + suffix; dir.setPath(libPath); if (!dir.exists()) { continue; } - foreach (const QString &pluginName, dir.entryList()) { - QPluginLoader pluginLoader(libPath + pluginName); + const QStringList files = dir.entryList(QDir::Files); + for (int i = 0; i < files.count(); ++i) { + QPluginLoader pluginLoader(libPath + files.at(i)); if (!pluginLoader.load()) { pDebug() << Q_FUNC_INFO << " platform plugin load failed:" << pluginLoader.errorString(); diff --git a/src/3rdparty/phonon/phonon/medianode.cpp b/src/3rdparty/phonon/phonon/medianode.cpp index 4693cb8..63fa2e3 100644 --- a/src/3rdparty/phonon/phonon/medianode.cpp +++ b/src/3rdparty/phonon/phonon/medianode.cpp @@ -67,8 +67,8 @@ bool MediaNode::isValid() const MediaNodePrivate::~MediaNodePrivate() { - foreach (MediaNodeDestructionHandler *handler, handlers) { - handler->phononObjectDestroyed(this); + for (int i = 0 ; i < handlers.count(); ++i) { + handlers.at(i)->phononObjectDestroyed(this); } Factory::deregisterFrontendObject(this); delete m_backendObject; diff --git a/src/3rdparty/phonon/phonon/mediaobject.cpp b/src/3rdparty/phonon/phonon/mediaobject.cpp index de5fbc8..10fefbd 100644 --- a/src/3rdparty/phonon/phonon/mediaobject.cpp +++ b/src/3rdparty/phonon/phonon/mediaobject.cpp @@ -300,15 +300,15 @@ void MediaObject::enqueue(const MediaSource &source) void MediaObject::enqueue(const QList<MediaSource> &sources) { - foreach (const MediaSource &m, sources) { - enqueue(m); + for (int i = 0; i < sources.count(); ++i) { + enqueue(sources.at(i)); } } void MediaObject::enqueue(const QList<QUrl> &urls) { - foreach (const QUrl &url, urls) { - enqueue(url); + for (int i = 0; i < urls.count(); ++i) { + enqueue(urls.at(i)); } } @@ -502,8 +502,8 @@ void MediaObjectPrivate::setupBackendObject() } #ifndef QT_NO_PHONON_MEDIACONTROLLER - foreach (FrontendInterfacePrivate *f, interfaceList) { - f->_backendObjectChanged(); + for (int i = 0 ; i < interfaceList.count(); ++i) { + interfaceList.at(i)->_backendObjectChanged(); } #endif //QT_NO_PHONON_MEDIACONTROLLER diff --git a/src/3rdparty/phonon/phonon/objectdescriptionmodel.cpp b/src/3rdparty/phonon/phonon/objectdescriptionmodel.cpp index e989d0c..b67344f 100644 --- a/src/3rdparty/phonon/phonon/objectdescriptionmodel.cpp +++ b/src/3rdparty/phonon/phonon/objectdescriptionmodel.cpp @@ -321,8 +321,8 @@ bool ObjectDescriptionModelData::dropMimeData(ObjectDescriptionType type, const } } d->model->beginInsertRows(QModelIndex(), row, row + toInsert.size() - 1); - foreach (const QExplicitlySharedDataPointer<ObjectDescriptionData> &obj, toInsert) { - d->data.insert(row, obj); + for (int i = 0 ; i < toInsert.count(); ++i) { + d->data.insert(row, toInsert.at(i)); } d->model->endInsertRows(); return true; diff --git a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h index 84dc0bb..ba3cb42 100644 --- a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h +++ b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h @@ -292,8 +292,8 @@ namespace Phonon */ inline void setModelData(const QList<ObjectDescription<type> > &data) { //krazy:exclude=inline QList<QExplicitlySharedDataPointer<ObjectDescriptionData> > list; - Q_FOREACH (const ObjectDescription<type> &desc, data) { - list << desc.d; + for (int i = 0; i < data.count(); ++i) { + list += data.at(i).d; } d->setModelData(list); } @@ -307,8 +307,8 @@ namespace Phonon inline QList<ObjectDescription<type> > modelData() const { //krazy:exclude=inline QList<ObjectDescription<type> > ret; QList<QExplicitlySharedDataPointer<ObjectDescriptionData> > list = d->modelData(); - Q_FOREACH (const QExplicitlySharedDataPointer<ObjectDescriptionData> &data, list) { - ret << ObjectDescription<type>(data); + for (int i = 0; i < list.count(); ++i) { + ret << ObjectDescription<type>(list.at(i)); } return ret; } diff --git a/src/3rdparty/phonon/phonon/path.cpp b/src/3rdparty/phonon/phonon/path.cpp index b46d30a..aec8d05 100644 --- a/src/3rdparty/phonon/phonon/path.cpp +++ b/src/3rdparty/phonon/phonon/path.cpp @@ -58,8 +58,8 @@ class ConnectionTransaction PathPrivate::~PathPrivate() { #ifndef QT_NO_PHONON_EFFECT - foreach (Effect *e, effects) { - e->k_ptr->removeDestructionHandler(this); + for (int i = 0; i < effects.count(); ++i) { + effects.at(i)->k_ptr->removeDestructionHandler(this); } delete effectsParent; #endif @@ -233,8 +233,8 @@ bool Path::disconnect() if (d->sourceNode) list << d->sourceNode->k_ptr->backendObject(); #ifndef QT_NO_PHONON_EFFECT - foreach(Effect *e, d->effects) { - list << e->k_ptr->backendObject(); + for (int i = 0; i < d->effects.count(); ++i) { + list << d->effects.at(i)->k_ptr->backendObject(); } #endif if (d->sinkNode) { @@ -260,8 +260,8 @@ bool Path::disconnect() d->sourceNode = 0; #ifndef QT_NO_PHONON_EFFECT - foreach(Effect *e, d->effects) { - e->k_ptr->removeDestructionHandler(d.data()); + for (int i = 0; i < d->effects.count(); ++i) { + d->effects.at(i)->k_ptr->removeDestructionHandler(d.data()); } d->effects.clear(); #endif @@ -292,11 +292,13 @@ MediaNode *Path::sink() const bool PathPrivate::executeTransaction( const QList<QObjectPair> &disconnections, const QList<QObjectPair> &connections) { QSet<QObject*> nodesForTransaction; - foreach(const QObjectPair &pair, disconnections) { + for (int i = 0; i < disconnections.count(); ++i) { + const QObjectPair &pair = disconnections.at(i); nodesForTransaction << pair.first; nodesForTransaction << pair.second; } - foreach(const QObjectPair &pair, connections) { + for (int i = 0; i < connections.count(); ++i) { + const QObjectPair &pair = connections.at(i); nodesForTransaction << pair.first; nodesForTransaction << pair.second; } @@ -338,7 +340,8 @@ bool PathPrivate::executeTransaction( const QList<QObjectPair> &disconnections, } //and now let's reconnect the nodes that were disconnected: rollback - foreach(const QObjectPair &pair, disconnections) { + for (int i = 0; i < disconnections.count(); ++i) { + const QObjectPair &pair = disconnections.at(i); bool success = backend->connectNodes(pair.first, pair.second); Q_ASSERT(success); //a failure here means it is impossible to reestablish the connection Q_UNUSED(success); @@ -417,7 +420,8 @@ void PathPrivate::phononObjectDestroyed(MediaNodePrivate *mediaNodePrivate) sinkNode = 0; } else { #ifndef QT_NO_PHONON_EFFECT - foreach (Effect *e, effects) { + for (int i = 0; i < effects.count(); ++i) { + Effect *e = effects.at(i); if (e->k_ptr == mediaNodePrivate) { removeEffect(e); } |