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
(cherry-picked from 20d9427)
  • Loading branch information
nyalldawson committed Mar 19, 2018
1 parent c167567 commit d225753
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 @@ -9167,7 +9167,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 @@ -9231,6 +9231,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 @@ -9265,7 +9267,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 d225753

Please sign in to comment.