{
QStringList boxNameList;
- foreach( LeitnerBox box, m_boxes )
+ foreach( const LeitnerBox &box, m_boxes )
boxNameList.append( box.boxName() );
return boxNameList;
return &m_boxes[ number ];
}
-LeitnerBox* LeitnerSystem::boxWithName( const QString& name ) const
+LeitnerBox* LeitnerSystem::boxWithName( const QString& name )
{
- foreach( LeitnerBox box, m_boxes )
+ QList<LeitnerBox>::iterator it, it2;
+ it = m_boxes.begin();
+ it2 = m_boxes.end();
+ for ( ; it != it2; ++it)
{
- if ( box.boxName() == name )
- return &box;
+ if ( (*it).boxName() == name )
+ return &(*it);
}
return 0;
return m_systemName;
}
-const QString& LeitnerSystem::nextBox( QString& previousBox )
+QString LeitnerSystem::nextBox( QString& previousBox )
{
for( int i = 0; i < m_boxes.count(); i++ )
{
* @return a pointer to the LeitnerBox with the name,
* or 0 if no such box exists.
*/
- LeitnerBox* boxWithName( const QString& name ) const;
+ LeitnerBox* boxWithName( const QString& name );
/**Returns the number of the given LeitnerBox
* @param box a pointer to the LeitnerBox
* @param previousBox the name of the LeitnerBox
* @return the name of the LeitnerBox following previousBox
*/
- const QString& nextBox( QString& previousBox );
+ QString nextBox( QString& previousBox );
const QString& correctBox( int box ); //returns the correct word box of "int box"
const QString& wrongBox( int box ); //returns the wrong word box of "int box"