diff --git a/doc/api_break.dox b/doc/api_break.dox index 55bcb765d34..a8032775f61 100644 --- a/doc/api_break.dox +++ b/doc/api_break.dox @@ -504,6 +504,7 @@ QgsApplication {#qgis_api_break_3_0_QgsApplication} - srsDbFilePath() was renamed to srsDatabaseFilePath() - setAuthDbDirPath() was renamed to setAuthDatabaseDirPath() - createDB() was renamed to createDatabase() +- composerTemplatePaths() was renamed to layoutTemplatePaths() QgsAttributeDialog {#qgis_api_break_3_0_QgsAttributeDialog} diff --git a/python/core/qgsapplication.sip b/python/core/qgsapplication.sip index 55861ab9fd0..6b71912f1f4 100644 --- a/python/core/qgsapplication.sip +++ b/python/core/qgsapplication.sip @@ -275,9 +275,11 @@ Returns the path to the srs.db file. Returns the paths to svg directories. %End - static QStringList composerTemplatePaths(); + static QStringList layoutTemplatePaths(); %Docstring -Returns the paths to composer template directories +Returns the paths to layout template directories. + +.. versionadded:: 3.0 %End static QMap systemEnvVars(); diff --git a/src/app/layout/qgslayoutmanagerdialog.cpp b/src/app/layout/qgslayoutmanagerdialog.cpp index b8241e0b553..fc73c7e04cc 100644 --- a/src/app/layout/qgslayoutmanagerdialog.cpp +++ b/src/app/layout/qgslayoutmanagerdialog.cpp @@ -169,7 +169,7 @@ QMap QgsLayoutManagerDialog::defaultTemplates( bool fromUser ) QMap QgsLayoutManagerDialog::otherTemplates() const { QMap templateMap; - QStringList paths = QgsApplication::composerTemplatePaths(); + QStringList paths = QgsApplication::layoutTemplatePaths(); Q_FOREACH ( const QString &path, paths ) { QMap templates = templatesFromPath( path ); diff --git a/src/app/qgsoptions.cpp b/src/app/qgsoptions.cpp index dc89e381781..3331454de54 100644 --- a/src/app/qgsoptions.cpp +++ b/src/app/qgsoptions.cpp @@ -277,7 +277,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QListitem( i )->text(); } - mSettings->setValue( QStringLiteral( "composer/searchPathsForTemplates" ), pathsList ); + mSettings->setValue( QStringLiteral( "Layout/searchPathsForTemplates" ), pathsList, QgsSettings::Core ); pathsList.clear(); for ( int i = 0; i < mListHiddenBrowserPaths->count(); ++i ) diff --git a/src/core/qgsapplication.cpp b/src/core/qgsapplication.cpp index 2a1dcca82f4..468156be954 100644 --- a/src/core/qgsapplication.cpp +++ b/src/core/qgsapplication.cpp @@ -784,12 +784,12 @@ QStringList QgsApplication::svgPaths() return paths; } -QStringList QgsApplication::composerTemplatePaths() +QStringList QgsApplication::layoutTemplatePaths() { - //local directories to search when looking for an SVG with a given basename + //local directories to search when looking for an template with a given basename //defined by user in options dialog QgsSettings settings; - QStringList pathList = settings.value( QStringLiteral( "composer/searchPathsForTemplates" ) ).toStringList(); + QStringList pathList = settings.value( QStringLiteral( "Layout/searchPathsForTemplates" ), QVariant(), QgsSettings::Core ).toStringList(); return pathList; } diff --git a/src/core/qgsapplication.h b/src/core/qgsapplication.h index 032b05be489..8c2963a6973 100644 --- a/src/core/qgsapplication.h +++ b/src/core/qgsapplication.h @@ -278,8 +278,11 @@ class CORE_EXPORT QgsApplication : public QApplication //! Returns the paths to svg directories. static QStringList svgPaths(); - //! Returns the paths to composer template directories - static QStringList composerTemplatePaths(); + /** + * Returns the paths to layout template directories. + * \since QGIS 3.0 + */ + static QStringList layoutTemplatePaths(); //! Returns the system environment variables passed to application. static QMap systemEnvVars() { return ABISYM( mSystemEnvVars ); }