From b5e3f2e57b38e0d3476da969b093aa36ebb61e3e Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 19 May 2015 17:00:22 +0200 Subject: [PATCH] CustomWizard: Remove example wizards We do not want to encourage the use of custom wizards, so remove the examples. The Json wizard has already enough real-world examples IMHO. Change-Id: Ic755e01ce0430b90ad4d5ea3496c11ce162249bf Reviewed-by: Alessandro Portale --- .../templates/wizards/helloworld/console.png | Bin 567 -> 0 bytes .../templates/wizards/helloworld/main.cpp | 7 - .../templates/wizards/helloworld/project.pro | 10 -- .../wizards/helloworld/wizard_sample.xml | 72 ---------- .../templates/wizards/listmodel/listmodel.cpp | 23 ---- .../templates/wizards/listmodel/listmodel.h | 21 --- .../wizards/listmodel/wizard_sample.xml | 78 ----------- .../scriptgeneratedproject/generate.pl | 129 ------------------ .../scriptgeneratedproject/wizard_sample.xml | 60 -------- 9 files changed, 400 deletions(-) delete mode 100644 share/qtcreator/templates/wizards/helloworld/console.png delete mode 100644 share/qtcreator/templates/wizards/helloworld/main.cpp delete mode 100644 share/qtcreator/templates/wizards/helloworld/project.pro delete mode 100644 share/qtcreator/templates/wizards/helloworld/wizard_sample.xml delete mode 100644 share/qtcreator/templates/wizards/listmodel/listmodel.cpp delete mode 100644 share/qtcreator/templates/wizards/listmodel/listmodel.h delete mode 100644 share/qtcreator/templates/wizards/listmodel/wizard_sample.xml delete mode 100755 share/qtcreator/templates/wizards/scriptgeneratedproject/generate.pl delete mode 100644 share/qtcreator/templates/wizards/scriptgeneratedproject/wizard_sample.xml diff --git a/share/qtcreator/templates/wizards/helloworld/console.png b/share/qtcreator/templates/wizards/helloworld/console.png deleted file mode 100644 index 7569a988f4a09ad0a72d7250b47db99c88471a79..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 567 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANL}Y)RhkE)4%caKYZ?lNlHo zI14-?iy0WWg+Z8+Vb&Z81_lQ95>H=O_G?VcTn3Cs1+>;PFfhoLxJHyX=jZ08=9Mrw z7o{eaq^2m8XO?6rgk+>DxO@5ryiZZhV_;yM?djqeQgQ3;^u1Y3jv}q+*ErwUeRRVD z?xyHp9AO8uvbp7z^(Xjk*mzp|iDFR1%ml%Xsr?Bn7p-}eWVre0j%7lVcD(BP?R?-e z@0q7HcXk@jN&KBB?t04Mpq5O-{}_{Be{1EIJr3(W%EZv{ymH0$*E1#j)r5K44_}sL zXgHWqutifhbL~OP{rnH@Sp&QjyA~xeY`d-dtiM?23scak8pb74KG@113})E>T={|H zDgkjupUW)095u%lW?PkZbThOi9=K*Ur*AT+%Oc4QI@-n^N47tZIikD$@v8C%41sl; zi$$g^$d+2QQlKr-jv>g4#pb}T%HFwqnQH~L-irzZeq&%S-v8YBy2+28!*yF7T@reh zPG(9aldF71(QNkFKwd#djzVh(5m)uIx~C5n?L6`&w<_fMw!1D2;{6Id&MTI6 znflvKI@;OspvJ<1!Vad*&C Q3=9kmp00i_>zopr0NOF+bpQYW diff --git a/share/qtcreator/templates/wizards/helloworld/main.cpp b/share/qtcreator/templates/wizards/helloworld/main.cpp deleted file mode 100644 index c68f1dcdce0..00000000000 --- a/share/qtcreator/templates/wizards/helloworld/main.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main(int, char **) -{ - std::printf("%MESSAGE%\n"); - return 0; -} diff --git a/share/qtcreator/templates/wizards/helloworld/project.pro b/share/qtcreator/templates/wizards/helloworld/project.pro deleted file mode 100644 index dac1e0c42cf..00000000000 --- a/share/qtcreator/templates/wizards/helloworld/project.pro +++ /dev/null @@ -1,10 +0,0 @@ -QT = core -%NETWORK%QT += network -@if "%SCRIPT%" == "true" -QT += script -@endif -CONFIG += console c++11 -CONFIG -= app_bundle - -TEMPLATE = app -SOURCES += main.cpp diff --git a/share/qtcreator/templates/wizards/helloworld/wizard_sample.xml b/share/qtcreator/templates/wizards/helloworld/wizard_sample.xml deleted file mode 100644 index 9eb59823764..00000000000 --- a/share/qtcreator/templates/wizards/helloworld/wizard_sample.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - console.png - Creates a hello-world-project with custom message. - Hello World; - Custom Projects - - - - - - Hello World Parameters - Hallo Welt Parameter - - - - Hello world message: - Hallo-Welt-Nachricht: - - - - - Include network module - Netzwerk-Modul verwenden - - - - - Include script module - Script-Modul verwenden - - - diff --git a/share/qtcreator/templates/wizards/listmodel/listmodel.cpp b/share/qtcreator/templates/wizards/listmodel/listmodel.cpp deleted file mode 100644 index b774d9a4ed4..00000000000 --- a/share/qtcreator/templates/wizards/listmodel/listmodel.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "%ClassName:l%.%CppHeaderSuffix%" - -%ClassName%::%ClassName%(QObject *parent) : - QAbstractListModel(parent) -{ -} - -void %ClassName%::addItems(const QList<%Datatype%> &newItems) -{ - beginInsertRows(QModelIndex(), items.size(), items.size() + newItems.size()); - items.append(newItems); - endInsertRows(); -} - -int %ClassName%::rowCount(const QModelIndex &) const -{ - return items.size(); -} - -QVariant %ClassName%::data(const QModelIndex &index, int) const -{ - return items.at(index.row()); -} diff --git a/share/qtcreator/templates/wizards/listmodel/listmodel.h b/share/qtcreator/templates/wizards/listmodel/listmodel.h deleted file mode 100644 index a6c9c70619d..00000000000 --- a/share/qtcreator/templates/wizards/listmodel/listmodel.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef %ClassName:u%_H -#define %ClassName:u%_H - -#include -#include - -class %ClassName% : public QAbstractListModel { - Q_OBJECT -public: - explicit %ClassName%(QObject *parent); - void addItems(const QList<%Datatype%> &items); - - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - -private: - QList<%Datatype%> items; -}; - -#endif // %ClassName:u%_H - diff --git a/share/qtcreator/templates/wizards/listmodel/wizard_sample.xml b/share/qtcreator/templates/wizards/listmodel/wizard_sample.xml deleted file mode 100644 index 9958e691b97..00000000000 --- a/share/qtcreator/templates/wizards/listmodel/wizard_sample.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - Creates a QAbstractListModel implementation. - Erzeugt eine Implementierung von QAbstractListModel. - QAbstractListModel implementation; - Implementierung von QAbstractListModel; - Custom Classes - Benutzerdefinierte Klassen - - - - - - ListModel parameters - Parameter des ListModel - - - - Class name: - Klassenname: - - - - - - class QString - Klasse QString - - - Integer - Ganzzahlwert - - - - Data type: - Datentyp: - - - - - - %ClassName% cannot be used as class name. - %ClassName% kann nicht als Klassenname verwendet werden. - - - diff --git a/share/qtcreator/templates/wizards/scriptgeneratedproject/generate.pl b/share/qtcreator/templates/wizards/scriptgeneratedproject/generate.pl deleted file mode 100755 index f12d9c0c4a3..00000000000 --- a/share/qtcreator/templates/wizards/scriptgeneratedproject/generate.pl +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/perl -w - -############################################################################ -# -# Copyright (C) 2015 The Qt Company Ltd. -# Contact: http://www.qt.io/licensing -# -# This file is part of Qt Creator. -# -# Commercial License Usage -# Licensees holding valid commercial Qt licenses may use this file in -# accordance with the commercial license agreement provided with the -# Software or, alternatively, in accordance with the terms contained in -# a written agreement between you and The Qt Company. For licensing terms and -# conditions see http://www.qt.io/terms-conditions. For further information -# use the contact form at http://www.qt.io/contact-us. -# -# GNU Lesser General Public License Usage -# Alternatively, this file may be used under the terms of the GNU Lesser -# General Public License version 2.1 or version 3 as published by the Free -# Software Foundation and appearing in the file LICENSE.LGPLv21 and -# LICENSE.LGPLv3 included in the packaging of this file. Please review the -# following information to ensure the GNU Lesser General Public License -# requirements will be met: https://www.gnu.org/licenses/lgpl.html and -# http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -# -# In addition, as a special exception, The Qt Company gives you certain additional -# rights. These rights are described in The Qt Company LGPL Exception -# version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -# -############################################################################ - -use strict; -use Getopt::Long; -use IO::File; - -my $optDryRun = 0; -my $optHelp = 0; -my $optClassName = 'MyClass'; -my $optProjectName = 'MyProject'; -my $optCppHeaderSuffix = 'h'; -my $optCppSourceSuffix = 'cpp'; -my $optDescription = ''; - -# -- Read in a file and return its lines -sub readFile -{ - my ($fileName) = @_; - my @rc = (); - my $fh = new IO::File('<' . $fileName) or die ('Unable to open for reading ' . $fileName . ' :' . $!); - while (my $line = <$fh>) { - chomp($line); - push (@rc, $line); - } - $fh->close(); - return @rc; -} - -my $USAGE=<] - [--project-name=] - [--header-suffix=
] - [--source-suffix=] - [--description=] - -Custom wizard project generation example script. - -EOF - -my $argCount = scalar(@ARGV); -if ($argCount == 0 - || !GetOptions("help" => \$optHelp, - "dry-run" => \$optDryRun, - "class-name:s" => \$optClassName, - "project-name:s" => \$optProjectName, - "header-suffix:s" => \$optCppHeaderSuffix, - "source-suffix:s" => \$optCppSourceSuffix, - "description:s" => \$optDescription) - || $optHelp != 0) { - print $USAGE; - exit (1); -} - -# -- Determine file names -my $baseFileName = lc($optClassName); -my $sourceFileName = $baseFileName . '.' . $optCppSourceSuffix; -my $headerFileName = $baseFileName . '.' . $optCppHeaderSuffix; -my $mainSourceFileName = 'main.' . $optCppSourceSuffix; -my $projectFileName = lc($optProjectName) . '.pro'; - -if ($optDryRun) { -# -- Step 1) Dry run: Print file names along with attributes - print $sourceFileName,",openeditor\n"; - print $headerFileName,",openeditor\n"; - print $mainSourceFileName,",openeditor\n"; - print $projectFileName,",openproject\n"; -} else { -# -- Step 2) Actual file creation - print 'Generating ', $headerFileName, ' ', $sourceFileName, ' ', - $mainSourceFileName, ' ', $projectFileName, "\n"; - my $headerFile = new IO::File('>' . $headerFileName) or die ('Unable to open ' . $headerFileName . ' :' . $!); - print $headerFile '#ifndef ', uc($optClassName), "_H\n#define ", uc($optClassName), "_H\n\n", - 'class ', $optClassName, "{\npublic:\n ", $optClassName, "();\n\n};\n\n#endif\n"; - $headerFile->close(); - - my $sourceFile = new IO::File('>' . $sourceFileName) or die ('Unable to open ' . $sourceFileName . ' :' . $!); - print $sourceFile '#include "', $headerFileName ,"\"\n\n", - $optClassName,'::', $optClassName, "()\n{\n}\n"; - $sourceFile->close(); - - my $mainSourceFile = new IO::File('>' . $mainSourceFileName) or die ('Unable to open ' . $mainSourceFileName . ' :' . $!); - print $mainSourceFile '#include "', $headerFileName ,"\"\n\n"; -# -- Write out description comments - if ($optDescription ne '') { - foreach my $description (readFile($optDescription)) { - print $mainSourceFile '// ', $description, "\n"; - } - } - print $mainSourceFile "int main(int argc, char *argv[])\n{\n ", $optClassName,' ', lc($optClassName), - ";\n return 0;\n}\n"; - $mainSourceFile->close(); - - my $projectFile = new IO::File('>' . $projectFileName) or die ('Unable to open ' . $projectFileName . ' :' . $!); - print $projectFile "TEMPLATE = app\nQT -= core\nCONFIG += console\nTARGET = ", $optProjectName, - "\nSOURCES += ", $sourceFileName, ' ', $mainSourceFileName, - "\nHEADERS += ", $headerFileName,"\n"; - $projectFile->close(); -} diff --git a/share/qtcreator/templates/wizards/scriptgeneratedproject/wizard_sample.xml b/share/qtcreator/templates/wizards/scriptgeneratedproject/wizard_sample.xml deleted file mode 100644 index 67e90dadc8f..00000000000 --- a/share/qtcreator/templates/wizards/scriptgeneratedproject/wizard_sample.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - Creates a simple project using a generator script - Simple Script-Generated Project; - Custom Projects - - Simple Script-Generated Project Parameters - - - - Class name: - - - - - Description: - - - - - - - - - - - -