Commit f7b09f13 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Customwizard: Remove unused code.

parent 7b52a2ab
......@@ -189,7 +189,7 @@ Core::GeneratedFiles CustomWizard::generateFiles(const QWizard *dialog, QString
QTC_ASSERT(cwp, return Core::GeneratedFiles())
CustomWizardContextPtr ctx = context();
ctx->targetPath = cwp->path();
ctx->path = ctx->targetPath = cwp->path();
ctx->replacements = replacementMap(dialog);
if (CustomWizardPrivate::verbose) {
QString logText;
......@@ -493,19 +493,14 @@ Core::GeneratedFiles CustomProjectWizard::generateFiles(const QWizard *w, QStrin
QTC_ASSERT(dialog, return Core::GeneratedFiles())
// Add project name as macro. Path is here under project directory
CustomWizardContextPtr ctx = context();
ctx->targetPath = dialog->path() + QLatin1Char('/') + dialog->projectName();
ctx->path = dialog->path();
ctx->targetPath = ctx->path + QLatin1Char('/') + dialog->projectName();
FieldReplacementMap fieldReplacementMap = replacementMap(dialog);
fieldReplacementMap.insert(QLatin1String("ProjectName"), dialog->projectName());
ctx->replacements = fieldReplacementMap;
if (CustomWizardPrivate::verbose)
qDebug() << "CustomProjectWizard::generateFiles" << dialog << ctx->targetPath << ctx->replacements;
const Core::GeneratedFiles generatedFiles = generateWizardFiles(errorMessage);
// Find the project file and store in context
foreach(const Core::GeneratedFile &f, generatedFiles)
if (f.attributes() & Core::GeneratedFile::OpenProjectAttribute) {
ctx->projectFilePath = f.path();
break;
}
return generatedFiles;
}
......
......@@ -791,8 +791,8 @@ void CustomWizardContext::reset()
baseReplacements.insert(QLatin1String("CppHeaderSuffix"),
mdb->preferredSuffixByType(QLatin1String(CppTools::Constants::CPP_HEADER_MIMETYPE)));
replacements.clear();
path.clear();
targetPath.clear();
projectFilePath.clear();
}
QString CustomWizardContext::processFile(const FieldReplacementMap &fm, QString in)
......
......@@ -143,10 +143,11 @@ struct CustomWizardContext {
FieldReplacementMap baseReplacements;
FieldReplacementMap replacements;
// Where files should be created, that is, choosen path for simple wizards
// or "path/project" for project wizards.
QString path;
// Where files should be created, that is, 'path' for simple wizards
// or "path + project" for project wizards.
QString targetPath;
QString projectFilePath;
};
extern const char customWizardFileOpenEditorAttributeC[];
......
......@@ -48,11 +48,11 @@ struct GeneratorScriptArgument;
* attribute of the <files> element) which actually creates files.
* The command line of the script must follow the convention
*
* script [--dry-run] [Field1=Value1 [Field2=Value2] [Field3:Filename3]]]...
* script [--dry-run] [options]
*
* Options containing field placeholders are configured in the XML files
* and will be passed with them replaced by their values.
*
* Multiline texts will be passed on as temporary files using the colon
* separator.
* The parameters are the field values from the UI.
* As Qt Creator needs to know the file names before actually creates them to
* do overwrite checking etc., this is 2-step process:
* 1) Determine file names and attributes: The script is called with the
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment