Use ARDOUR::user_config_directory in Configuration::*instant_xml
Stateful::add_instant_xml was modified so it would create the user config directory if it doesn't exist, create_directories may throw if it cannot be created. This isn't a change in behaviour as ARDOUR::get_user_ardour_path also throws an exception(although I can't see any existing code to handle it) git-svn-id: svn://localhost/ardour2/trunk@2043 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -62,7 +62,7 @@ class Configuration : public PBD::Stateful
|
||||
int save_state ();
|
||||
|
||||
/// calls Stateful::*instant_xml methods using
|
||||
/// ARDOUR::get_user_ardour_path for the directory
|
||||
/// ARDOUR::user_config_directory for the directory argument
|
||||
void add_instant_xml (XMLNode&);
|
||||
XMLNode * instant_xml (const std::string& str);
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <ardour/configuration.h>
|
||||
#include <ardour/audio_diskstream.h>
|
||||
#include <ardour/control_protocol_manager.h>
|
||||
#include <ardour/filesystem_paths.h>
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
@@ -160,13 +161,13 @@ Configuration::save_state()
|
||||
void
|
||||
Configuration::add_instant_xml(XMLNode& node)
|
||||
{
|
||||
Stateful::add_instant_xml (node, get_user_ardour_path());
|
||||
Stateful::add_instant_xml (node, user_config_directory ());
|
||||
}
|
||||
|
||||
XMLNode*
|
||||
Configuration::instant_xml(const string& node_name)
|
||||
{
|
||||
return Stateful::instant_xml (node_name, get_user_ardour_path());
|
||||
return Stateful::instant_xml (node_name, user_config_directory ());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -78,6 +78,8 @@ Stateful::extra_xml (const string& str)
|
||||
void
|
||||
Stateful::add_instant_xml (XMLNode& node, const sys::path& directory_path)
|
||||
{
|
||||
sys::create_directories (directory_path); // may throw
|
||||
|
||||
if (_instant_xml == 0) {
|
||||
_instant_xml = new XMLNode ("instant");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user