diff --git a/source/MainComponent.cpp b/source/MainComponent.cpp index 3946e76..199b092 100644 --- a/source/MainComponent.cpp +++ b/source/MainComponent.cpp @@ -585,7 +585,12 @@ void MainComponent::buttonClicked (Button* buttonThatWasClicked) { m_file = fc->getResult(); projectNameLabel->setText(m_file.getFileNameWithoutExtension(), NotificationType::dontSendNotification); - AStack *pStack = StackCreator::fromFile(m_file.getParentDirectory().getFullPathName().toStdString(), std::string(projectNameLabel->getText().getCharPointer()), this); + // Projects live at /prj//.prj; StackCreator/AStack + // append "/prj/" themselves, so recover (three levels + // up: file -> its project folder -> "prj" folder -> root) rather + // than passing the file's own parent folder as dir. + m_dir = m_file.getParentDirectory().getParentDirectory().getParentDirectory().getFullPathName().toStdString(); + AStack *pStack = StackCreator::fromFile(m_dir, std::string(projectNameLabel->getText().getCharPointer()), this); m_stack = reinterpret_cast(pStack); m_stack->loadWeights(m_dir); m_rbmSelect->clear(dontSendNotification);