const range loop iterators

This commit is contained in:
Alessandro Pasotti 2017-11-06 15:09:15 +01:00
parent d9b4ae56bd
commit af5760044a
3 changed files with 8 additions and 7 deletions

View File

@ -123,7 +123,7 @@ class QgsError
Clear error messages
%End
const QList<QgsErrorMessage> messageList();
const QList<QgsErrorMessage> messageList() const;
%Docstring
messageList return the list of current error messages
:return: current list of error messages

View File

@ -58,7 +58,8 @@ QgsError Qgs2To3Migration::runMigration()
QgsError settingsErrors = migrateSettings();
if ( !settingsErrors.isEmpty() )
{
for ( const auto &err : settingsErrors.messageList( ) )
const QList<QgsErrorMessage> errorList( settingsErrors.messageList( ) );
for ( const auto &err : errorList )
{
errors.append( err );
}
@ -66,7 +67,8 @@ QgsError Qgs2To3Migration::runMigration()
QgsError stylesErrors = migrateStyles();
if ( !stylesErrors.isEmpty() )
{
for ( const auto &err : stylesErrors.messageList( ) )
const QList<QgsErrorMessage> errorList( stylesErrors.messageList( ) );
for ( const auto &err : errorList )
{
errors.append( err );
}
@ -74,7 +76,8 @@ QgsError Qgs2To3Migration::runMigration()
QgsError authDbErrors = migrateAuthDb();
if ( !authDbErrors.isEmpty() )
{
for ( const auto &err : authDbErrors.messageList( ) )
const QList<QgsErrorMessage> errorList( authDbErrors.messageList( ) );
for ( const auto &err : errorList )
{
errors.append( err );
}
@ -280,8 +283,6 @@ QgsError Qgs2To3Migration::migrateAuthDb()
}
else
{
QgsDebugMsg( QStringLiteral( "OLD AUTH DB FILE %1" ).arg( oldAuthDbFilePath ) );
QgsDebugMsg( QStringLiteral( "NEW AUTH DB FILE %1" ).arg( newAuthDbFilePath ) );
QFile oldDbFile( oldAuthDbFilePath );
if ( oldDbFile.exists( ) )
{

View File

@ -132,7 +132,7 @@ class CORE_EXPORT QgsError
* \brief messageList return the list of current error messages
* \return current list of error messages
*/
const QList<QgsErrorMessage> messageList() { return mMessageList; }
const QList<QgsErrorMessage> messageList() const { return mMessageList; }
private:
//! List of messages