| 1045 | } |
| 1046 | |
| 1047 | boost::shared_ptr<FileSystemItem> |
| 1048 | FileSystemModel::mkPathInternal(const boost::shared_ptr<FileSystemItem>& item, |
| 1049 | const QStringList& path, |
| 1050 | int index) |
| 1051 | { |
| 1052 | assert(index < path.size() && index >= 0); |
| 1053 | |
| 1054 | boost::shared_ptr<FileSystemItem> child; |
| 1055 | for (int i = 0; i < item->childCount(); ++i) { |
| 1056 | boost::shared_ptr<FileSystemItem> c = item->childAt(i); |
| 1057 | if ( c && (c->fileName() == path[index]) ) { |
| 1058 | child = c; |
| 1059 | break; |
| 1060 | } |
| 1061 | } |
| 1062 | |
| 1063 | if (!child) { |
| 1064 | QFileInfo info( generateChildAbsoluteName(item.get(), path[index]) ); |
| 1065 | ///The child doesn't exist already, create it without populating it |
| 1066 | child = FileSystemItem::create(shared_from_this(), true, //isDir |
| 1067 | path[index], //name |
| 1068 | path[index], //name |
| 1069 | boost::shared_ptr<SequenceParsing::SequenceFromFiles>(), |
| 1070 | info.lastModified(), |
| 1071 | 0, //0 for directories |
| 1072 | item); |
| 1073 | _imp->registerItem(child); |
| 1074 | item->addChild(child); |
| 1075 | } |
| 1076 | if (index == path.size() - 1) { |
| 1077 | return child; |
| 1078 | } else { |
| 1079 | return mkPathInternal(child, path, index + 1); |
| 1080 | } |
| 1081 | } |
| 1082 | |
| 1083 | boost::shared_ptr<FileSystemItem> |
| 1084 | FileSystemModel::mkPath(const QString& path) |
nothing calls this directly
no test coverage detected