data.append( iter.key() + " = " + iter.value() );
data.append( "" );
- for ( QStringList::const_iterator itr = data.begin(); itr != data.end(); ++itr )
+ for ( QStringList::ConstIterator itr = data.begin(); itr != data.end(); ++itr )
ts << *itr << endl;
}
QTextStream ts( &file );
QStringList docStr = doc.toString().split( "\n" );
- for ( QStringList::const_iterator itr = docStr.begin(); itr != docStr.end(); ++itr )
+ for ( QStringList::ConstIterator itr = docStr.begin(); itr != docStr.end(); ++itr )
ts << *itr << endl;
file.close();
QtxResourceMgr::~QtxResourceMgr()
{
QStringList prefList = myTranslator.keys();
- for ( QStringList::const_iterator it = prefList.begin(); it != prefList.end(); ++it )
+ for ( QStringList::ConstIterator it = prefList.begin(); it != prefList.end(); ++it )
removeTranslators( *it );
- for ( ResList::iterator resIt = myResources.begin(); resIt != myResources.end(); ++resIt )
- delete *resIt;
- myResources.clear();
- for ( FormatList::iterator formIt = myFormats.begin(); formIt != myFormats.end(); ++formIt )
- delete *formIt;
+
+ qDeleteAll( myResources );
+ qDeleteAll( myFormats );
delete myDefaultPix;
}
if ( loadUser && !userFileName( appName() ).isEmpty() )
that->myResources.append( new Resources( that, userFileName( appName() ) ) );
- for ( QStringList::const_iterator it = myDirList.begin(); it != myDirList.end(); ++it )
+ for ( QStringList::ConstIterator it = myDirList.begin(); it != myDirList.end(); ++it )
{
QString path = Qtx::addSlash( *it ) + globalFileName( appName() );
that->myResources.append( new Resources( that, path ) );
*/
void QtxResourceMgr::clear()
{
- for ( ResList::iterator it = myResources.begin(); it != myResources.end(); ++it )
+ for ( ResList::Iterator it = myResources.begin(); it != myResources.end(); ++it )
(*it)->clear();
}
baVal.clear();
QStringList lst = val.split( QRegExp( "[\\s|,]" ), QString::SkipEmptyParts );
- for ( QStringList::const_iterator it = lst.begin(); it != lst.end(); ++it )
+ for ( QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it )
{
int base = 10;
QString str = *it;
bool ok = false;
- ResList::const_iterator it = myResources.begin();
+ ResList::ConstIterator it = myResources.begin();
if ( ignoreUserValues() )
++it;
initialize();
bool ok = false;
- for ( ResList::const_iterator it = myResources.begin(); it != myResources.end() && !ok; ++it )
+ for ( ResList::ConstIterator it = myResources.begin(); it != myResources.end() && !ok; ++it )
ok = (*it)->hasValue( sect, name );
return ok;
initialize();
bool ok = false;
- for ( ResList::const_iterator it = myResources.begin(); it != myResources.end() && !ok; ++it )
+ for ( ResList::ConstIterator it = myResources.begin(); it != myResources.end() && !ok; ++it )
ok = (*it)->hasSection( sect );
return ok;
{
initialize();
- for ( ResList::iterator it = myResources.begin(); it != myResources.end(); ++it )
+ for ( ResList::Iterator it = myResources.begin(); it != myResources.end(); ++it )
(*it)->removeSection( sect );
}
{
initialize();
- for ( ResList::iterator it = myResources.begin(); it != myResources.end(); ++it )
+ for ( ResList::Iterator it = myResources.begin(); it != myResources.end(); ++it )
(*it)->removeValue( sect, name );
}
if ( myResources.isEmpty() )
return;
- ResList::iterator resIt = myResources.begin();
+ ResList::Iterator resIt = myResources.begin();
if ( myResources.count() > myDirList.count() && resIt != myResources.end() )
{
(*resIt)->setFile( userFileName( appName() ) );
++resIt;
}
- for ( QStringList::const_iterator it = myDirList.begin(); it != myDirList.end() && resIt != myResources.end(); ++it, ++resIt )
+ for ( QStringList::ConstIterator it = myDirList.begin(); it != myDirList.end() && resIt != myResources.end(); ++it, ++resIt )
(*resIt)->setFile( Qtx::addSlash( *it ) + globalFileName( appName() ) );
}
QtxResourceMgr::Format* QtxResourceMgr::format( const QString& fmt ) const
{
Format* form = 0;
- for ( FormatList::const_iterator it = myFormats.begin(); it != myFormats.end() && !form; ++it )
+ for ( FormatList::ConstIterator it = myFormats.begin(); it != myFormats.end() && !form; ++it )
{
if ( (*it)->format() == fmt )
form = *it;
return false;
bool res = true;
- for ( ResList::iterator it = myResources.begin(); it != myResources.end(); ++it )
+ for ( ResList::Iterator it = myResources.begin(); it != myResources.end(); ++it )
res = fmt->load( *it ) && res;
return res;
initialize();
QMap<QString, int> map;
- for ( ResList::const_iterator it = myResources.begin(); it != myResources.end(); ++it )
+ for ( ResList::ConstIterator it = myResources.begin(); it != myResources.end(); ++it )
{
QStringList lst = (*it)->sections();
- for ( QStringList::const_iterator itr = lst.begin(); itr != lst.end(); ++itr )
+ for ( QStringList::ConstIterator itr = lst.begin(); itr != lst.end(); ++itr )
map.insert( *itr, 0 );
}
typedef IMap<QString, int> PMap;
#endif
PMap pmap;
- ResList lst;
- for ( ResList::const_iterator itr = myResources.begin(); itr != myResources.end(); ++itr )
- lst.prepend( *itr );
- for ( ResList::const_iterator it = lst.begin(); it != lst.end(); ++it )
+ ResList::ConstIterator it = myResources.end();
+ while ( it != myResources.begin() )
{
+ --it;
QStringList lst = (*it)->parameters( sec );
- for ( QStringList::const_iterator itr = lst.begin(); itr != lst.end(); ++itr )
+ for ( QStringList::ConstIterator itr = lst.begin(); itr != lst.end(); ++itr )
pmap.insert( *itr, 0, false );
}
QString QtxResourceMgr::path( const QString& sect, const QString& prefix, const QString& name ) const
{
QString res;
- for ( ResList::const_iterator it = myResources.begin(); it != myResources.end() && res.isEmpty(); ++it )
+ for ( ResList::ConstIterator it = myResources.begin(); it != myResources.end() && res.isEmpty(); ++it )
res = (*it)->path( sect, prefix, name );
return res;
}
initialize();
QPixmap pix;
- for ( ResList::const_iterator it = myResources.begin(); it != myResources.end() && pix.isNull(); ++it )
+ for ( ResList::ConstIterator it = myResources.begin(); it != myResources.end() && pix.isNull(); ++it )
pix = (*it)->loadPixmap( resSection(), prefix, name );
if ( pix.isNull() )
pix = defPix;
else
prefixList = parameters( resSection() );
- for ( QStringList::const_iterator iter = prefixList.begin(); iter != prefixList.end(); ++iter )
+ for ( QStringList::ConstIterator iter = prefixList.begin(); iter != prefixList.end(); ++iter )
{
QString prefix = *iter;
substMap.insert( 'P', prefix );
QStringList trs;
- for ( QStringList::const_iterator it = trList.begin(); it != trList.end(); ++it )
+ for ( QStringList::ConstIterator it = trList.begin(); it != trList.end(); ++it )
trs.append( substMacro( *it, substMap ).trimmed() );
loadTranslators( prefix, trs );
initialize();
ResList lst;
- for ( ResList::iterator iter = myResources.begin(); iter != myResources.end(); ++iter )
+ for ( ResList::Iterator iter = myResources.begin(); iter != myResources.end(); ++iter )
lst.prepend( *iter );
QTranslator* trans = 0;
- for ( ResList::iterator it = lst.begin(); it != lst.end(); ++it )
+ for ( ResList::Iterator it = lst.begin(); it != lst.end(); ++it )
{
- for ( QStringList::const_iterator itr = translators.begin(); itr != translators.end(); ++itr )
+ for ( QStringList::ConstIterator itr = translators.begin(); itr != translators.end(); ++itr )
{
trans = (*it)->loadTranslator( resSection(), prefix, *itr );
if ( trans )
initialize();
QTranslator* trans = 0;
- ResList::iterator it = myResources.end();
- for ( ; it != myResources.begin(); --it )
+
+ ResList::ConstIterator it = myResources.end();
+ while ( it != myResources.begin() )
{
+ --it;
trans = (*it)->loadTranslator( resSection(), prefix, name );
if ( trans )
{
if ( !myTranslator.contains( prefix ) )
return;
- for ( TransList::iterator it = myTranslator[prefix].begin(); it != myTranslator[prefix].end(); ++it )
+ for ( TransList::Iterator it = myTranslator[prefix].begin(); it != myTranslator[prefix].end(); ++it )
{
QApplication::instance()->removeTranslator( *it );
delete *it;
if ( !myTranslator.contains( prefix ) )
return;
- for ( TransList::iterator it = myTranslator[prefix].begin(); it != myTranslator[prefix].end(); ++it )
+ for ( TransList::Iterator it = myTranslator[prefix].begin(); it != myTranslator[prefix].end(); ++it )
{
QApplication::instance()->removeTranslator( *it );
QApplication::instance()->installTranslator( *it );
void QtxResourceMgr::refresh()
{
QStringList sl = sections();
- for ( QStringList::const_iterator it = sl.begin(); it != sl.end(); ++it )
+ for ( QStringList::ConstIterator it = sl.begin(); it != sl.end(); ++it )
{
QStringList pl = parameters( *it );
- for ( QStringList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
+ for ( QStringList::ConstIterator itr = pl.begin(); itr != pl.end(); ++itr )
setResource( *it, *itr, stringValue( *it, *itr ) );
}
}
void QtxResourceMgr::setDirList( const QStringList& dl )
{
myDirList = dl;
- for ( ResList::iterator it = myResources.begin(); it != myResources.end(); ++it )
+ for ( ResList::Iterator it = myResources.begin(); it != myResources.end(); ++it )
delete *it;
myResources.clear();