OpenToonz - An open-source full-featured 2D animation creation software
C
Fix couldn't create folder in a empty folder
Abel You339d8dbfbd1f
diff --git a/toonz/sources/toonz/exportalllevelspopup.cpp b/toonz/sources/toonz/exportalllevelspopup.cppindex 920984cd1..36615ed70 100644--- a/toonz/sources/toonz/exportalllevelspopup.cpp+++ b/toonz/sources/toonz/exportalllevelspopup.cpp@@ -337,8 +337,6 @@ bool ExportAllLevelsPopup::execute() {folderName = m_exportOptions->m_createlevelfolder->isChecked()? level_to_foldername.find(sl->getName())->second: std::wstring();- std::wstring b = fp.getWideString();- std::wstring a = fp.getWideString()+ L"\\" + folderName + L"."+ to_wstring(ext);ret = IoCmd::exportLevel(TFilePath(fp.getWideString() + L"\\" +level_to_foldername.find(sl->getName())->second +diff --git a/toonz/sources/toonz/filebrowsermodel.cpp b/toonz/sources/toonz/filebrowsermodel.cppindex bb8aaf054..b1a2359fd 100644--- a/toonz/sources/toonz/filebrowsermodel.cpp+++ b/toonz/sources/toonz/filebrowsermodel.cpp@@ -1295,10 +1295,15 @@ void DvDirModel::onFolderChanged(const TFilePath &path) { refreshFolder(path); }void DvDirModel::refresh(const QModelIndex &index) {if (!index.isValid()) return;DvDirModelNode *node = getNode(index);- if (!node || node->getChildCount() < 1) return;+ if (!node || node->getChildCount() < 1) {+ if (node->getChildCount() == 0 && node->getNodeType() == "FileFolder") {+ //when creating new folder in a empty folder,do not break+ }else+ return;+ }emit layoutAboutToBeChanged();- emit beginRemoveRows(index, 0, node->getChildCount() - 1);node->refreshChildren();+ emit beginRemoveRows(index, 0, node->getChildCount() - 1);emit endRemoveRows();emit layoutChanged();}