@@ -1082,7 +1082,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
1082
1082
1083
1083
mMapCanvas ->freeze ( false );
1084
1084
mMapCanvas ->clearExtentHistory (); // reset zoomnext/zoomlast
1085
- mLastComposerId = 0 ;
1086
1085
1087
1086
QShortcut *zoomInShortCut = new QShortcut ( QKeySequence ( tr ( " Ctrl++" ) ), this );
1088
1087
connect ( zoomInShortCut, &QShortcut::activated, mMapCanvas , &QgsMapCanvas::zoomIn );
@@ -1268,7 +1267,6 @@ QgisApp::QgisApp()
1268
1267
, mMapStyleWidget ( nullptr )
1269
1268
, mComposerManager ( nullptr )
1270
1269
, mpTileScaleWidget( nullptr )
1271
- , mLastComposerId ( 0 )
1272
1270
, mpGpsWidget( nullptr )
1273
1271
, mLastMapToolMessage ( nullptr )
1274
1272
, mLogViewer ( nullptr )
@@ -6957,6 +6955,7 @@ bool QgisApp::uniqueComposerTitle( QWidget *parent, QString &composerTitle, bool
6957
6955
else
6958
6956
{
6959
6957
titleValid = true ;
6958
+ newTitle = QgsProject::instance ()->layoutManager ()->generateUniqueTitle ();
6960
6959
}
6961
6960
}
6962
6961
else if ( cNames.indexOf ( newTitle, 1 ) >= 0 )
@@ -6977,11 +6976,9 @@ bool QgisApp::uniqueComposerTitle( QWidget *parent, QString &composerTitle, bool
6977
6976
6978
6977
QgsComposer *QgisApp::createNewComposer ( QString title )
6979
6978
{
6980
- // ask user about name
6981
- mLastComposerId ++;
6982
6979
if ( title.isEmpty () )
6983
6980
{
6984
- title = tr ( " Composer %1 " ). arg ( mLastComposerId );
6981
+ title = QgsProject::instance ()-> layoutManager ()-> generateUniqueTitle ( );
6985
6982
}
6986
6983
// create new composition object
6987
6984
QgsComposition *composition = new QgsComposition ( QgsProject::instance () );
@@ -7060,7 +7057,6 @@ void QgisApp::deletePrintComposers()
7060
7057
emit composerRemoved ( c->view () );
7061
7058
delete ( c );
7062
7059
}
7063
- mLastComposerId = 0 ;
7064
7060
}
7065
7061
7066
7062
void QgisApp::composerMenuAboutToShow ()
0 commit comments