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

Method slotNewProject

plugins/appwizard/appwizardplugin.cpp:81–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void AppWizardPlugin::slotNewProject()
82{
83 model()->refresh();
84
85 ScopedDialog<AppWizardDialog> dlg(core()->pluginController(), m_templatesModel);
86
87 if (dlg->exec() == QDialog::Accepted)
88 {
89 QString project = createProject( dlg->appInfo() );
90 if (!project.isEmpty())
91 {
92 core()->projectController()->openProject(QUrl::fromLocalFile(project));
93
94 KConfig templateConfig(dlg->appInfo().appTemplate);
95 KConfigGroup general(&templateConfig, QStringLiteral("General"));
96 const QStringList fileArgs =
97 general.readEntry("ShowFilesAfterGeneration").split(QLatin1Char(','), Qt::SkipEmptyParts);
98 for (const auto& fileArg : fileArgs) {
99 QString file = KMacroExpander::expandMacros(fileArg.trimmed(), m_variables);
100 if (QDir::isRelativePath(file)) {
101 file = m_variables[QStringLiteral("PROJECTDIR")] + QLatin1Char('/') + file;
102 }
103 core()->documentController()->openDocument(QUrl::fromUserInput(file));
104 }
105 } else {
106 const QString messageText = i18n("Could not create project from template.");
107 auto* message = new Sublime::Message(messageText, Sublime::Message::Error);
108 ICore::self()->uiController()->postMessage(message);
109 }
110 }
111}
112
113namespace
114{

Callers

nothing calls this directly

Calls 14

modelFunction · 0.85
pluginControllerMethod · 0.80
execMethod · 0.80
appInfoMethod · 0.80
projectControllerMethod · 0.80
readEntryMethod · 0.80
documentControllerMethod · 0.80
uiControllerMethod · 0.80
refreshMethod · 0.45
isEmptyMethod · 0.45
openProjectMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected