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

Method onSelectionChanged

Gui/SequenceFileDialog.cpp:951–988  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

949}
950
951void
952SequenceFileDialog::onSelectionChanged()
953{
954 QStringList allFiles;
955 QModelIndexList indexes = _view->selectionModel()->selectedRows();
956
957 assert(indexes.size() <= 1);
958 ///if a parsed sequence exists with the
959 if ( indexes.empty() ) {
960 return;
961 }
962
963 QModelIndex mappedIndex = indexes[0];
964 FileSystemItem* item = _model->getFileSystemItem(mappedIndex);
965 assert(item);
966
967 ///if the selected item is a directory, just set the line edit accordingly
968 QString absolutePath = item->absoluteFilePath();
969
970 proxyAndSetLineEditText(absolutePath);
971
972 if ( !item->isDir() ) {
973 if (_dialogMode == eFileDialogModeSave) {
974 QString extension = item->fileExtension();
975 for (int i = 0; i < _fileExtensionCombo->count(); ++i) {
976 if (_fileExtensionCombo->itemText(i) == extension) {
977 _fileExtensionCombo->setCurrentIndex_no_emit(i);
978 break;
979 }
980 }
981 }
982 }
983
984 ///refrsh preview if any
985 if ( _preview && _preview->viewerUI && _preview->viewerUI->isVisible() ) {
986 refreshPreviewAfterSelectionChange();
987 }
988} // onSelectionChanged
989
990void
991SequenceFileDialog::enterDirectory(const QModelIndex & index)

Callers

nothing calls this directly

Calls 8

emptyMethod · 0.80
getFileSystemItemMethod · 0.80
isDirMethod · 0.80
itemTextMethod · 0.80
sizeMethod · 0.45
countMethod · 0.45
isVisibleMethod · 0.45

Tested by

no test coverage detected