# HG changeset patch # User Chris Cannam # Date 1306163549 -3600 # Node ID 65d75297a37ef0b78689892db006c0bf7be58691 # Parent 976d43d3c67d2bd378f8cfad13c7957aa0799134 Pull the default session template directly from settings, instead of storing it diff -r 976d43d3c67d -r 65d75297a37e framework/MainWindowBase.cpp --- a/framework/MainWindowBase.cpp Tue May 17 17:04:22 2011 +0100 +++ b/framework/MainWindowBase.cpp Mon May 23 16:12:29 2011 +0100 @@ -219,9 +219,6 @@ settings.value("labellertype", (int)labellerType).toInt(); int cycle = settings.value("labellercycle", 4).toInt(); - m_defaultSessionTemplate = settings.value("sessiontemplate", "").toString(); - if (m_defaultSessionTemplate == "") m_defaultSessionTemplate = "default"; - settings.endGroup(); m_labeller = new Labeller(labellerType); @@ -332,16 +329,14 @@ ff->registerLastOpenedFilePath(type, path); } -void -MainWindowBase::setDefaultSessionTemplate(QString name) -{ - m_defaultSessionTemplate = name; -} - QString MainWindowBase::getDefaultSessionTemplate() const { - return m_defaultSessionTemplate; + QSettings settings; + settings.beginGroup("MainWindow"); + QString templateName = settings.value("sessiontemplate", "").toString(); + if (templateName == "") templateName = "default"; + return templateName; } void @@ -1095,7 +1090,7 @@ // std::cerr << "MainWindowBase::openAudio(" << source.getLocation().toStdString() << ")" << std::endl; if (templateName == "") { - templateName = m_defaultSessionTemplate; + templateName = getDefaultSessionTemplate(); } std::cerr << "template is: \"" << templateName.toStdString() << "\"" << std::endl; diff -r 976d43d3c67d -r 65d75297a37e framework/MainWindowBase.h --- a/framework/MainWindowBase.h Tue May 17 17:04:22 2011 +0100 +++ b/framework/MainWindowBase.h Mon May 23 16:12:29 2011 +0100 @@ -284,7 +284,6 @@ QString m_sessionFile; QString m_audioFile; Document *m_document; - QString m_defaultSessionTemplate; QLabel *m_descriptionLabel; PaneStack *m_paneStack; @@ -399,7 +398,6 @@ virtual QString getSaveFileName(FileFinder::FileType type); virtual void registerLastOpenedFilePath(FileFinder::FileType type, QString path); - virtual void setDefaultSessionTemplate(QString name); virtual QString getDefaultSessionTemplate() const; virtual void createPlayTarget();