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

Method selectedFiles

Gui/SequenceFileDialog.cpp:1764–1811  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1762}
1763
1764std::string
1765SequenceFileDialog::selectedFiles()
1766{
1767 QModelIndexList indexes = _view->selectionModel()->selectedRows();
1768
1769 if (indexes.count() > 1) {
1770 return std::string();
1771 }
1772
1773
1774 std::string selection;
1775 bool remapSelection = false;
1776
1777 if (indexes.count() == 1) {
1778 FileSystemItem* item = _model->getFileSystemItem(indexes[0]);
1779
1780 if (!item) {
1781 return selection;
1782 }
1783 boost::shared_ptr<SequenceParsing::SequenceFromFiles> sequence = item->getSequence();
1784 if (sequence) {
1785 selection = sequence->generateValidSequencePattern();
1786 } else {
1787 selection = item->absoluteFilePath().toStdString();
1788 }
1789 remapSelection = true;
1790 } else {
1791 //if nothing is selected, pick whatever the line edit tells us
1792 selection = _selectionLineEdit->text().toStdString();
1793 }
1794
1795
1796 if (remapSelection && _relativePathsAllowed) {
1797 std::string varName, varPath;
1798 bool relative = getRelativeChoiceProjectPath(varName, varPath);
1799 if (relative) {
1800 Project::makeRelativeToVariable(varName, varPath, selection);
1801 }
1802 }
1803
1804#ifdef __NATRON_WIN32__
1805 if (appPTR->getCurrentSettings()->isDriveLetterToUNCPathConversionEnabled()) {
1806 QString ret = FileSystemModel::mapPathWithDriveLetterToPathWithNetworkShareName( QString::fromUtf8( selection.c_str() ) );
1807 selection = ret.toStdString();
1808 }
1809#endif
1810 return selection;
1811}
1812
1813std::string
1814SequenceFileDialog::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