Skip to content

Commit

Permalink
Fix missing '(copy)' suffix on names of newly duplicated layers
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 19, 2018
1 parent 732c526 commit 20d9427
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9234,7 +9234,7 @@ void QgisApp::duplicateLayers( const QList<QgsMapLayer *> &lyrList )
QString layerDupName, unSppType;
QList<QgsMessageBarItem *> msgBars;

Q_FOREACH ( QgsMapLayer *selectedLyr, selectedLyrs )
for ( QgsMapLayer *selectedLyr : selectedLyrs )
{
dupLayer = nullptr;
unSppType.clear();
Expand Down Expand Up @@ -9298,6 +9298,8 @@ void QgisApp::duplicateLayers( const QList<QgsMapLayer *> &lyrList )
continue;
}

dupLayer->setName( layerDupName );

// add layer to layer registry and legend
QList<QgsMapLayer *> myList;
myList << dupLayer;
Expand Down Expand Up @@ -9332,7 +9334,7 @@ void QgisApp::duplicateLayers( const QList<QgsMapLayer *> &lyrList )
freezeCanvases( false );

// display errors in message bar after duplication of layers
Q_FOREACH ( QgsMessageBarItem *msgBar, msgBars )
for ( QgsMessageBarItem *msgBar : qgis::as_const( msgBars ) )
{
mInfoBar->pushItem( msgBar );
}
Expand Down

0 comments on commit 20d9427

Please sign in to comment.