SUMMARY Though <<interface>> stereotype is given 1. '= 0' declaration is not is not used 2. an implementation file *.cpp is created 3. 'virtual' and 'abstract' are optional though the class is an interface istead of always 'abstract' and 'virtual' 4. choice between 'private', 'protected' and 'public' is possible instead of always 'public' STEPS TO REPRODUCE 1. create an interface 2. add a method 'void test()' 3. generate code from the interface OBSERVED RESULT 1. *.cpp file is generated 2. 'void test()' is not pure virtual and has an implementation 3. method options 'abstract' and 'virtual' are optional in the dialog 4. 'public', 'protected' and 'private' are selectable EXPECTED RESULT 1. Only a header is generated. 2. Only public pure virtual functions are available and no more options are available. SOFTWARE/OS VERSIONS Windows: 2.29.0 macOS: - Linux/KDE Plasma: - (available in About System) KDE Plasma Version: - KDE Frameworks Version: - Qt Version: - ADDITIONAL INFORMATION
Git commit 869268b5edc00f96075d5304e84ec14ed867974a by Ralf Habacker. Committed on 28/10/2019 at 15:35. Pushed by habacker into branch 'Applications/19.08'. Disable unrelated checkboxes in operation property dialog for interfaces Methods on interfaces are always abstract, virtual, non inline, public and can not override. M +6 -0 umbrello/dialogs/umloperationdialog.cpp https://commits.kde.org/umbrello/869268b5edc00f96075d5304e84ec14ed867974a
Git commit ef47ab7b242aa87b5cd4d8e5abeb841e2b00d663 by Ralf Habacker. Committed on 28/10/2019 at 15:10. Pushed by habacker into branch 'Applications/19.08'. cppwriter: Add support for writing abstract methods M +4 -1 umbrello/codegenerators/cpp/cppwriter.cpp https://commits.kde.org/umbrello/ef47ab7b242aa87b5cd4d8e5abeb841e2b00d663
Git commit 0333988fc16e0a403cdd306e3e213f0b7a5c6dcb by Ralf Habacker. Committed on 28/10/2019 at 15:35. Pushed by habacker into branch 'Applications/19.08'. Fixes missing initialisation of members m_inline and m_abstract of class UMLOperation M +6 -2 umbrello/uml1model/operation.cpp https://commits.kde.org/umbrello/0333988fc16e0a403cdd306e3e213f0b7a5c6dcb
Git commit c3afcda6559537dfff238f6783d8f9a782b294e0 by Ralf Habacker. Committed on 28/10/2019 at 15:35. Pushed by habacker into branch 'Applications/19.08'. When creating class methods for an interface through the user interface set abstract and virtual attributes FIXED-IN:2.29.3 (KDE Applications 19.08.03) M +5 -0 umbrello/uml1model/classifier.cpp https://commits.kde.org/umbrello/c3afcda6559537dfff238f6783d8f9a782b294e0
Git commit aa52c15a8ff69434950abdbf220ddbf2113604d5 by Ralf Habacker. Committed on 28/10/2019 at 15:45. Pushed by habacker into branch 'Applications/19.08'. cppwriter: In case of interfaces, do not write a superfluous .cpp file M +1 -1 umbrello/codegenerators/cpp/cppwriter.cpp https://commits.kde.org/umbrello/aa52c15a8ff69434950abdbf220ddbf2113604d5
Verified with aa52c15a8ff69434950abdbf220ddbf2113604d5 on Applications/19.08. Works basically. Just one issue: The generated code still contains sections and Doxygen comments indicating accessor methods like this: // Protected attribute accessor methods Since interfaces doesn't have attributes accessor method sections wouldn't make sense.
This depends on code generator settings. See settings->Umbrello-Settings->Code generation->formatting. There are two checkboxes, which are related to comments in source code. I unchecked these boxes and those comments are not included on code generating.
BTW: I cleaned up partially the generated c++ code, see bug 413574.
(In reply to Ralf Habacker from comment #8) > BTW: I cleaned up partially the generated c++ code, see bug 413574. I unchecked - "Write documentationcomments even if empty" - "Write comments for sections even if section i empty" there a lot of empty 'public:'/'private:' sections remaining: --- cut here --- #ifndef ISOMETHING_H #define ISOMETHING_H #include <string> class ISomething { public: /** */ virtual void doSomething () = 0; protected: public: protected: public: protected: private: public: private: public: private: }; #endif // ISOMETHING_H --- cut here --- It seems to belong into bug 413574 but it`s closed.
(In reply to Carsten Behling from comment #9) > (In reply to Ralf Habacker from comment #8) > > there a lot of empty 'public:'/'private:' sections remaining: ... > It seems to belong into bug 413574 but it`s closed. Because this issue has been fixed with the mentioned ticket :-)
(In reply to Ralf Habacker from comment #10) > (In reply to Carsten Behling from comment #9) > > (In reply to Ralf Habacker from comment #8) > > > > there a lot of empty 'public:'/'private:' sections remaining: > ... > > It seems to belong into bug 413574 but it`s closed. > Because this issue has been fixed with the mentioned ticket :-) My real question is: Should I report another Bug for that?
(In reply to Carsten Behling from comment #11) > (In reply to Ralf Habacker from comment #10) > > (In reply to Carsten Behling from comment #9) > > > (In reply to Ralf Habacker from comment #8) > > > > > > there a lot of empty 'public:'/'private:' sections remaining: > > ... > > > It seems to belong into bug 413574 but it`s closed. > > Because this issue has been fixed with the mentioned ticket :-) > > My real question is: > > Should I report another Bug for that? I see it's gone with a6f00ce109f8b834eaa8aaefc7a9408a86ef6f33 on Applications/19.08.