MCPcopy Create free account
hub / github.com/SpartanJ/eepp / createChild

Method createChild

src/eepp/ui/models/filesystemmodel.cpp:115–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115FileSystemModel::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
135void FileSystemModel::Node::rename( const FileInfo& file ) {
136 auto oldParentFile = mInfo;

Callers 1

handleFileEventLockedMethod · 0.45

Calls 5

hashFunction · 0.85
getDirectoryPathMethod · 0.80
isHiddenMethod · 0.80
getModeMethod · 0.45
isDirectoryMethod · 0.45

Tested by

no test coverage detected