forked from qt-creator/qt-creator
Customwizard: Remove unused code.
This commit is contained in:
@@ -189,7 +189,7 @@ Core::GeneratedFiles CustomWizard::generateFiles(const QWizard *dialog, QString
|
|||||||
QTC_ASSERT(cwp, return Core::GeneratedFiles())
|
QTC_ASSERT(cwp, return Core::GeneratedFiles())
|
||||||
|
|
||||||
CustomWizardContextPtr ctx = context();
|
CustomWizardContextPtr ctx = context();
|
||||||
ctx->targetPath = cwp->path();
|
ctx->path = ctx->targetPath = cwp->path();
|
||||||
ctx->replacements = replacementMap(dialog);
|
ctx->replacements = replacementMap(dialog);
|
||||||
if (CustomWizardPrivate::verbose) {
|
if (CustomWizardPrivate::verbose) {
|
||||||
QString logText;
|
QString logText;
|
||||||
@@ -493,19 +493,14 @@ Core::GeneratedFiles CustomProjectWizard::generateFiles(const QWizard *w, QStrin
|
|||||||
QTC_ASSERT(dialog, return Core::GeneratedFiles())
|
QTC_ASSERT(dialog, return Core::GeneratedFiles())
|
||||||
// Add project name as macro. Path is here under project directory
|
// Add project name as macro. Path is here under project directory
|
||||||
CustomWizardContextPtr ctx = context();
|
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 fieldReplacementMap = replacementMap(dialog);
|
||||||
fieldReplacementMap.insert(QLatin1String("ProjectName"), dialog->projectName());
|
fieldReplacementMap.insert(QLatin1String("ProjectName"), dialog->projectName());
|
||||||
ctx->replacements = fieldReplacementMap;
|
ctx->replacements = fieldReplacementMap;
|
||||||
if (CustomWizardPrivate::verbose)
|
if (CustomWizardPrivate::verbose)
|
||||||
qDebug() << "CustomProjectWizard::generateFiles" << dialog << ctx->targetPath << ctx->replacements;
|
qDebug() << "CustomProjectWizard::generateFiles" << dialog << ctx->targetPath << ctx->replacements;
|
||||||
const Core::GeneratedFiles generatedFiles = generateWizardFiles(errorMessage);
|
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;
|
return generatedFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -791,8 +791,8 @@ void CustomWizardContext::reset()
|
|||||||
baseReplacements.insert(QLatin1String("CppHeaderSuffix"),
|
baseReplacements.insert(QLatin1String("CppHeaderSuffix"),
|
||||||
mdb->preferredSuffixByType(QLatin1String(CppTools::Constants::CPP_HEADER_MIMETYPE)));
|
mdb->preferredSuffixByType(QLatin1String(CppTools::Constants::CPP_HEADER_MIMETYPE)));
|
||||||
replacements.clear();
|
replacements.clear();
|
||||||
|
path.clear();
|
||||||
targetPath.clear();
|
targetPath.clear();
|
||||||
projectFilePath.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CustomWizardContext::processFile(const FieldReplacementMap &fm, QString in)
|
QString CustomWizardContext::processFile(const FieldReplacementMap &fm, QString in)
|
||||||
|
|||||||
@@ -143,10 +143,11 @@ struct CustomWizardContext {
|
|||||||
|
|
||||||
FieldReplacementMap baseReplacements;
|
FieldReplacementMap baseReplacements;
|
||||||
FieldReplacementMap replacements;
|
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 targetPath;
|
||||||
QString projectFilePath;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const char customWizardFileOpenEditorAttributeC[];
|
extern const char customWizardFileOpenEditorAttributeC[];
|
||||||
|
|||||||
@@ -48,11 +48,11 @@ struct GeneratorScriptArgument;
|
|||||||
* attribute of the <files> element) which actually creates files.
|
* attribute of the <files> element) which actually creates files.
|
||||||
* The command line of the script must follow the convention
|
* 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
|
* As Qt Creator needs to know the file names before actually creates them to
|
||||||
* do overwrite checking etc., this is 2-step process:
|
* do overwrite checking etc., this is 2-step process:
|
||||||
* 1) Determine file names and attributes: The script is called with the
|
* 1) Determine file names and attributes: The script is called with the
|
||||||
|
|||||||
Reference in New Issue
Block a user