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

Method mkPathInternal

Engine/FileSystemModel.cpp:1086–1120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1084}
1085
1086FileSystemItemPtr
1087FileSystemModel::mkPathInternal(const FileSystemItemPtr& item,
1088 const QStringList& path,
1089 int index)
1090{
1091 assert(index < path.size() && index >= 0);
1092
1093 FileSystemItemPtr child;
1094 for (int i = 0; i < item->childCount(); ++i) {
1095 FileSystemItemPtr c = item->childAt(i);
1096 if ( c && (c->fileName() == path[index]) ) {
1097 child = c;
1098 break;
1099 }
1100 }
1101
1102 if (!child) {
1103 QFileInfo info( generateChildAbsoluteName(item.get(), path[index]) );
1104 ///The child doesn't exist already, create it without populating it
1105 child = FileSystemItem::create(shared_from_this(), true, //isDir
1106 path[index], //name
1107 path[index], //name
1108 SequenceParsing::SequenceFromFilesPtr(),
1109 info.lastModified(),
1110 0, //0 for directories
1111 item);
1112 _imp->registerItem(child);
1113 item->addChild(child);
1114 }
1115 if (index == path.size() - 1) {
1116 return child;
1117 } else {
1118 return mkPathInternal(child, path, index + 1);
1119 }
1120}
1121
1122FileSystemItemPtr
1123FileSystemModel::mkPath(const QString& path)

Callers

nothing calls this directly

Calls 7

childCountMethod · 0.80
childAtMethod · 0.80
registerItemMethod · 0.80
addChildMethod · 0.80
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected