| 113 | } |
| 114 | |
| 115 | FileSystemModel::Node* FileSystemModel::Node::createChild( const std::string& childName, |
| 116 | const FileSystemModel& model ) { |
| 117 | std::string childPath( mInfo.getDirectoryPath() + childName ); |
| 118 | FileInfo file( childPath, false ); |
| 119 | |
| 120 | if ( model.getDisplayConfig().ignoreHidden && file.isHidden() ) |
| 121 | return nullptr; |
| 122 | |
| 123 | if ( model.getMode() == Mode::DirectoriesOnly && !file.isDirectory() ) |
| 124 | return nullptr; |
| 125 | |
| 126 | auto hash = String::hash( childName ); |
| 127 | |
| 128 | for ( auto node : mChildren ) |
| 129 | if ( node->mParent == this && node->mHash == hash ) |
| 130 | return nullptr; |
| 131 | |
| 132 | return eeNew( Node, ( std::move( file ), this ) ); |
| 133 | } |
| 134 | |
| 135 | void FileSystemModel::Node::rename( const FileInfo& file ) { |
| 136 | auto oldParentFile = mInfo; |
no test coverage detected