MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / copyAsFormat

Method copyAsFormat

src/dialogs/MainWindow.cpp:1454–1471  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1452}
1453
1454void MainWindow::copyAsFormat(Converter *converter, const QString &mimeType)
1455{
1456 // This is not ideal as we are *assuming* the converter is currently associated with the currentEditor()
1457 ScintillaNext *editor = currentEditor();
1458 QByteArray buffer;
1459 QTextStream stream(&buffer);
1460
1461 if (editor->selectionEmpty())
1462 converter->convert(stream);
1463 else {
1464 converter->convertRange(stream, editor->selectionStart(), editor->selectionEnd());
1465 }
1466
1467 QMimeData *mimeData = new QMimeData();
1468 mimeData->setData(mimeType, buffer);
1469
1470 QApplication::clipboard()->setMimeData(mimeData);
1471}
1472
1473void MainWindow::renameFile()
1474{

Callers

nothing calls this directly

Calls 3

convertMethod · 0.80
convertRangeMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected