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

Method FileSystemItemPrivate

Engine/FileSystemModel.cpp:187–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

getParentItemMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected