Skip to content

Commit

Permalink
Use Q_FOREACH macro with scales
Browse files Browse the repository at this point in the history
  • Loading branch information
SebDieBln committed Dec 11, 2015
1 parent 3e18fda commit 44fae1a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,11 +687,10 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl ) :
if ( !myPaths.isEmpty() )
{
QStringList myScalesList = myPaths.split( ',' );
QStringList::const_iterator scaleIt = myScalesList.constBegin();
for ( ; scaleIt != myScalesList.constEnd(); ++scaleIt )
Q_FOREACH ( const QString& scale, myScalesList )
{
QListWidgetItem* newItem = new QListWidgetItem( mListGlobalScales );
newItem->setText( *scaleIt );
newItem->setText( scale );
newItem->setFlags( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
mListGlobalScales->addItem( newItem );
}
Expand Down Expand Up @@ -1943,11 +1942,10 @@ void QgsOptions::on_pbnDefaultScaleValues_clicked()
mListGlobalScales->clear();

QStringList myScalesList = PROJECT_SCALES.split( ',' );
QStringList::const_iterator scaleIt = myScalesList.constBegin();
for ( ; scaleIt != myScalesList.constEnd(); ++scaleIt )
Q_FOREACH ( const QString& scale, myScalesList )
{
QListWidgetItem* newItem = new QListWidgetItem( mListGlobalScales );
newItem->setText( *scaleIt );
newItem->setText( scale );
newItem->setFlags( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
mListGlobalScales->addItem( newItem );
}
Expand All @@ -1969,11 +1967,10 @@ void QgsOptions::on_pbnImportScales_clicked()
QgsDebugMsg( msg );
}

QStringList::const_iterator scaleIt = myScales.constBegin();
for ( ; scaleIt != myScales.constEnd(); ++scaleIt )
Q_FOREACH ( const QString& scale, myScales )
{
QListWidgetItem* newItem = new QListWidgetItem( mListGlobalScales );
newItem->setText( *scaleIt );
newItem->setText( scale );
newItem->setFlags( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
mListGlobalScales->addItem( newItem );
}
Expand Down

0 comments on commit 44fae1a

Please sign in to comment.