Skip to content

Commit b9b0865

Browse files
committedOct 23, 2015
Automatically reload project templates when a new template is added
1 parent 0f2dfdb commit b9b0865

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,12 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
668668
legendLayerSelectionChanged();
669669
mSaveRollbackInProgress = false;
670670

671+
QFileSystemWatcher* projectsTemplateWatcher = new QFileSystemWatcher( this );
672+
QString templateDirName = settings.value( "/qgis/projectTemplateDir",
673+
QgsApplication::qgisSettingsDirPath() + "project_templates" ).toString();
674+
projectsTemplateWatcher->addPath( templateDirName );
675+
connect( projectsTemplateWatcher, SIGNAL( directoryChanged( QString ) ), this, SLOT( updateProjectFromTemplates() ) );
676+
671677
// initialize the plugin manager
672678
mPluginManager = new QgsPluginManager( this, restorePlugins );
673679

0 commit comments

Comments
 (0)
Please sign in to comment.