| 1084 | } |
| 1085 | |
| 1086 | FileSystemItemPtr |
| 1087 | FileSystemModel::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 | |
| 1122 | FileSystemItemPtr |
| 1123 | FileSystemModel::mkPath(const QString& path) |
nothing calls this directly
no test coverage detected