Change the location of the default template directory

Changed the location from lmms/projects/templates to
lmms/templates. This new location is used for loading and saving
of the default tempate default.mpt
This commit is contained in:
Dave French committed 2015-03-27 13:45:43 +00:00
1 parent 7335b98fdb
commit 345e05831d
4 files changed
+13 -7

No files matched your search

+5
View File
@@ -77,6 +77,11 @@ public:
return workingDir() + PROJECTS_PATH;
}
QString userTemplateDir() const
{
return workingDir() + TEMPLATE_PATH;
}
QString userPresetsDir() const
{
return workingDir() + PRESETS_PATH;
+1 -1
View File
@@ -423,7 +423,7 @@ void ConfigManager::loadConfigFile()
if( QDir( m_workingDir ).exists() )
{
QDir().mkpath( userProjectsDir() );
QDir().mkpath( userProjectsDir() + TEMPLATE_PATH );
QDir().mkpath( userTemplateDir() );
QDir().mkpath( userSamplesDir() );
QDir().mkpath( userPresetsDir() );
}
+4 -2
View File
@@ -847,8 +847,10 @@ void Song::clearProject()
// create new file
void Song::createNewProject()
{
QString defaultTemplate = ConfigManager::inst()->userProjectsDir()
+ "templates/default.mpt";
QString defaultTemplate = ConfigManager::inst()->userTemplateDir()
+ "default.mpt";
if( QFile::exists( defaultTemplate ) )
{
+3 -4
View File
@@ -738,14 +738,13 @@ void MainWindow::createNewProject()
{
Engine::getSong()->createNewProject();
}
QString default_template = ConfigManager::inst()->userProjectsDir()
+ "templates/default.mpt";
QString default_template = ConfigManager::inst()->userTemplateDir()
+ "default.mpt";
//if we dont have a user default template, make one
if( !QFile::exists( default_template ) )
{
Engine::getSong()->saveProjectFile( ConfigManager::inst()->userProjectsDir()
+ "templates/default.mpt" );
Engine::getSong()->saveProjectFile( default_template );
}
}