Merge pull request #637 from manongjohn/block_saving_scene_outside_project
Block saving scene outside current project
This commit is contained in:
commit
98155c9a3b
1 changed files with 11 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue