From ee4d9412ccc9f6700bcf98faec8d1a2246248fdc Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 23 Apr 2012 10:38:03 +0000 Subject: [PATCH] Merge from TRIPOLI_3_2_BR branch (TRIPOLI_321 tag) --- src/Qtx/QtxResourceMgr.cxx | 114 +++++++++++++++++++------------------ 1 file changed, 58 insertions(+), 56 deletions(-) diff --git a/src/Qtx/QtxResourceMgr.cxx b/src/Qtx/QtxResourceMgr.cxx index bd60be944..cd70c4858 100644 --- a/src/Qtx/QtxResourceMgr.cxx +++ b/src/Qtx/QtxResourceMgr.cxx @@ -393,7 +393,7 @@ QPixmap QtxResourceMgr::Resources::loadPixmap( const QString& sect, const QStrin QTranslator* QtxResourceMgr::Resources::loadTranslator( const QString& sect, const QString& prefix, const QString& name ) const { QTranslator* trans = new QtxTranslator( 0 ); - QString fname = fileName( sect, prefix, name ); + QString fname = QDir::convertSeparators( fileName( sect, prefix, name ) ); if ( !trans->load( Qtx::file( fname, false ), Qtx::dir( fname ) ) ) { delete trans; @@ -507,7 +507,7 @@ bool QtxResourceMgr::IniFormat::load( const QString& fname, QMap& secMap, QSet& importHistory) +bool QtxResourceMgr::IniFormat::load( const QString& fname, QMap& secMap, QSet& importHistory ) { QString aFName = fname.trimmed(); if ( !QFileInfo( aFName ).exists() ) @@ -580,9 +580,10 @@ bool QtxResourceMgr::IniFormat::load( const QString& fname, QMap impMap; if ( !load( impFInfo.absoluteFilePath(), impMap, importHistory ) ) @@ -591,34 +592,34 @@ bool QtxResourceMgr::IniFormat::load( const QString& fname, QMap::const_iterator it = impMap.constBegin(); - for ( ; it != impMap.constEnd() ; ++it ) - { - if ( !secMap.contains( it.key() ) ) - { - // insert full section - secMap.insert( it.key(), it.value() ); - } - else - { - // insert all parameters from the section - Section::ConstIterator paramIt = it.value().begin(); - for ( ; paramIt != it.value().end() ; ++paramIt ) - { - if ( !secMap[it.key()].contains( paramIt.key() ) ) - secMap[it.key()].insert( paramIt.key(), paramIt.value() ); - } - } - } + QMap::const_iterator it = impMap.constBegin(); + for ( ; it != impMap.constEnd() ; ++it ) + { + if ( !secMap.contains( it.key() ) ) + { + // insert full section + secMap.insert( it.key(), it.value() ); + } + else + { + // insert all parameters from the section + Section::ConstIterator paramIt = it.value().begin(); + for ( ; paramIt != it.value().end() ; ++paramIt ) + { + if ( !secMap[it.key()].contains( paramIt.key() ) ) + secMap[it.key()].insert( paramIt.key(), paramIt.value() ); + } + } + } } } else { res = false; if ( section.isEmpty() ) - qWarning() << "QtxResourceMgr: Current section is empty"; + qWarning() << "QtxResourceMgr: Current section is empty"; else - qWarning() << "QtxResourceMgr: Error in line:" << line; + qWarning() << "QtxResourceMgr: Error in line:" << line; } } @@ -804,7 +805,7 @@ bool QtxResourceMgr::XmlFormat::load( const QString& fname, QMap impMap; if ( !load( impFInfo.absoluteFilePath(), impMap, importHistory ) ) - { - qDebug() << "QtxResourceMgr: Error with importing file:" << sectElem.attribute( nameAttribute() ); - } - else - { - QMap::const_iterator it = impMap.constBegin(); - for ( ; it != impMap.constEnd() ; ++it ) - { - if ( !secMap.contains( it.key() ) ) - { - // insert full section - secMap.insert( it.key(), it.value() ); - } - else - { - // insert all parameters from the section - Section::ConstIterator paramIt = it.value().begin(); - for ( ; paramIt != it.value().end() ; ++paramIt ) - { - if ( !secMap[it.key()].contains( paramIt.key() ) ) - secMap[it.key()].insert( paramIt.key(), paramIt.value() ); - } - } - } - } + { + qDebug() << "QtxResourceMgr: Error with importing file:" << sectElem.attribute( nameAttribute() ); + } + else + { + QMap::const_iterator it = impMap.constBegin(); + for ( ; it != impMap.constEnd() ; ++it ) + { + if ( !secMap.contains( it.key() ) ) + { + // insert full section + secMap.insert( it.key(), it.value() ); + } + else + { + // insert all parameters from the section + Section::ConstIterator paramIt = it.value().begin(); + for ( ; paramIt != it.value().end() ; ++paramIt ) + { + if ( !secMap[it.key()].contains( paramIt.key() ) ) + secMap[it.key()].insert( paramIt.key(), paramIt.value() ); + } + } + } + } } else { - qDebug() << "QtxResourceMgr: Invalid section in file:" << aFName; - res = false; + qDebug() << "QtxResourceMgr: Invalid section in file:" << aFName; + res = false; } } else -- 2.39.2