Skip to content

Commit

Permalink
const range loop iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Nov 6, 2017
1 parent d9b4ae5 commit af57600
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion python/core/qgserror.sip
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions src/app/qgsversionmigration.cpp
Expand Up @@ -58,23 +58,26 @@ 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 );
}
}
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 );
}
}
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 );
}
Expand Down Expand Up @@ -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( ) )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgserror.h
Expand Up @@ -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
Expand Down

0 comments on commit af57600

Please sign in to comment.