SUMMARY When using 'Code Generation Wizard...' it generates this include statement in *.h file for a class #include string It rather must be: #include <string> 'Generate All Code' instead works well STEPS TO REPRODUCE 1. Add a new class 'Something' to class Diagramm 2. Generate Code for this class through 'Code'->'Code Generation Wizard...' with default settings unchanged. OBSERVED RESULT Something.h contains #include string EXPECTED RESULT Something.h contains #include <string> REMARK vector include may have the same problem. SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
Could you please add the software and operating system versions that you are using.
(In reply to Sam Dyer from comment #1) > Could you please add the software and operating system versions that you are > using. SOFTWARE/OS VERSIONS Windows:- macOS: - Linux/KDE Plasma: Ubuntu 18.04.1 LTS [linux version 4.15.0-64-generic] KDE Plasma Version: KDE Frameworks Version: 5.44.0 Qt Version: Qt 5.9.5 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 7.3.0) on "xcb" ADDITIONAL INFORMATION Not observed on Windows Platform.
Thank you
I tried that with a build from git branch Applications/19.08, but was not able to reproduce that with default settings. I always get #include <string> in the header file. Please provide more information to reproduce this issue. It may be that related attributes are in the umbrello application config file named "umbrellorc" and located in the path returned from kf5-config --path config.
(In reply to Ralf Habacker from comment #4) > I tried that with a build from git branch Applications/19.08, but was not > able to reproduce that with default settings. I always get > > #include <string> > > in the header file. Please provide more information to reproduce this issue. > > It may be that related attributes are in the umbrello application config > file named "umbrellorc" and located in the path returned from kf5-config > --path config. behlingc@homedesk:~/projects$ cat /home/behlingc/.config/umbrellorc [Class Options] defaultAttributeScope=Private [Code Generation] overwritePolicy=Ok [General Options] Geometry=1853,920 autosavetime=5 [MainWindow] Height 1015=960 Height 975=920 State=AAAA/wAAAAD9AAAAAgAAAAAAAADtAAADG/wCAAAAAvwAAABgAAABdwAAAHYBAAAc+gAAAAACAAAAA/sAAAAYAFQAcgBlAGUAVgBpAGUAdwBEAG8AYwBrAQAAAAD/////AAAAWQD////7AAAAIgBTAHQAZQByAGUAbwB0AHkAcABlAHMAVwBpAG4AZABvAHcBAAAAAP////8AAABZAP////sAAAAcAEQAaQBhAGcAcgBhAG0AcwBXAGkAbgBkAG8AdwEAAAAA/////wAAAFkA/////AAAAd0AAAGeAAAAkgEAABz6AAAAAAIAAAAE+wAAACIARABvAGMAdQBtAGUAbgB0AGEAdABpAG8AbgBEAG8AYwBrAQAAAAD/////AAAAdQD////7AAAAHABDAG0AZABIAGkAcwB0AG8AcgB5AEQAbwBjAGsBAAAAAP////8AAABZAP////sAAAAOAEwAbwBnAEQAbwBjAGsBAAAAAP////8AAABZAP////sAAAASAEQAZQBiAHUAZwBEAG8AYwBrAQAAAAD/////AAAAWQD///8AAAABAAABCQAAAxv8AgAAAAL7AAAAGABCAGkAcgBkAFYAaQBlAHcARABvAGMAawEAAABgAAABxgAAAFkA////+wAAABYAVwBlAGwAYwBvAG0AZQBEAG8AYwBrAQAAAiwAAAFPAAAAEwD///8AAAU7AAADGwAAAAQAAAAEAAAACAAAAAj8AAAAAgAAAAIAAAABAAAAFgBtAGEAaQBuAFQAbwBvAGwAQgBhAHIBAAAAAP////8AAAAAAAAAAAAAAAIAAAABAAAAFgB3AG8AcgBrAHQAbwBvAGwAYgBhAHIBAAAAAP////8AAAAAAAAAAA== ToolBarsMovable=Disabled Width 1920=1853 Window-Maximized 1015x1920=true Window-Maximized 975x1920=true [MainWindow][Toolbar worktoolbar] ToolButtonStyle=IconOnly [Recent Files] File1[$e]=$HOME/projects/BSSim/umbrellogen Name1[$e]=umbrellogen [UI Options] fillColor=255,255,192 gridDotColor=247,245,243 [workbar] ToolButtonStyle=IconOnly
(In reply to Ralf Habacker from comment #4) > I tried that with a build from git branch Applications/19.08, but was not > able to reproduce that with default settings. I always get > > #include <string> > > in the header file. Please provide more information to reproduce this issue. > > It may be that related attributes are in the umbrello application config > file named "umbrellorc" and located in the path returned from kf5-config > --path config. Not sure if you overlooked that small info that this only happens through 'Code->Code Generation Wizard...'. With 'Code->Generate All Code' it woks well.
(In reply to Carsten Behling from comment #6) > Not sure if you overlooked that small info that this only happens through > 'Code->Code Generation Wizard...'. With 'Code->Generate All Code' it woks > well. It looks that the <string> include is added uncoditional. See https://cgit.kde.org/umbrello.git/tree/umbrello/codegenerators/cpp/cppwriter.cpp?h=Applications/19.08#n349 for details
Git commit ccb62d3128a5ca6dd3edf7b4c5bad565bbac3758 by Ralf Habacker. Committed on 16/11/2019 at 13:14. Pushed by habacker into branch 'release/19.12'. Fix of string includes in c++ code generator Since the types used are collected in writeClassDecl(), it is necessary to determine the required includes afterwards. FIXED-IN:2.29.90 (KDE Release 19.11.90) M +33 -14 umbrello/codegenerators/cpp/cppwriter.cpp M +2 -2 umbrello/codegenerators/cpp/cppwriter.h https://commits.kde.org/umbrello/ccb62d3128a5ca6dd3edf7b4c5bad565bbac3758