Skip to content

Commit

Permalink
Automatically reload project templates when a new template is added
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 23, 2015
1 parent 0f2dfdb commit b9b0865
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -668,6 +668,12 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
legendLayerSelectionChanged();
mSaveRollbackInProgress = false;

QFileSystemWatcher* projectsTemplateWatcher = new QFileSystemWatcher( this );
QString templateDirName = settings.value( "/qgis/projectTemplateDir",
QgsApplication::qgisSettingsDirPath() + "project_templates" ).toString();
projectsTemplateWatcher->addPath( templateDirName );
connect( projectsTemplateWatcher, SIGNAL( directoryChanged( QString ) ), this, SLOT( updateProjectFromTemplates() ) );

// initialize the plugin manager
mPluginManager = new QgsPluginManager( this, restorePlugins );

Expand Down

0 comments on commit b9b0865

Please sign in to comment.