Skip to content
Commit 5dc9f9c1 authored by Oliver Kellogg's avatar Oliver Kellogg
Browse files

1. Apply patch https://bugs.kde.org/attachment.cgi?id=96895 with review

   comments by Ralf Habacker addressed.
2. Fix generation of section comments:
   - In umbrello/umbrello.kcfg group "Code Generation" change Bool
     forceSections to writeSectionComments of type
     CodeGenerationPolicy::WriteSectionCommentsPolicy.
   - In umbrello/optionstate.h class CodeGenerationState change member
     forceSections to writeSectionComments of type
     CodeGenerationPolicy::WriteSectionCommentsPolicy.
   - In umbrello/codegenerators/codegenerationpolicy.{h,cpp},
     - add enum WriteSectionCommentsPolicy with values None,
       WhenNonEmpty, Always;
     - rename accessors {set,get}CodeVerboseSectionComments handling
       bool argument to {set,get}SectionCommentsPolicy handling arg of
       type WriteSectionCommentsPolicy, and manipulating
       Settings::optionState().codeGenerationState.writeSectionComments
       in lieu of the former forceSections;
     - change member `bool m_codeVerboseSectionComments` to
       `WriteSectionCommentsPolicy m_sectionCommentsPolicy`.
   - In umbrello/codegenerators/codegenerationpolicy.cpp adjust
     functions setDefaults and writeConfig to the UmbrelloSettings
     switchover from forceSections() to writeSectionComments().
   - In umbrello/codegenwizard/codegenoptionspage.ui change QCheckBox
     ui_forceSections to QComboBox ui_writeSectionComments with values
     "None", "When section is non empty", "Always".
   - In umbrello/codegenwizard/codegenoptionspage.cpp adjust constructor
     and function apply() to the codegenoptionspage.ui change.
   - In umbrello/codegenerators/codegenerator.{h,cpp},
     - change setForceSections(bool) to setSectionCommentPolicy with arg
       of type CodeGenerationPolicy::WriteSectionCommentsPolicy calling
       UMLApp::app()->commonPolicy()->setSectionCommentsPolicy(arg);
     - at getter forceSections() add TODO remark about changing return
       type to CodeGenerationPolicy::WriteSectionCommentsPolicy.
   - In umbrello/codegenerators/cpp/cppwriter.cpp :
     - Move setting of m_indentLevel from function writeHeaderFile to
       writeClassDecl so that class level comments are generated without
       indentation.
     - In functions writeSourceFile, writeAttributeDecls,
       writeAttributeMethods, writeConstructorDecls,
       writeConstructorMethods,
       - change test of forceDoc() to forceSections() when deciding
         whether to write section comments;
       - on generating section comments, change
           writeComment(QStringLiteral(" "), indnt, stream)
         to
           writeBlankLine(stream)
         in order to avoid ugly empty comments /*  */ in multi line
         comment mode.
     - In function writeHeaderAttributeAccessorMethods simplify call to
       writeAttributeMethods() by factoring the effective visibility
       into local `vis`.

CCBUG: 358293
parent b7f7858c
Pipeline #293710 passed with stage
in 3 minutes and 42 seconds
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