Store the file path when constructing MidiNameDocument
This is so we can compare and see if we have already parsed the file
This commit is contained in:
@@ -465,9 +465,11 @@ public:
|
||||
typedef std::map<std::string, boost::shared_ptr<MasterDeviceNames> > MasterDeviceNamesList;
|
||||
|
||||
MIDINameDocument() {}
|
||||
MIDINameDocument(const std::string& filename);
|
||||
MIDINameDocument(const std::string& file_path);
|
||||
virtual ~MIDINameDocument() {};
|
||||
|
||||
const std::string& file_path () const { return _file_path; }
|
||||
|
||||
const std::string& author() const { return _author; }
|
||||
void set_author(const std::string& author) { _author = author; }
|
||||
|
||||
@@ -481,6 +483,7 @@ public:
|
||||
int set_state (const XMLTree&, const XMLNode&);
|
||||
|
||||
private:
|
||||
const std::string _file_path;
|
||||
std::string _author;
|
||||
MasterDeviceNamesList _master_device_names_list;
|
||||
MasterDeviceNames::Models _all_models;
|
||||
|
||||
@@ -877,14 +877,15 @@ MasterDeviceNames::get_state(void)
|
||||
return nothing;
|
||||
}
|
||||
|
||||
MIDINameDocument::MIDINameDocument (const string& filename)
|
||||
MIDINameDocument::MIDINameDocument (const string& file_path)
|
||||
: _file_path(file_path)
|
||||
{
|
||||
XMLTree document;
|
||||
if (!document.read (filename)) {
|
||||
if (!document.read (file_path)) {
|
||||
throw failed_constructor ();
|
||||
}
|
||||
|
||||
document.set_filename (filename);
|
||||
document.set_filename (file_path);
|
||||
set_state (document, *document.root());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user