| 870 | } |
| 871 | |
| 872 | int InputEditorModel::pasteInputs(int row) |
| 873 | { |
| 874 | /* Rewind to past frame if needed */ |
| 875 | if (row < static_cast<int>(context->framecount)) { |
| 876 | bool ret = rewind(row); |
| 877 | if (!ret) { |
| 878 | startHighlight(row, row, 0, columnCount()-1, false); |
| 879 | return 0; |
| 880 | } |
| 881 | } |
| 882 | |
| 883 | QClipboard *clipboard = QGuiApplication::clipboard(); |
| 884 | std::istringstream inputString(clipboard->text().toStdString()); |
| 885 | |
| 886 | std::vector<AllInputs> paste_ais; |
| 887 | InputSerialization::readInputs(inputString, paste_ais); |
| 888 | |
| 889 | /* Check if we need to insert frames */ |
| 890 | int insertedFrames = row + paste_ais.size() - movie->inputs->nbFrames(); |
| 891 | |
| 892 | if (insertedFrames > 0) { |
| 893 | movie->inputs->insertInputsBefore(movie->inputs->nbFrames(), insertedFrames); |
| 894 | } |
| 895 | |
| 896 | movie->inputs->editInputs(paste_ais, row); |
| 897 | |
| 898 | return paste_ais.size(); |
| 899 | } |
| 900 | |
| 901 | void InputEditorModel::pasteInputsInRange(int row, int count) |
| 902 | { |
nothing calls this directly
no test coverage detected