Skip to content

Commit

Permalink
Rename QgsApplication::composerTemplatePaths to layoutTemplatePaths
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 16, 2018
1 parent 343c070 commit 64a8bda
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions doc/api_break.dox
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
6 changes: 4 additions & 2 deletions python/core/qgsapplication.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/app/layout/qgslayoutmanagerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 )
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
7 changes: 5 additions & 2 deletions src/core/qgsapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ); }
Expand Down

0 comments on commit 64a8bda

Please sign in to comment.