Commit 01b2b163 authored by Ralf Habacker's avatar Ralf Habacker

Fix 'Message "too big indentation amount" on windows'.

The type of the struct's  ...CodeGenerationState are changed
into classes, constructors are added and class members are
initialized to useful defaults.

The code generator line ending type is initialized accordingly
to the platform umbrello is build for.

BUG:358731
FIXED-IN:2.18.2 (KDE Applications 15.12.2)
parent 95d55416
......@@ -325,13 +325,8 @@ void CodeGenerationPolicy::calculateIndentation ()
break;
}
if (Settings::optionState().codeGenerationState.indentationAmount > 999) { //:TODO: fix this - no initialization
uDebug() << "too big indentation amount = " << Settings::optionState().codeGenerationState.indentationAmount;
}
else {
for (int i = 0; i < Settings::optionState().codeGenerationState.indentationAmount; ++i) {
m_indentation += indent;
}
for (int i = 0; i < Settings::optionState().codeGenerationState.indentationAmount; ++i) {
m_indentation += indent;
}
}
......
......@@ -121,7 +121,30 @@ public:
Uml::Visibility::Enum defaultOperationScope;
};
struct CodeGenerationState {
class CodeGenerationState {
public:
CodeGenerationState()
: autoGenEmptyConstructors(false),
commentStyle(CodeGenerationPolicy::SingleLine),
defaultAssocFieldScope(Uml::Visibility::Public),
defaultAttributeAccessorScope(Uml::Visibility::Public),
forceDoc(false),
forceSections(false),
includeHeadings(false),
indentationAmount(false),
indentationType(CodeGenerationPolicy::NONE),
#ifdef Q_OS_WIN
lineEndingType(CodeGenerationPolicy::DOS),
#elifdef Q_OS_MAC
lineEndingType(CodeGenerationPolicy::MAC),
#else
lineEndingType(CodeGenerationPolicy::UNIX),
#endif
modnamePolicy(CodeGenerationPolicy::No),
overwritePolicy(CodeGenerationPolicy::Ok)
{
}
bool autoGenEmptyConstructors;
CodeGenerationPolicy::CommentStyle commentStyle;
Uml::Visibility::Enum defaultAssocFieldScope;
......@@ -137,7 +160,20 @@ struct CodeGenerationState {
QDir outputDirectory;
CodeGenerationPolicy::OverwritePolicy overwritePolicy;
struct CPPCodeGenerationState {
class CPPCodeGenerationState {
public:
CPPCodeGenerationState()
: autoGenAccessors(false),
inlineAccessors(false),
inlineOps(false),
packageIsNamespace(false),
publicAccessors(false),
stringIncludeIsGlobal(false),
vectorIncludeIsGlobal(false),
virtualDestructors(false)
{
}
bool autoGenAccessors;
bool inlineAccessors;
bool inlineOps;
......@@ -153,19 +189,42 @@ struct CodeGenerationState {
bool virtualDestructors;
};
struct DCodeGenerationState {
class DCodeGenerationState {
public:
DCodeGenerationState()
: autoGenerateAttributeAccessors(false),
autoGenerateAssocAccessors(false),
buildANTDocument(false)
{
}
bool autoGenerateAttributeAccessors;
bool autoGenerateAssocAccessors;
bool buildANTDocument;
};
struct JavaCodeGenerationState{
class JavaCodeGenerationState {
public:
JavaCodeGenerationState()
: autoGenerateAttributeAccessors(false),
autoGenerateAssocAccessors(false),
buildANTDocument(false)
{
}
bool autoGenerateAttributeAccessors;
bool autoGenerateAssocAccessors;
bool buildANTDocument;
};
struct RubyCodeGenerationState{
class RubyCodeGenerationState {
public:
RubyCodeGenerationState()
: autoGenerateAttributeAccessors(false),
autoGenerateAssocAccessors(false)
{
}
bool autoGenerateAttributeAccessors;
bool autoGenerateAssocAccessors;
};
......
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