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

Method autoCompleteFileName

Gui/SequenceFileDialog.cpp:1637–1671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1635}
1636
1637void
1638SequenceFileDialog::autoCompleteFileName(const QString & text)
1639{
1640 if ( text.startsWith( QLatin1String("//") ) || text.startsWith( QLatin1Char('\\') ) ) {
1641 _view->selectionModel()->clearSelection();
1642
1643 return;
1644 }
1645 QStringList multipleFiles = typedFiles();
1646 if (multipleFiles.count() > 0) {
1647 QModelIndexList oldFiles = _view->selectionModel()->selectedRows();
1648 QModelIndexList newFiles;
1649 for (int i = 0; i < multipleFiles.count(); ++i) {
1650 QModelIndex idx = _model->index( multipleFiles.at(i) );
1651 if ( oldFiles.contains(idx) ) {
1652 oldFiles.removeAll(idx);
1653 } else {
1654 newFiles.append(idx);
1655 }
1656 }
1657
1658 _view->selectionModel()->blockSignals(true);
1659
1660 if ( _selectionLineEdit->hasFocus() ) {
1661 for (int i = 0; i < oldFiles.count(); ++i) {
1662 _view->selectionModel()->select(oldFiles.at(i), QItemSelectionModel::Toggle | QItemSelectionModel::Rows);
1663 }
1664 }
1665
1666 for (int i = 0; i < newFiles.count(); ++i) {
1667 select( newFiles.at(i) );
1668 }
1669 _view->selectionModel()->blockSignals(false);
1670 }
1671}
1672
1673void
1674SequenceFileDialog::onLookingComboboxChanged(const QString & /*path*/)

Callers

nothing calls this directly

Calls 7

atMethod · 0.80
appendMethod · 0.80
clearSelectionMethod · 0.45
countMethod · 0.45
indexMethod · 0.45
containsMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected