| 187 | } |
| 188 | |
| 189 | void ScratchpadView::runSelectedScratch() |
| 190 | { |
| 191 | const auto sourceIndex = proxyModel()->mapToSource(currentIndex()); |
| 192 | if (auto* document = KDevelop::ICore::self()->documentController()->documentForUrl( |
| 193 | QUrl::fromLocalFile(sourceIndex.data(Scratchpad::FullPathRole).toString()))) { |
| 194 | if (!document->save()) { |
| 195 | return; // canceled by the user |
| 196 | } |
| 197 | } |
| 198 | m_scratchpad->setCommand(sourceIndex, commandWidget->text()); |
| 199 | m_scratchpad->runScratch(sourceIndex); |
| 200 | } |
| 201 | |
| 202 | void ScratchpadView::scratchActivated(const QModelIndex& index) |
| 203 | { |
nothing calls this directly
no test coverage detected