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

Method loadFileClicked

plugins/appwizard/projectselectionpage.cpp:303–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303void ProjectSelectionPage::loadFileClicked()
304{
305 const QStringList supportedMimeTypes {
306 QStringLiteral("application/x-desktop"),
307 QStringLiteral("application/x-bzip-compressed-tar"),
308 QStringLiteral("application/zip")
309 };
310 ScopedDialog<QFileDialog> fileDialog(this, i18nc("@title:window", "Load Template from File"));
311 fileDialog->setMimeTypeFilters(supportedMimeTypes);
312 fileDialog->setFileMode(QFileDialog::ExistingFiles);
313
314 if (!fileDialog->exec()) {
315 return;
316 }
317
318 const auto& fileNames = fileDialog->selectedFiles();
319 for (const auto& fileName : fileNames) {
320 QString destination = m_templatesModel->loadTemplateFile(fileName);
321 QModelIndexList indexes = m_templatesModel->templateIndexes(destination);
322 if (indexes.size() > 2)
323 {
324 ui->listView->setCurrentIndex(indexes.at(1));
325 ui->templateType->setCurrentIndex(indexes.at(2).row());
326 }
327 }
328}
329
330void ProjectSelectionPage::handleNewStuffDialogFinished(const QList<KNSCore::Entry>& changedEntries)
331{

Callers

nothing calls this directly

Calls 7

execMethod · 0.80
loadTemplateFileMethod · 0.80
setCurrentIndexMethod · 0.80
templateIndexesMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45
rowMethod · 0.45

Tested by

no test coverage detected