| 1762 | } |
| 1763 | |
| 1764 | std::string |
| 1765 | SequenceFileDialog::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 | |
| 1813 | std::string |
| 1814 | SequenceFileDialog::filesToSave() |
no test coverage detected