MCPcopy Create free account
hub / github.com/Kitware/ParaView / Update

Method Update

Qt/Core/pqFileDialogModel.cxx:388–459  ·  view source on GitHub ↗

put queried information into our model

Source from the content-addressed store, hash-verified

386
387 /// put queried information into our model
388 void Update(const QString& path, vtkPVFileInformation* dir)
389 {
390 this->CurrentPath = path;
391 this->FileList.clear();
392
393 QList<pqFileDialogModelFileInfo> dirs;
394 QList<pqFileDialogModelFileInfo> files;
395
396 vtkSmartPointer<vtkCollectionIterator> iter;
397 iter.TakeReference(dir->GetContents()->NewIterator());
398
399 for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
400 {
401 vtkPVFileInformation* info = vtkPVFileInformation::SafeDownCast(iter->GetCurrentObject());
402 if (!info)
403 {
404 continue;
405 }
406 if (vtkPVFileInformation::IsDirectory(info->GetType()))
407 {
408 dirs.push_back(pqFileDialogModelFileInfo(QString::fromUtf8(info->GetName()),
409 QString::fromUtf8(info->GetFullPath()),
410 static_cast<vtkPVFileInformation::FileTypes>(info->GetType()), info->GetHidden(),
411 info->GetExtension(), info->GetSize(), info->GetModificationTime()));
412 }
413 else if (info->GetType() != vtkPVFileInformation::FILE_GROUP &&
414 info->GetType() != vtkPVFileInformation::DIRECTORY_GROUP)
415 {
416 files.push_back(pqFileDialogModelFileInfo(QString::fromUtf8(info->GetName()),
417 QString::fromUtf8(info->GetFullPath()),
418 static_cast<vtkPVFileInformation::FileTypes>(info->GetType()), info->GetHidden(),
419 info->GetExtension(), info->GetSize(), info->GetModificationTime()));
420 }
421 else if (info->GetType() == vtkPVFileInformation::FILE_GROUP ||
422 info->GetType() == vtkPVFileInformation::DIRECTORY_GROUP)
423 {
424 QList<pqFileDialogModelFileInfo> groupFiles;
425 vtkSmartPointer<vtkCollectionIterator> childIter;
426 childIter.TakeReference(info->GetContents()->NewIterator());
427 for (childIter->InitTraversal(); !childIter->IsDoneWithTraversal();
428 childIter->GoToNextItem())
429 {
430 vtkPVFileInformation* child =
431 vtkPVFileInformation::SafeDownCast(childIter->GetCurrentObject());
432 groupFiles.push_back(pqFileDialogModelFileInfo(/*QString::fromUtf8*/ (child->GetName()),
433 /*QString::fromUtf8*/ (child->GetFullPath()),
434 static_cast<vtkPVFileInformation::FileTypes>(child->GetType()), child->GetHidden(),
435 child->GetExtension(), child->GetSize(), child->GetModificationTime()));
436 }
437
438 const bool as_files = (info->GetType() == vtkPVFileInformation::FILE_GROUP);
439 auto& container = as_files ? files : dirs;
440 container.push_back(pqFileDialogModelFileInfo(/*QString::fromUtf8*/ (info->GetName()),
441 groupFiles[0].filePath(),
442 (as_files ? vtkPVFileInformation::SINGLE_FILE : vtkPVFileInformation::DIRECTORY),
443 info->GetHidden(), info->GetExtension(), info->GetSize(), info->GetModificationTime(),
444 groupFiles));
445 }

Callers 9

SaveScreenshotMethod · 0.45
CompareImageMethod · 0.45
initMethod · 0.45
setAxisTypeMethod · 0.45
setRangeMethod · 0.45
setCurrentPathMethod · 0.45
mkdirMethod · 0.45
rmdirMethod · 0.45
renameMethod · 0.45

Calls 15

IsDirectoryFunction · 0.85
push_backMethod · 0.80
clearMethod · 0.45
NewIteratorMethod · 0.45
InitTraversalMethod · 0.45
IsDoneWithTraversalMethod · 0.45
GoToNextItemMethod · 0.45
GetTypeMethod · 0.45
GetNameMethod · 0.45
GetSizeMethod · 0.45
filePathMethod · 0.45

Tested by 2

SaveScreenshotMethod · 0.36
CompareImageMethod · 0.36