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

Method FileSystemItemPrivate

Engine/FileSystemModel.cpp:192–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190 QString absoluteFilePath;
191
192 FileSystemItemPrivate(const FileSystemModelPtr& model,
193 bool isDir,
194 const QString& filename,
195 const QString& userFriendlySequenceName,
196 const SequenceParsing::SequenceFromFilesPtr& sequence,
197 const QDateTime& dateModified,
198 quint64 size,
199 const FileSystemItemPtr &parent)
200 : model(model)
201 , parent(parent)
202 , children()
203 , childrenMutex()
204 , isDir(isDir)
205 , filename(filename)
206 , userFriendlySequenceName(userFriendlySequenceName)
207 , sequence(sequence)
208 , dateModified(dateModified)
209 , size(size)
210 , fileExtension()
211 , absoluteFilePath()
212 {
213 if (!isDir) {
214 int lastDotPos = filename.lastIndexOf( QChar::fromLatin1('.') );
215 if (lastDotPos != -1) {
216 fileExtension = filename.mid(lastDotPos + 1);
217 }
218 }
219
220 if (parent) {
221 // absoluteFilePath method of QFileInfo class cause the file system
222 // query hence causes slower performance
223 if ( !parent->getParentItem() ) {
224 // for drives, there is no filename
225 absoluteFilePath = filename;
226 } else {
227 absoluteFilePath = generateChildAbsoluteName(parent.get(), filename);
228 }
229 }
230 }
231
232 FileSystemModelPtr getModel() const
233 {

Callers

nothing calls this directly

Calls 3

getParentItemMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected