Commit 3cce7018 authored by David Faure's avatar David Faure
Browse files

avoid detaching (fix compilation with strict iterators)

svn path=/trunk/KDE/kdegames/palapeli/; revision=1062502
parent 0f3e4cb7
...@@ -171,8 +171,8 @@ void Palapeli::Scene::finishLoading() ...@@ -171,8 +171,8 @@ void Palapeli::Scene::finishLoading()
{ {
//read piece positions from savegame //read piece positions from savegame
KConfigGroup saveGroup(&saveConfig, "SaveGame"); KConfigGroup saveGroup(&saveConfig, "SaveGame");
QMap<int, Palapeli::Piece*>::const_iterator iterPieces = m_pieces.begin(); QMap<int, Palapeli::Piece*>::const_iterator iterPieces = m_pieces.constBegin();
const QMap<int, Palapeli::Piece*>::const_iterator iterPiecesEnd = m_pieces.end(); const QMap<int, Palapeli::Piece*>::const_iterator iterPiecesEnd = m_pieces.constEnd();
for (int pieceID = iterPieces.key(); iterPieces != iterPiecesEnd; pieceID = (++iterPieces).key()) for (int pieceID = iterPieces.key(); iterPieces != iterPiecesEnd; pieceID = (++iterPieces).key())
{ {
Palapeli::Part* part = iterPieces.value()->part(); Palapeli::Part* part = iterPieces.value()->part();
...@@ -253,8 +253,8 @@ void Palapeli::Scene::partMoved() ...@@ -253,8 +253,8 @@ void Palapeli::Scene::partMoved()
static const QString pathTemplate = QString::fromLatin1("collection/%1.save"); static const QString pathTemplate = QString::fromLatin1("collection/%1.save");
KConfig saveConfig(KStandardDirs::locateLocal("appdata", pathTemplate.arg(m_identifier))); KConfig saveConfig(KStandardDirs::locateLocal("appdata", pathTemplate.arg(m_identifier)));
KConfigGroup saveGroup(&saveConfig, "SaveGame"); KConfigGroup saveGroup(&saveConfig, "SaveGame");
QMap<int, Palapeli::Piece*>::const_iterator iterPieces = m_pieces.begin(); QMap<int, Palapeli::Piece*>::const_iterator iterPieces = m_pieces.constBegin();
const QMap<int, Palapeli::Piece*>::const_iterator iterPiecesEnd = m_pieces.end(); const QMap<int, Palapeli::Piece*>::const_iterator iterPiecesEnd = m_pieces.constEnd();
for (int pieceID = iterPieces.key(); iterPieces != iterPiecesEnd; pieceID = (++iterPieces).key()) for (int pieceID = iterPieces.key(); iterPieces != iterPiecesEnd; pieceID = (++iterPieces).key())
saveGroup.writeEntry(QString::number(pieceID), iterPieces.value()->part()->pos()); saveGroup.writeEntry(QString::number(pieceID), iterPieces.value()->part()->pos());
} }
......
...@@ -171,8 +171,8 @@ bool Palapeli::Puzzle::readContents(bool force) ...@@ -171,8 +171,8 @@ bool Palapeli::Puzzle::readContents(bool force)
m_contents->pieceOffsets[pieceIndex] = offsetGroup.readEntry(offsetGroupIterator.key(), QPoint()); m_contents->pieceOffsets[pieceIndex] = offsetGroup.readEntry(offsetGroupIterator.key(), QPoint());
} }
//load pieces //load pieces
QMap<int, QPoint>::const_iterator iterOffsets = m_contents->pieceOffsets.begin(); QMap<int, QPoint>::const_iterator iterOffsets = m_contents->pieceOffsets.constBegin();
const QMap<int, QPoint>::const_iterator iterOffsetsEnd = m_contents->pieceOffsets.end(); const QMap<int, QPoint>::const_iterator iterOffsetsEnd = m_contents->pieceOffsets.constEnd();
for (int pieceID = iterOffsets.key(); iterOffsets != iterOffsetsEnd; pieceID = (++iterOffsets).key()) for (int pieceID = iterOffsets.key(); iterOffsets != iterOffsetsEnd; pieceID = (++iterOffsets).key())
m_contents->pieces[pieceID].load(m_cache->name() + QString("%1.png").arg(pieceID)); m_contents->pieces[pieceID].load(m_cache->name() + QString("%1.png").arg(pieceID));
//load relations //load relations
......
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