MCPcopy Create free account
hub / github.com/KDE/kdevelop / copySelection

Method copySelection

kdevplatform/debugger/framestack/framestackwidget.cpp:223–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223void FramestackWidget::copySelection()
224{
225 QClipboard *cb = QApplication::clipboard();
226 const QModelIndexList indexes = m_framesTreeView->selectionModel()->selectedRows();
227 QString content;
228 for (const QModelIndex& index : indexes) {
229 IFrameStackModel::FrameItem frame = m_session->frameStackModel()->frame(index);
230 if (frame.line == -1) {
231 content += i18nc("#frame function() at file", "#%1 %2() at %3\n",
232 frame.nr, frame.name, frame.file.url(QUrl::PreferLocalFile | QUrl::StripTrailingSlash));
233 } else {
234 content += i18nc("#frame function() at file:line", "#%1 %2() at %3:%4\n",
235 frame.nr, frame.name, frame.file.url(QUrl::PreferLocalFile | QUrl::StripTrailingSlash), frame.line+1);
236 }
237 }
238 cb->setText(content);
239}
240
241void FramestackWidget::selectAll()
242{

Callers

nothing calls this directly

Calls 4

frameMethod · 0.45
frameStackModelMethod · 0.45
urlMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected