Changeset View
Changeset View
Standalone View
Standalone View
plugins/appwizard/appwizardplugin.cpp
Show All 40 Lines | |||||
41 | 41 | | |||
42 | #include <interfaces/icore.h> | 42 | #include <interfaces/icore.h> | ||
43 | #include <interfaces/iprojectcontroller.h> | 43 | #include <interfaces/iprojectcontroller.h> | ||
44 | #include <interfaces/iplugincontroller.h> | 44 | #include <interfaces/iplugincontroller.h> | ||
45 | #include <interfaces/iuicontroller.h> | 45 | #include <interfaces/iuicontroller.h> | ||
46 | #include <interfaces/idocumentcontroller.h> | 46 | #include <interfaces/idocumentcontroller.h> | ||
47 | #include <interfaces/context.h> | 47 | #include <interfaces/context.h> | ||
48 | #include <interfaces/contextmenuextension.h> | 48 | #include <interfaces/contextmenuextension.h> | ||
49 | #include <util/scopeddialog.h> | ||||
49 | #include <vcs/vcsjob.h> | 50 | #include <vcs/vcsjob.h> | ||
50 | #include <vcs/interfaces/icentralizedversioncontrol.h> | 51 | #include <vcs/interfaces/icentralizedversioncontrol.h> | ||
51 | #include <vcs/interfaces/idistributedversioncontrol.h> | 52 | #include <vcs/interfaces/idistributedversioncontrol.h> | ||
52 | 53 | | |||
53 | #include "appwizarddialog.h" | 54 | #include "appwizarddialog.h" | ||
54 | #include "projectselectionpage.h" | 55 | #include "projectselectionpage.h" | ||
55 | #include "projectvcspage.h" | 56 | #include "projectvcspage.h" | ||
56 | #include "projecttemplatesmodel.h" | 57 | #include "projecttemplatesmodel.h" | ||
Show All 22 Lines | |||||
79 | AppWizardPlugin::~AppWizardPlugin() | 80 | AppWizardPlugin::~AppWizardPlugin() | ||
80 | { | 81 | { | ||
81 | } | 82 | } | ||
82 | 83 | | |||
83 | void AppWizardPlugin::slotNewProject() | 84 | void AppWizardPlugin::slotNewProject() | ||
84 | { | 85 | { | ||
85 | model()->refresh(); | 86 | model()->refresh(); | ||
86 | 87 | | |||
87 | AppWizardDialog dlg(core()->pluginController(), m_templatesModel); | 88 | ScopedDialog<AppWizardDialog> dlg(core()->pluginController(), m_templatesModel); | ||
88 | 89 | | |||
89 | if (dlg.exec() == QDialog::Accepted) | 90 | if (dlg->exec() == QDialog::Accepted) | ||
90 | { | 91 | { | ||
91 | QString project = createProject( dlg.appInfo() ); | 92 | QString project = createProject( dlg->appInfo() ); | ||
92 | if (!project.isEmpty()) | 93 | if (!project.isEmpty()) | ||
93 | { | 94 | { | ||
94 | core()->projectController()->openProject(QUrl::fromLocalFile(project)); | 95 | core()->projectController()->openProject(QUrl::fromLocalFile(project)); | ||
95 | 96 | | |||
96 | KConfig templateConfig(dlg.appInfo().appTemplate); | 97 | KConfig templateConfig(dlg->appInfo().appTemplate); | ||
97 | KConfigGroup general(&templateConfig, "General"); | 98 | KConfigGroup general(&templateConfig, "General"); | ||
98 | const QStringList fileArgs = general.readEntry("ShowFilesAfterGeneration").split(QLatin1Char(','), QString::SkipEmptyParts); | 99 | const QStringList fileArgs = general.readEntry("ShowFilesAfterGeneration").split(QLatin1Char(','), QString::SkipEmptyParts); | ||
99 | for (const auto& fileArg : fileArgs) { | 100 | for (const auto& fileArg : fileArgs) { | ||
100 | QString file = KMacroExpander::expandMacros(fileArg.trimmed(), m_variables); | 101 | QString file = KMacroExpander::expandMacros(fileArg.trimmed(), m_variables); | ||
101 | if (QDir::isRelativePath(file)) { | 102 | if (QDir::isRelativePath(file)) { | ||
102 | file = m_variables[QStringLiteral("PROJECTDIR")] + QLatin1Char('/') + file; | 103 | file = m_variables[QStringLiteral("PROJECTDIR")] + QLatin1Char('/') + file; | ||
103 | } | 104 | } | ||
104 | core()->documentController()->openDocument(QUrl::fromUserInput(file)); | 105 | core()->documentController()->openDocument(QUrl::fromUserInput(file)); | ||
▲ Show 20 Lines • Show All 455 Lines • Show Last 20 Lines |