C++-Settings/License template: Add %FILENAME%, %CLASS% placeholders.

... for doxygen. Change logic for known empty keywords to be replaced
by an empty string.

Task-number: QTCREATORBUG-1854
This commit is contained in:
Friedemann Kleint
2010-08-09 12:23:21 +02:00
parent 934a9590c4
commit 7ab30d8a63
14 changed files with 78 additions and 45 deletions

View File

@@ -233,14 +233,19 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
if (namespaceList.empty()) // Paranoia!
return false;
const QString license = CppTools::AbstractEditorSupport::licenseTemplate();
const QString headerLicense =
CppTools::AbstractEditorSupport::licenseTemplate(params.headerFile,
params.className);
const QString sourceLicense =
CppTools::AbstractEditorSupport::licenseTemplate(params.sourceFile,
params.className);
const QString unqualifiedClassName = namespaceList.takeLast();
const QString guard = Utils::headerGuard(params.headerFile);
// == Header file ==
QTextStream headerStr(header);
headerStr << license << "#ifndef " << guard
headerStr << headerLicense << "#ifndef " << guard
<< "\n#define " << guard << '\n';
const QRegExp qtClassExpr(QLatin1String("^Q[A-Z3].+"));
@@ -328,7 +333,7 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
// == Source file ==
QTextStream sourceStr(source);
sourceStr << license;
sourceStr << sourceLicense;
Utils::writeIncludeFileDirective(params.headerFile, false, sourceStr);
if (params.classType == Utils::NewClassWidget::SharedDataClass)
Utils::writeIncludeFileDirective(QLatin1String("QSharedData"), true, sourceStr);