* One leak less (in the parser)
* one more qDebugAll
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=597227
Glossary::~Glossary()
{
- foreach ( GlossaryItem * item, m_itemlist ) {
- delete item;
- item = 0;
- }
+ qDeleteAll(m_itemlist);
}
void Glossary::init( const KUrl& url, const QString& path )
void
ElementCountMap::multiply(int _factor)
{
- Iterator it = begin();
- Iterator itEnd = end();
-
- for (; it != itEnd; ++it)
- (*it)->multiply(_factor);
+ foreach (ElementCount * count, m_map) {
+ count->multiply(_factor);
+ }
}
MoleculeParser::~MoleculeParser()
{
- //Parser::~Parser();
+ qDeleteAll(m_elementList);
}
/**
* Clear the map of ElementCount pointers
*/
- void clear() { m_map.clear(); }
+ void clear(){
+ m_map.clear();
+ }
/**
* @param _element the searched Element
*/
void multiply(int _factor);
- /**
- * typedef
- */
- typedef QList<ElementCount*>::Iterator Iterator;
-
- /**
- *
- */
- Iterator begin() { return m_map.begin(); }
-
- /**
- *
- */
- Iterator end() { return m_map.end(); }
+ QList<ElementCount*> map(){
+ return m_map;
+ }
private:
QList<ElementCount*> m_map;