| 1748 | } |
| 1749 | |
| 1750 | std::string |
| 1751 | SequenceFileDialog::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 | |
| 1799 | std::string |
| 1800 | SequenceFileDialog::filesToSave() |
no test coverage detected