MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / createDir

Method createDir

Gui/SequenceFileDialog.cpp:1414–1443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1412}
1413
1414void
1415SequenceFileDialog::createDir()
1416{
1417 _favoriteView->clearSelection();
1418
1419 NATRON_PYTHON_NAMESPACE::PyModalDialog dialog(_gui);
1420 dialog.setWindowTitle( tr("New Folder") );
1421 NATRON_PYTHON_NAMESPACE::StringParamPtr folderName( dialog.createStringParam( QString::fromUtf8("folderName"), QString::fromUtf8("Folder Name") ) );
1422 dialog.refreshUserParamsGUI();
1423 if ( dialog.exec() ) {
1424 QString newFolderString = folderName->getValue();
1425 if ( !newFolderString.isEmpty() ) {
1426 QString folderName = newFolderString;
1427 QString prefix = currentDirectory().absolutePath();
1428 StrUtils::ensureLastPathSeparator(prefix);
1429 if ( QFile::exists(prefix + folderName) ) {
1430 qlonglong suffix = 2;
1431 while ( QFile::exists(prefix + folderName) ) {
1432 folderName = newFolderString + QString::number(suffix);
1433 ++suffix;
1434 }
1435 }
1436 QModelIndex index = _model->mkdir(_view->rootIndex(), folderName);
1437 if ( !index.isValid() ) {
1438 return;
1439 }
1440 enterDirectory(index);
1441 }
1442 }
1443}
1444
1445
1446void

Callers

nothing calls this directly

Calls 9

createStringParamMethod · 0.80
refreshUserParamsGUIMethod · 0.80
absolutePathMethod · 0.80
mkdirMethod · 0.80
clearSelectionMethod · 0.45
execMethod · 0.45
getValueMethod · 0.45
isEmptyMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected