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

Method selectedFiles

Gui/SequenceFileDialog.cpp:1750–1797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1748}
1749
1750std::string
1751SequenceFileDialog::selectedFiles()
1752{
1753 QModelIndexList indexes = _view->selectionModel()->selectedRows();
1754
1755 if (indexes.count() > 1) {
1756 return std::string();
1757 }
1758
1759
1760 std::string selection;
1761 bool remapSelection = false;
1762
1763 if (indexes.count() == 1) {
1764 FileSystemItem* item = _model->getFileSystemItem(indexes[0]);
1765
1766 if (!item) {
1767 return selection;
1768 }
1769 SequenceParsing::SequenceFromFilesPtr sequence = item->getSequence();
1770 if (sequence) {
1771 selection = sequence->generateValidSequencePattern();
1772 } else {
1773 selection = item->absoluteFilePath().toStdString();
1774 }
1775 remapSelection = true;
1776 } else {
1777 //if nothing is selected, pick whatever the line edit tells us
1778 selection = _selectionLineEdit->text().toStdString();
1779 }
1780
1781
1782 if (remapSelection && _relativePathsAllowed) {
1783 std::string varName, varPath;
1784 bool relative = getRelativeChoiceProjectPath(varName, varPath);
1785 if (relative) {
1786 Project::makeRelativeToVariable(varName, varPath, selection);
1787 }
1788 }
1789
1790#ifdef __NATRON_WIN32__
1791 if (appPTR->getCurrentSettings()->isDriveLetterToUNCPathConversionEnabled()) {
1792 QString ret = FileSystemModel::mapPathWithDriveLetterToPathWithNetworkShareName( QString::fromUtf8( selection.c_str() ) );
1793 selection = ret.toStdString();
1794 }
1795#endif
1796 return selection;
1797}
1798
1799std::string
1800SequenceFileDialog::filesToSave()

Callers 10

importLayoutMethod · 0.80
onButtonClickedMethod · 0.80
popOpenFileDialogMethod · 0.80
onSourceScriptClickedMethod · 0.80
onLoadScriptClickedMethod · 0.80
onSaveScriptClickedMethod · 0.80
open_fileMethod · 0.80
open_fileMethod · 0.80
getFilenameDialogMethod · 0.80
getSequenceDialogMethod · 0.80

Calls 6

getFileSystemItemMethod · 0.80
getSequenceMethod · 0.80
toStdStringMethod · 0.80
getCurrentSettingsMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected