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
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);
#include <ardour/configuration.h>
#include <ardour/audio_diskstream.h>
#include <ardour/control_protocol_manager.h>
+#include <ardour/filesystem_paths.h>
#include "i18n.h"
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 ());
}
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");
}