From f7b09f137cd462f43cd3381e970cef76fcbcf552 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint <Friedemann.Kleint@nokia.com> Date: Mon, 6 Sep 2010 16:33:44 +0200 Subject: [PATCH] Customwizard: Remove unused code. --- .../projectexplorer/customwizard/customwizard.cpp | 11 +++-------- .../customwizard/customwizardparameters.cpp | 2 +- .../customwizard/customwizardparameters.h | 7 ++++--- .../customwizard/customwizardscriptgenerator.h | 8 ++++---- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/plugins/projectexplorer/customwizard/customwizard.cpp b/src/plugins/projectexplorer/customwizard/customwizard.cpp index 7ab2a611be1..7f4c5107b61 100644 --- a/src/plugins/projectexplorer/customwizard/customwizard.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizard.cpp @@ -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; } diff --git a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp index f3d8fe9591f..6efcd8d6ec2 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp @@ -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) diff --git a/src/plugins/projectexplorer/customwizard/customwizardparameters.h b/src/plugins/projectexplorer/customwizard/customwizardparameters.h index 5c757e2b835..59ee8599ccc 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardparameters.h +++ b/src/plugins/projectexplorer/customwizard/customwizardparameters.h @@ -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[]; diff --git a/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.h b/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.h index 6010a97e1b0..a3feb6b0b5d 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.h +++ b/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.h @@ -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 -- GitLab