Merge pull request #637 from manongjohn/block_saving_scene_outside_project

Block saving scene outside current project
This commit is contained in:
manongjohn 2021-04-03 14:06:53 -04:00 committed by GitHub
commit 98155c9a3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -252,6 +252,17 @@ void FileBrowserPopup::onOkPressed() {
return;
}
} else {
if (m_forSaving && m_browser->getFilterTypes().contains("tnz")) {
TProjectManager *pm = TProjectManager::instance();
TFilePath currentPrjDir =
pm->getCurrentProject()->getProjectPath().getParentDir();
if (!currentPrjDir.isAncestorOf(*pt)) {
DVGui::warning(QObject::tr(
"You cannot save a scene outside of the current project's folder."));
return;
}
}
if (!m_isDirectoryOnly)
pathSet.insert(*pt);
else {