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

Method addFileToModel

plugins/scratchpad/scratchpad.cpp:260–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260void Scratchpad::addFileToModel(const QFileInfo& fileInfo)
261{
262 auto* const item = new QStandardItem(m_iconProvider.icon(fileInfo), fileInfo.fileName());
263 item->setData(fileInfo.filePath(), FullPathRole);
264 const auto command = commandForScratch(fileInfo);
265 item->setData(command, RunCommandRole);
266 scratchCommands().writeEntry(item->text(), item->data(RunCommandRole));
267 m_model->appendRow(item);
268}
269
270void Scratchpad::setCommand(const QModelIndex& index, const QString& command)
271{

Callers

nothing calls this directly

Calls 10

commandForScratchFunction · 0.85
scratchCommandsFunction · 0.85
writeEntryMethod · 0.80
appendRowMethod · 0.80
iconMethod · 0.45
fileNameMethod · 0.45
setDataMethod · 0.45
filePathMethod · 0.45
textMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected