Commit 73f1c63d authored by David Faure's avatar David Faure

backport: fix compilation with strict iterators (to avoid detaching)

svn path=/branches/KDE/4.5/kdegames/palapeli/; revision=1145036
parent 5fd43ae2
......@@ -60,7 +60,7 @@ void Palapeli::InteractorManager::handleEvent(QWheelEvent* event)
//check which interactors are triggered by this event
Palapeli::Interactor* bestMatchInteractor = 0;
int bestMatchPriority = -1;
QMap<QByteArray, Palapeli::Interactor*>::const_iterator it1 = m_interactors.begin(), it2 = m_interactors.end();
QMap<QByteArray, Palapeli::Interactor*>::const_iterator it1 = m_interactors.constBegin(), it2 = m_interactors.constEnd();
for (; it1 != it2; ++it1)
{
Palapeli::Interactor* const interactor = it1.value();
......@@ -99,7 +99,7 @@ void Palapeli::InteractorManager::handleEvent(QMouseEvent* event)
m_mousePos = event->pos();
//check which interactors are triggered by this event
QMap<Palapeli::Interactor*, Palapeli::EventContext> interactorData;
QMap<QByteArray, Palapeli::Interactor*>::const_iterator it1 = m_interactors.begin(), it2 = m_interactors.end();
QMap<QByteArray, Palapeli::Interactor*>::const_iterator it1 = m_interactors.constBegin(), it2 = m_interactors.constEnd();
for (; it1 != it2; ++it1)
interactorData[it1.value()] = Palapeli::TriggerMapper::instance()->testTrigger(it1.key(), event);
//further processing in a method which is shared with the KeyEvent handler
......@@ -115,7 +115,7 @@ void Palapeli::InteractorManager::handleEvent(QKeyEvent* event)
Palapeli::MouseEvent pEvent(m_view, m_mousePos);
//check which interactors are triggered by this event
QMap<Palapeli::Interactor*, Palapeli::EventContext> interactorData;
QMap<QByteArray, Palapeli::Interactor*>::const_iterator it1 = m_interactors.begin(), it2 = m_interactors.end();
QMap<QByteArray, Palapeli::Interactor*>::const_iterator it1 = m_interactors.constBegin(), it2 = m_interactors.constEnd();
for (; it1 != it2; ++it1)
interactorData[it1.value()] = Palapeli::TriggerMapper::instance()->testTrigger(it1.key(), event, m_buttons);
//further processing in a method which is shared with the MouseEvent handler
......
......@@ -105,7 +105,7 @@ void Palapeli::TriggerMapper::setAssociations(const QMap<QByteArray, Palapeli::T
//assemble trigger serializations
QMap<QByteArray, QList<QByteArray> > triggerSerializations;
{
QMap<QByteArray, Palapeli::Trigger>::const_iterator it1 = m_associations.begin(), it2 = m_associations.end();
QMap<QByteArray, Palapeli::Trigger>::const_iterator it1 = m_associations.constBegin(), it2 = m_associations.constEnd();
for (; it1 != it2; ++it1)
triggerSerializations[it1.key()] << it1.value().serialized();
}
......@@ -114,7 +114,7 @@ void Palapeli::TriggerMapper::setAssociations(const QMap<QByteArray, Palapeli::T
foreach (const QString& key, group.keyList())
group.deleteEntry(key);
//write config (in a way that supports multiple triggers for one interactor)
QMap<QByteArray, QList<QByteArray> >::const_iterator it1 = triggerSerializations.begin(), it2 = triggerSerializations.end();
QMap<QByteArray, QList<QByteArray> >::const_iterator it1 = triggerSerializations.constBegin(), it2 = triggerSerializations.constEnd();
for (; it1 != it2; ++it1)
group.writeEntry(it1.key().data(), it1.value());
KGlobal::config()->sync();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment