diff options
author | Tobias Hunger <tobias.hunger@digia.com> | 2014-07-24 10:59:11 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@digia.com> | 2014-07-24 12:05:16 +0200 |
commit | 43953fe05ce0a1c77ce3dbc1206038a958d676b9 (patch) | |
tree | 8cdd956e2ce6a85f23d4165d5ab28802fbbfaac0 | |
parent | 5df28e57b9bf6d9fb010611f01eab9fd2667f083 (diff) |
Designer: Remove indention setting from FormClassWizardGenerationParameters
There is no UI for that anymore.
Change-Id: Ib8c5c4735870af7e5196416bf1a99fe846c6c410
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
-rw-r--r-- | src/plugins/designer/qtdesignerformclasscodegenerator.cpp | 20 | ||||
-rw-r--r-- | src/plugins/designer/qtdesignerformclasscodegenerator.h | 1 |
2 files changed, 7 insertions, 14 deletions
diff --git a/src/plugins/designer/qtdesignerformclasscodegenerator.cpp b/src/plugins/designer/qtdesignerformclasscodegenerator.cpp index 6739eae60f..57c589528b 100644 --- a/src/plugins/designer/qtdesignerformclasscodegenerator.cpp +++ b/src/plugins/designer/qtdesignerformclasscodegenerator.cpp @@ -47,11 +47,10 @@ static const char formClassWizardPageGroupC[] = "FormClassWizardPage"; static const char translationKeyC[] = "RetranslationSupport"; static const char embeddingModeKeyC[] = "Embedding"; -// TODO: These 3 are general coding convention settings and +// TODO: These 2 are general coding convention settings and // should go to CppTools... static const char includeQtModuleKeyC[] = "IncludeQtModule"; static const char addQtVersionCheckKeyC[] = "AddQtVersionCheck"; -static const char indentNamespaceKeyC[] = "IndentNamespace"; static const bool retranslationSupportDefault = false; @@ -62,8 +61,7 @@ FormClassWizardGenerationParameters::FormClassWizardGenerationParameters() : embedding(PointerAggregatedUiClass), retranslationSupport(retranslationSupportDefault), includeQtModule(false), - addQtVersionCheck(false), - indentNamespace(false) + addQtVersionCheck(false) { } @@ -75,7 +73,6 @@ void FormClassWizardGenerationParameters::fromSettings(const QSettings *settings embedding = static_cast<UiClassEmbedding>(settings->value(group + QLatin1String(embeddingModeKeyC), int(PointerAggregatedUiClass)).toInt()); includeQtModule = settings->value(group + QLatin1String(includeQtModuleKeyC), false).toBool(); addQtVersionCheck = settings->value(group + QLatin1String(addQtVersionCheckKeyC), false).toBool(); - indentNamespace = settings->value(group + QLatin1String(indentNamespaceKeyC), false).toBool(); } void FormClassWizardGenerationParameters::toSettings(QSettings *settings) const @@ -85,7 +82,6 @@ void FormClassWizardGenerationParameters::toSettings(QSettings *settings) const settings->setValue(QLatin1String(embeddingModeKeyC), embedding); settings->setValue(QLatin1String(includeQtModuleKeyC), includeQtModule); settings->setValue(QLatin1String(addQtVersionCheckKeyC), addQtVersionCheck); - settings->setValue(QLatin1String(indentNamespaceKeyC), indentNamespace); settings->endGroup(); } @@ -94,8 +90,7 @@ bool FormClassWizardGenerationParameters::equals(const FormClassWizardGeneration return embedding == rhs.embedding && retranslationSupport == rhs.retranslationSupport && includeQtModule == rhs.includeQtModule - && addQtVersionCheck == rhs.addQtVersionCheck - && indentNamespace == rhs.indentNamespace; + && addQtVersionCheck == rhs.addQtVersionCheck; } // Generation code @@ -185,8 +180,7 @@ bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParamete } } - const QString namespaceIndent = Utils::writeOpeningNameSpaces(namespaceList, - generationParameters.indentNamespace ? indent : QString(), + const QString namespaceIndent = Utils::writeOpeningNameSpaces(namespaceList, QString(), headerStr); // Forward-declare the UI class @@ -220,7 +214,7 @@ bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParamete headerStr << uiMemberC << ";\n"; } headerStr << namespaceIndent << "};\n\n"; - Utils::writeClosingNameSpaces(namespaceList, generationParameters.indentNamespace ? indent : QString(), headerStr); + Utils::writeClosingNameSpaces(namespaceList, QString(), headerStr); headerStr << "#endif // "<< guard << '\n'; // 2) Source file @@ -230,7 +224,7 @@ bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParamete if (generationParameters.embedding == Internal::PointerAggregatedUiClass) Utils::writeIncludeFileDirective(uiInclude, false, sourceStr); // NameSpaces( - Utils::writeOpeningNameSpaces(namespaceList, generationParameters.indentNamespace ? indent : QString(), sourceStr); + Utils::writeOpeningNameSpaces(namespaceList, QString(), sourceStr); // Constructor with setupUi sourceStr << '\n' << namespaceIndent << unqualifiedClassName << "::" << unqualifiedClassName << "(QWidget *parent) :\n" << namespaceIndent << indent << formBaseClass << "(parent)"; @@ -261,7 +255,7 @@ bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParamete << namespaceIndent << indent << "}\n" << namespaceIndent << "}\n"; } - Utils::writeClosingNameSpaces(namespaceList, generationParameters.indentNamespace ? indent : QString(), sourceStr); + Utils::writeClosingNameSpaces(namespaceList, QString(), sourceStr); return true; } diff --git a/src/plugins/designer/qtdesignerformclasscodegenerator.h b/src/plugins/designer/qtdesignerformclasscodegenerator.h index abe527a72c..168d54e03e 100644 --- a/src/plugins/designer/qtdesignerformclasscodegenerator.h +++ b/src/plugins/designer/qtdesignerformclasscodegenerator.h @@ -63,7 +63,6 @@ struct FormClassWizardGenerationParameters bool retranslationSupport; // Add handling for language change events bool includeQtModule; // Include "<QtGui/[Class]>" or just "<[Class]>" bool addQtVersionCheck; // Include #ifdef when using "#include <QtGui/..." - bool indentNamespace; }; inline bool operator==(const FormClassWizardGenerationParameters &p1, const FormClassWizardGenerationParameters &p2) { return p1.equals(p2); } |