# HG changeset patch # User Chris Cannam # Date 1536063583 -3600 # Node ID 636a5908cf8162749acacd394f7d25b6290af00c # Parent 6cdf2afebfd7076b74765962c3408cd15b79364e# Parent e98a42e94d90120247dd368b30e1d37ad382ec61 Merge from default branch diff -r e98a42e94d90 -r 636a5908cf81 framework/MainWindowBase.cpp --- a/framework/MainWindowBase.cpp Tue Sep 04 11:32:49 2018 +0100 +++ b/framework/MainWindowBase.cpp Tue Sep 04 13:19:43 2018 +0100 @@ -1498,8 +1498,16 @@ } } -// cerr << "mode = " << mode << endl; - + return addOpenedAudioModel(source, newModel, mode, templateName, true); +} + +MainWindowBase::FileOpenStatus +MainWindowBase::addOpenedAudioModel(FileSource source, + WaveFileModel *newModel, + AudioFileOpenMode mode, + QString templateName, + bool registerSource) +{ if (mode == AskUser) { if (getMainModel()) { @@ -1635,7 +1643,9 @@ } } - if (!source.isRemote()) m_audioFile = source.getLocalFilename(); + if (!source.isRemote() && registerSource) { + m_audioFile = source.getLocalFilename(); + } } else if (mode == CreateAdditionalModel) { @@ -1705,7 +1715,7 @@ updateMenuStates(); m_recentFiles.addFile(source.getLocation()); - if (!source.isRemote()) { + if (!source.isRemote() && registerSource) { // for file dialog registerLastOpenedFilePath(FileFinder::AudioFile, source.getLocalFilename()); diff -r e98a42e94d90 -r 636a5908cf81 framework/MainWindowBase.h --- a/framework/MainWindowBase.h Tue Sep 04 11:32:49 2018 +0100 +++ b/framework/MainWindowBase.h Tue Sep 04 13:19:43 2018 +0100 @@ -396,6 +396,12 @@ const WaveFileModel *getMainModel() const; void createDocument(); + FileOpenStatus addOpenedAudioModel(FileSource source, + WaveFileModel *model, + AudioFileOpenMode mode, + QString templateName, + bool registerSource); + sv_frame_t getModelsStartFrame() const; // earliest across all views sv_frame_t getModelsEndFrame() const; // latest across all views