From 668058ed445d56fe46ac7d5e5c2c2cc65b4e1e4c Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 25 May 2018 22:18:42 +0200 Subject: Store export path and prefix. --- src/project.cc | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src/project.cc') diff --git a/src/project.cc b/src/project.cc index 5c45973..5ad809b 100644 --- a/src/project.cc +++ b/src/project.cc @@ -56,6 +56,10 @@ void Instrument::setInstrumentName(const QString& instrument_name) { Project::RAIIBulkUpdate bulkUpdate(project); this->instrument_name = instrument_name; + if(prefix.isEmpty()) + { + setPrefix(instrument_name); // replicate name to prefix + } } } @@ -216,6 +220,42 @@ void Instrument::setSelections(const Selections& selections) } } +QString Instrument::getPrefix() const +{ + return prefix; +} + +void Instrument::setPrefix(const QString& prefix) +{ + if(this->prefix == prefix) + { + return; + } + + { + Project::RAIIBulkUpdate bulkUpdate(project); + this->prefix = prefix; + } +} + +QString Instrument::getExportPath() const +{ + return export_path; +} + +void Instrument::setExportPath(const QString& export_path) +{ + if(this->export_path == export_path) + { + return; + } + + { + Project::RAIIBulkUpdate bulkUpdate(project); + this->export_path = export_path; + } +} + Project& Instrument::getProject() { return project; -- cgit v1.2.3