MCPcopy Create free account
hub / github.com/clementgallet/libTAS / pasteInputs

Method pasteInputs

src/program/ui/InputEditorModel.cpp:872–899  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

870}
871
872int 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
901void InputEditorModel::pasteInputsInRange(int row, int count)
902{

Callers

nothing calls this directly

Calls 5

textMethod · 0.80
nbFramesMethod · 0.80
insertInputsBeforeMethod · 0.80
editInputsMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected