summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <[email protected]>2018-04-05 22:34:24 +0200
committerRalf Habacker <[email protected]>2018-04-05 22:34:24 +0200
commitb2643163dc56c4b4dd735a90c01ad1c399ca47fa (patch)
treee25747562ecb451e501cec10863266e0494be761
parente7a7ca20424bd4f4b4f8aff278a8f83c16990f85 (diff)
Fix 'c++ import does not recognize const methods'v18.03.90
Also added a related import test case. BUG:392777 FIXED-IN:2.25.0 (KDE Applications 18.04.0)
-rw-r--r--test/import/cxx/const-methods.h3
-rw-r--r--umbrello/codeimport/kdevcppparser/cpptree2uml.cpp4
2 files changed, 7 insertions, 0 deletions
diff --git a/test/import/cxx/const-methods.h b/test/import/cxx/const-methods.h
new file mode 100644
index 0000000..7637aed
--- /dev/null
+++ b/test/import/cxx/const-methods.h
@@ -0,0 +1,3 @@
+class ConstMethodClass {
+ bool ConstMethod(QString &param) const;
+};
diff --git a/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp b/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp
index 00413a3..a9abc5d 100644
--- a/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp
+++ b/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp
@@ -347,6 +347,8 @@ void CppTree2Uml::parseFunctionDefinition(FunctionDefinitionAST* ast)
if (d->override())
m->setOverride(true);
+ if (d->constant())
+ m->setConst(true);
// if a class has no return type, it could be a constructor or
// a destructor
if (d && returnType.isEmpty()) {
@@ -636,6 +638,8 @@ void CppTree2Uml::parseFunctionDeclaration(GroupAST* funSpec, GroupAST* storageS
UMLOperation *m = Import_Utils::makeOperation(c, id);
if (d->override())
m->setOverride(true);
+ if (d->constant())
+ m->setConst(true);
if (isConstExpression)
m->setStereotype(QLatin1String("constexpr"));
// if a class has no return type, it could de a constructor or