Skip to content
Permalink
Browse files

Rename QgsApplication::composerTemplatePaths to layoutTemplatePaths

  • Loading branch information
nyalldawson committed Jan 16, 2018
1 parent 343c070 commit 64a8bda8ccdf430d2dfae8352eb38f1cd3e6c6db
@@ -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}
@@ -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<QString, QString> systemEnvVars();
@@ -169,7 +169,7 @@ QMap<QString, QString> QgsLayoutManagerDialog::defaultTemplates( bool fromUser )
QMap<QString, QString> QgsLayoutManagerDialog::otherTemplates() const
{
QMap<QString, QString> templateMap;
QStringList paths = QgsApplication::composerTemplatePaths();
QStringList paths = QgsApplication::layoutTemplatePaths();
Q_FOREACH ( const QString &path, paths )
{
QMap<QString, QString> templates = templatesFromPath( path );
@@ -277,7 +277,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
connect( mBtnRemoveSVGPath, &QAbstractButton::clicked, this, &QgsOptions::removeSVGPath );

//local directories to search when looking for a composer templates
const QStringList composerTemplatePathList = QgsApplication::composerTemplatePaths();
const QStringList composerTemplatePathList = QgsApplication::layoutTemplatePaths();
for ( const QString &path : composerTemplatePathList )
{
QListWidgetItem *newItem = new QListWidgetItem( mListComposerTemplatePaths );
@@ -1141,7 +1141,7 @@ void QgsOptions::saveOptions()
{
pathsList << mListComposerTemplatePaths->item( 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 )
@@ -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;
}
@@ -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<QString, QString> systemEnvVars() { return ABISYM( mSystemEnvVars ); }

0 comments on commit 64a8bda

Please sign in to comment.
You can’t perform that action at this time.