forked from qt-creator/qt-creator
Consolidate the different "Plain C/C++" wizards somewhat.
We should not duplicate all wizard resources for every supported build system -- this will not scale. Instead, have one top-level directory for each type of wizard with build system specific data in respective subdirectories and common data in another. To support this approach, CustomWizard now traverses the template directory recursively as long as no wizard specification has been found. Change-Id: I8aad8cf36c5bf24d062f2d2c17fdb87ad12fd450 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
This commit is contained in:
@@ -31,12 +31,12 @@
|
||||
-->
|
||||
<wizard version="1" kind="project" firstpage="10" id="S.Plain C (CMake)" category="I.Projects"
|
||||
platformIndependent="true" featuresRequired="CMake.CMakeSupport">
|
||||
<icon>console.png</icon>
|
||||
<icon>../common/console.png</icon>
|
||||
<description>Creates a plain C project using CMake, not using the Qt library.</description>
|
||||
<displayname>Plain C Project (CMake Build)</displayname>;
|
||||
<displaycategory>Non-Qt Project</displaycategory>
|
||||
<files>
|
||||
<file source="main.c" openeditor="true"/>
|
||||
<file source="../common/main.c" target="main.c" openeditor="true"/>
|
||||
<file source="CMakeLists.txt" openproject="true"/>
|
||||
</files>
|
||||
</wizard>
|
Before Width: | Height: | Size: 567 B After Width: | Height: | Size: 567 B |
@@ -1,7 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
printf("Hello World!\n");
|
||||
return 0;
|
||||
}
|
@@ -38,12 +38,12 @@ leave room for the Qt 4 target page.
|
||||
class="qt4project" firstpage="10"
|
||||
id="R.Plain C" category="I.Projects"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQt">
|
||||
<icon>console.png</icon>
|
||||
<icon>../common/console.png</icon>
|
||||
<description>Creates a plain C project using qmake, not using the Qt library.</description>
|
||||
<displayname>Plain C Project</displayname>;
|
||||
<displaycategory>Non-Qt Project</displaycategory>
|
||||
<files>
|
||||
<file source="main.c" openeditor="true"/>
|
||||
<file source="../common/main.c" target="main.c" openeditor="true"/>
|
||||
<file source="project.pro" target="%ProjectName%.pro" openproject="true"/>
|
||||
</files>
|
||||
</wizard>
|
Binary file not shown.
Before Width: | Height: | Size: 567 B |
@@ -31,12 +31,12 @@
|
||||
-->
|
||||
<wizard version="1" kind="project" firstpage="10" id="S.Plain C++ (CMake)" category="I.Projects"
|
||||
platformIndependent="true" featuresRequired="CMake.CMakeSupport">
|
||||
<icon>console.png</icon>
|
||||
<icon>../common/console.png</icon>
|
||||
<description>Creates a plain C++ project using CMake, not using the Qt library.</description>
|
||||
<displayname>Plain C++ Project (CMake Build)</displayname>;
|
||||
<displaycategory>Non-Qt Project</displaycategory>
|
||||
<files>
|
||||
<file source="main.cpp" openeditor="true"/>
|
||||
<file source="../common/main.cpp" target="main.cpp" openeditor="true"/>
|
||||
<file source="CMakeLists.txt" openproject="true"/>
|
||||
</files>
|
||||
</wizard>
|
Before Width: | Height: | Size: 567 B After Width: | Height: | Size: 567 B |
Binary file not shown.
Before Width: | Height: | Size: 567 B |
@@ -1,9 +0,0 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
cout << "Hello World!" << endl;
|
||||
return 0;
|
||||
}
|
@@ -38,12 +38,12 @@ leave room for the Qt 4 target page.
|
||||
class="qt4project" firstpage="10"
|
||||
id="R.Plain C++" category="I.Projects"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQt">
|
||||
<icon>console.png</icon>
|
||||
<icon>../common/console.png</icon>
|
||||
<description>Creates a plain C++ project using qmake, not using the Qt library.</description>
|
||||
<displayname>Plain C++ Project</displayname>;
|
||||
<displaycategory>Non-Qt Project</displaycategory>
|
||||
<files>
|
||||
<file source="main.cpp" openeditor="true"/>
|
||||
<file source="../common/main.cpp" target="main.cpp" openeditor="true"/>
|
||||
<file source="project.pro" target="%ProjectName%.pro" openproject="true"/>
|
||||
</files>
|
||||
</wizard>
|
@@ -450,7 +450,8 @@ QList<CustomWizard*> CustomWizard::createWizards()
|
||||
const QString configFile = QLatin1String(configFileC);
|
||||
// Check and parse config file in each directory.
|
||||
|
||||
foreach (const QFileInfo &dirFi, dirs) {
|
||||
while (!dirs.isEmpty()) {
|
||||
const QFileInfo dirFi = dirs.takeFirst();
|
||||
const QDir dir(dirFi.absoluteFilePath());
|
||||
if (CustomWizardPrivate::verbose)
|
||||
verboseLog += QString::fromLatin1("CustomWizard: Scanning %1\n").arg(dirFi.absoluteFilePath());
|
||||
@@ -481,9 +482,14 @@ QList<CustomWizard*> CustomWizard::createWizards()
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (CustomWizardPrivate::verbose)
|
||||
if (CustomWizardPrivate::verbose)
|
||||
verboseLog += QString::fromLatin1("CustomWizard: '%1' not found\n").arg(configFile);
|
||||
QList<QFileInfo> subDirs = dir.entryInfoList(filters, sortflags);
|
||||
if (!subDirs.isEmpty()) {
|
||||
// There is no QList::prepend(QList)...
|
||||
dirs.swap(subDirs);
|
||||
dirs.append(subDirs);
|
||||
} else if (CustomWizardPrivate::verbose) {
|
||||
verboseLog += QString::fromLatin1("CustomWizard: '%1' not found\n").arg(configFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CustomWizardPrivate::verbose) { // Print to output pane for Windows.
|
||||
|
Reference in New Issue
Block a user