Commit 0457a2eb authored by Oliver Kellogg's avatar Oliver Kellogg
Browse files

Const correctness fixes addressing roughly the first half of attachment 141364.

Changes that did not succeed offhand are postponed to a second batch.

CCBUG: 442134
parent 8ac7e25d
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2002 Oliver Kellogg <okellogg@users.sourceforge.net>
SPDX-FileCopyrightText: 2003-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2003-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
#include "adawriter.h"
......@@ -495,7 +495,7 @@ void AdaWriter::writeOperation(UMLOperation *op, QTextStream &ada, bool is_comme
/**
* Returns the default datatypes.
*/
QStringList AdaWriter::defaultDatatypes()
QStringList AdaWriter::defaultDatatypes() const
{
QStringList l;
l.append(QLatin1String("Boolean"));
......
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2002 Oliver Kellogg <okellogg@users.sourceforge.net>
SPDX-FileCopyrightText: 2003-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2003-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
#ifndef ADAWRITER_H
......@@ -37,7 +37,7 @@ public:
virtual Uml::ProgrammingLanguage::Enum language() const;
QStringList defaultDatatypes();
QStringList defaultDatatypes() const;
virtual bool isReservedKeyword(const QString & rPossiblyReservedKeyword);
......
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
// own header
......@@ -48,7 +48,8 @@ ClassifierCodeDocument::~ClassifierCodeDocument()
/**
* Get a list of codeclassifier objects held by this classifiercodedocument that meet the passed criteria.
*/
CodeClassFieldList ClassifierCodeDocument::getSpecificClassFields(CodeClassField::ClassFieldType cfType)
CodeClassFieldList
ClassifierCodeDocument::getSpecificClassFields(CodeClassField::ClassFieldType cfType) const
{
CodeClassFieldList list;
CodeClassFieldList::ConstIterator it = m_classfieldVector.constBegin();
......@@ -64,7 +65,8 @@ CodeClassFieldList ClassifierCodeDocument::getSpecificClassFields(CodeClassField
/**
* Get a list of codeclassifier objects held by this classifiercodedocument that meet the passed criteria.
*/
CodeClassFieldList ClassifierCodeDocument::getSpecificClassFields(CodeClassField::ClassFieldType cfType, bool isStatic)
CodeClassFieldList
ClassifierCodeDocument::getSpecificClassFields(CodeClassField::ClassFieldType cfType, bool isStatic) const
{
CodeClassFieldList list;
CodeClassFieldList::ConstIterator it = m_classfieldVector.constBegin();
......@@ -81,7 +83,9 @@ CodeClassFieldList ClassifierCodeDocument::getSpecificClassFields(CodeClassField
/**
* Get a list of codeclassifier objects held by this classifiercodedocument that meet the passed criteria.
*/
CodeClassFieldList ClassifierCodeDocument::getSpecificClassFields (CodeClassField::ClassFieldType cfType, Uml::Visibility::Enum visibility)
CodeClassFieldList
ClassifierCodeDocument::getSpecificClassFields (CodeClassField::ClassFieldType cfType,
Uml::Visibility::Enum visibility) const
{
CodeClassFieldList list;
CodeClassFieldList::ConstIterator it = m_classfieldVector.constBegin();
......@@ -98,7 +102,9 @@ CodeClassFieldList ClassifierCodeDocument::getSpecificClassFields (CodeClassFiel
/**
* Get a list of codeclassifier objects held by this classifiercodedocument that meet the passed criteria.
*/
CodeClassFieldList ClassifierCodeDocument::getSpecificClassFields (CodeClassField::ClassFieldType cfType, bool isStatic, Uml::Visibility::Enum visibility)
CodeClassFieldList
ClassifierCodeDocument::getSpecificClassFields (CodeClassField::ClassFieldType cfType,
bool isStatic, Uml::Visibility::Enum visibility) const
{
CodeClassFieldList list;
CodeClassFieldList::ConstIterator it = m_classfieldVector.constBegin();
......@@ -118,15 +124,15 @@ CodeClassFieldList ClassifierCodeDocument::getSpecificClassFields (CodeClassFiel
/**
* Tell if any of the accessor classfields will be of lists of objects.
*/
bool ClassifierCodeDocument::hasObjectVectorClassFields()
bool ClassifierCodeDocument::hasObjectVectorClassFields() const
{
CodeClassFieldList::Iterator it = m_classfieldVector.begin();
CodeClassFieldList::Iterator end = m_classfieldVector.end();
CodeClassFieldList::const_iterator it = m_classfieldVector.begin();
CodeClassFieldList::const_iterator end = m_classfieldVector.end();
for (; it != end; ++it)
{
if((*it)->getClassFieldType() != CodeClassField::Attribute)
{
UMLRole * role = (*it)->getParentObject()->asUMLRole();
const UMLRole * role = (*it)->getParentObject()->asUMLRole();
if (!role) {
uError() << "invalid parent object type";
return false;
......@@ -145,7 +151,7 @@ bool ClassifierCodeDocument::hasObjectVectorClassFields()
/**
* Does this object have any classfields declared?
*/
bool ClassifierCodeDocument::hasClassFields()
bool ClassifierCodeDocument::hasClassFields() const
{
if(m_classfieldVector.count() > 0)
return true;
......@@ -155,7 +161,7 @@ bool ClassifierCodeDocument::hasClassFields()
/**
* Tell if one or more codeclassfields are derived from associations.
*/
bool ClassifierCodeDocument::hasAssociationClassFields()
bool ClassifierCodeDocument::hasAssociationClassFields() const
{
CodeClassFieldList list = getSpecificClassFields(CodeClassField::Attribute);
return (m_classfieldVector.count() - list.count()) > 0 ? true : false;
......@@ -164,7 +170,7 @@ bool ClassifierCodeDocument::hasAssociationClassFields()
/**
* Tell if one or more codeclassfields are derived from attributes.
*/
bool ClassifierCodeDocument::hasAttributeClassFields()
bool ClassifierCodeDocument::hasAttributeClassFields() const
{
CodeClassFieldList list = getSpecificClassFields(CodeClassField::Attribute);
return list.count() > 0 ? true : false;
......@@ -269,7 +275,7 @@ CodeClassFieldList * ClassifierCodeDocument::getCodeClassFieldList ()
* Get the value of m_parentclassifier
* @return the value of m_parentclassifier
*/
UMLClassifier * ClassifierCodeDocument::getParentClassifier ()
UMLClassifier * ClassifierCodeDocument::getParentClassifier () const
{
return m_parentclassifier;
}
......@@ -278,14 +284,14 @@ UMLClassifier * ClassifierCodeDocument::getParentClassifier ()
* Get a list of codeoperation objects held by this classifiercodedocument.
* @return QList<CodeOperation>
*/
QList<CodeOperation*> ClassifierCodeDocument::getCodeOperations ()
QList<const CodeOperation*> ClassifierCodeDocument::getCodeOperations () const
{
QList<CodeOperation*> list;
QList<const CodeOperation*> list;
TextBlockList * tlist = getTextBlockList();
foreach (TextBlock* tb, *tlist)
{
CodeOperation * cop = dynamic_cast<CodeOperation*>(tb);
const CodeOperation * cop = dynamic_cast<const CodeOperation*>(tb);
if (cop) {
list.append(cop);
}
......@@ -404,7 +410,7 @@ void ClassifierCodeDocument::declareClassFields (CodeClassFieldList & list,
/**
* Return if the parent classifier is a class
*/
bool ClassifierCodeDocument::parentIsClass()
bool ClassifierCodeDocument::parentIsClass() const
{
return (m_parentclassifier->baseType() == UMLObject::ot_Class);
}
......@@ -412,7 +418,7 @@ bool ClassifierCodeDocument::parentIsClass()
/**
* Return if the parent classifier is an interface
*/
bool ClassifierCodeDocument::parentIsInterface()
bool ClassifierCodeDocument::parentIsInterface() const
{
return (m_parentclassifier->baseType() == UMLObject::ot_Interface);
}
......@@ -644,7 +650,7 @@ void ClassifierCodeDocument::setAttributesFromNode (QDomElement & elem)
// by parent object ID and Role ID (needed for self-association CF's)
CodeClassField *
ClassifierCodeDocument::findCodeClassFieldFromParentID (Uml::ID::Type id,
int role_id)
int role_id)
{
CodeClassFieldList::Iterator it = m_classfieldVector.begin();
CodeClassFieldList::Iterator end = m_classfieldVector.end();
......@@ -667,7 +673,7 @@ ClassifierCodeDocument::findCodeClassFieldFromParentID (Uml::ID::Type id,
<< Uml::ID::toString(id) << " (role id:" << role_id
<< ") Do you have a corrupt classifier code document?";
return (CodeClassField*) 0; // not found
return nullptr; // not found
}
/**
......
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
#ifndef CLASSIFIERCODEDOCUMENT_H
......@@ -44,24 +44,27 @@ public:
// some Utility methods
bool parentIsInterface();
bool parentIsClass();
bool parentIsInterface() const;
bool parentIsClass() const;
bool hasAssociationClassFields();
bool hasAttributeClassFields();
bool hasObjectVectorClassFields();
bool hasClassFields();
bool hasAssociationClassFields() const;
bool hasAttributeClassFields() const;
bool hasObjectVectorClassFields() const;
bool hasClassFields() const;
QList<CodeOperation*> getCodeOperations();
QList<const CodeOperation*> getCodeOperations() const;
CodeClassFieldList getSpecificClassFields(CodeClassField::ClassFieldType cfType);
CodeClassFieldList getSpecificClassFields(CodeClassField::ClassFieldType cfType, bool isStatic);
CodeClassFieldList getSpecificClassFields(CodeClassField::ClassFieldType cfType, Uml::Visibility::Enum visibility);
CodeClassFieldList getSpecificClassFields(CodeClassField::ClassFieldType cfType, bool isStatic, Uml::Visibility::Enum visibility);
CodeClassFieldList getSpecificClassFields(CodeClassField::ClassFieldType cfType) const;
CodeClassFieldList getSpecificClassFields(CodeClassField::ClassFieldType cfType,
bool isStatic) const;
CodeClassFieldList getSpecificClassFields(CodeClassField::ClassFieldType cfType,
Uml::Visibility::Enum visibility) const;
CodeClassFieldList getSpecificClassFields(CodeClassField::ClassFieldType cfType,
bool isStatic, Uml::Visibility::Enum visibility) const;
CodeClassField * findCodeClassFieldFromParentID (Uml::ID::Type id, int role_id = -1);
UMLClassifier * getParentClassifier();
UMLClassifier * getParentClassifier() const;
void addCodeClassFieldMethods(CodeClassFieldList &list);
......
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
// own header
......@@ -94,7 +94,7 @@ void CodeDocument::setPackage (UMLPackage *new_var)
* Get the value of the path to this code document.
* @return the value of m_pathName
*/
QString CodeDocument::getPath ()
QString CodeDocument::getPath () const
{
QString path = getPackage();
......@@ -159,7 +159,7 @@ void CodeDocument::setWriteOutCode (bool new_var)
* owns.
* @return the value of m_writeOutCode
*/
bool CodeDocument::getWriteOutCode ()
bool CodeDocument::getWriteOutCode () const
{
return m_writeOutCode;
}
......@@ -177,7 +177,7 @@ void CodeDocument::setHeader (CodeComment * comment)
* Get the Header comment object.
* @return the comment for the header
*/
CodeComment * CodeDocument::getHeader ()
CodeComment * CodeDocument::getHeader () const
{
return m_header;
}
......@@ -187,7 +187,7 @@ CodeComment * CodeDocument::getHeader ()
* @param prefix the prefix to add
* @return the just created unique tag
*/
QString CodeDocument::getUniqueTag (const QString& prefix)
QString CodeDocument::getUniqueTag (const QString& prefix)
{
QString tag = prefix ;
if(tag.isEmpty())
......@@ -296,7 +296,7 @@ void CodeDocument::updateHeader ()
* Create the string representation of this object.
* @return the created string
*/
QString CodeDocument::toString ()
QString CodeDocument::toString () const
{
// IF the whole document is turned "Off" then don't bother
// checking individual code blocks, just send back empty string
......@@ -497,7 +497,7 @@ void CodeDocument::addChildTagToMap (const QString &tag, TextBlock * tb)
* @param descendIntoChildren look down the hierarchy
* @return the found text block
*/
TextBlock * CodeDocument::findTextBlockByTag(const QString &tag, bool descendIntoChildren)
TextBlock * CodeDocument::findTextBlockByTag(const QString &tag, bool descendIntoChildren) const
{
//if we already know to which file this class was written/should be written, just return it.
if (m_textBlockTagMap.contains(tag))
......
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
#ifndef CODEDOCUMENT_H
......@@ -44,22 +44,22 @@ public:
void setPackage (UMLPackage *new_var);
QString getPackage () const;
virtual QString getPath ();
virtual QString getPath () const;
void setID (const QString &new_id);
QString ID () const;
void setWriteOutCode (bool new_var);
bool getWriteOutCode ();
bool getWriteOutCode () const;
void setHeader (CodeComment * comment);
CodeComment * getHeader ();
CodeComment * getHeader () const;
bool insertTextBlock (TextBlock * newBlock, TextBlock * existingBlock, bool after = true);
TextBlock * findTextBlockByTag(const QString &tag, bool descendIntoChildren = false);
TextBlock * findTextBlockByTag(const QString &tag, bool descendIntoChildren = false) const;
virtual QString toString ();
virtual QString toString () const;
virtual void saveToXMI1(QXmlStreamWriter& writer);
virtual void loadFromXMI1 (QDomElement & root);
......
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
// own header
......@@ -778,7 +778,7 @@ bool CodeGenerator::forceSections() const
* Return the default datatypes for your language (bool, int etc).
* Default implementation returns empty list.
*/
QStringList CodeGenerator::defaultDatatypes()
QStringList CodeGenerator::defaultDatatypes() const
{
return QStringList();
//empty by default, override in your code generator
......
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
#ifndef CODEGENERATOR_H
......@@ -109,7 +109,7 @@ public:
CodeDocument * findCodeDocumentByClassifier(UMLClassifier * classifier);
virtual QStringList defaultDatatypes();
virtual QStringList defaultDatatypes() const;
virtual bool isReservedKeyword(const QString & keyword);
......
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
// own header
......@@ -144,7 +144,7 @@ UMLObject * CodeParameter::getParentObject()
// need to get the ID of the parent object
// this is kind of broken for UMLRoles.
QString CodeParameter::ID()
QString CodeParameter::ID() const
{
UMLRole * role = m_parentObject->asUMLRole();
if (role)
......
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
#ifndef CODEPARAMETER_H
......@@ -48,7 +48,7 @@ public:
CodeComment* getComment();
// the id of this parameter is the same as the parent UMLObject id.
QString ID();
QString ID() const;
virtual void updateContent() = 0;
......
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
// own header
......@@ -385,7 +385,7 @@ void CPPCodeGenerator::checkRemoveUMLObject(UMLObject * obj)
* Add C++ primitives as datatypes.
* @return a string list of C++ datatypes
*/
QStringList CPPCodeGenerator::defaultDatatypes()
QStringList CPPCodeGenerator::defaultDatatypes() const
{
return Codegen_Utils::cppDatatypes();
}
......
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
#ifndef CPPCODEGENERATOR_H
......@@ -48,7 +48,7 @@ public:
virtual void writeCodeToFile();
virtual void writeCodeToFile(UMLClassifierList &list);
QStringList defaultDatatypes();
QStringList defaultDatatypes() const;
virtual void saveToXMI1(QXmlStreamWriter& writer);
......
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
#include "cppcodegenerator.h"
......@@ -32,13 +32,13 @@ void CPPMakefileCodeDocument::updateContent()
/**
* @return QString
*/
QString CPPMakefileCodeDocument::toString ()
QString CPPMakefileCodeDocument::toString () const
{
return QLatin1String("# cpp make build document");
}
// We overwritten by CPP language implementation to get lowercase path
QString CPPMakefileCodeDocument::getPath ()
QString CPPMakefileCodeDocument::getPath () const
{
QString path = getPackage();
......
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
#ifndef CPPMAKECODEDOCUMENT_H
......@@ -36,9 +36,9 @@ public:
/**
* @return QString
*/
QString toString ();
QString toString () const;
QString getPath ();
QString getPath () const;
void updateContent();
......
......@@ -3,7 +3,7 @@
SPDX-FileCopyrightText: 2003 Brian Thomas
<brian.thomas@gsfc.nasa.gov>
SPDX-FileCopyrightText: 2004-2014 Umbrello UML Modeller Authors
SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors
<umbrello-devel@kde.org>
*/
......@@ -1422,7 +1422,7 @@ QString CppWriter::getAttributeMethodBaseName(const QString &fieldName)
* Add C++ primitives as datatypes.
* @return the list of default datatypes
*/
QStringList CppWriter::defaultDatatypes()
QStringList CppWriter::defaultDatatypes() const
{
return Codegen_Utils::cppDatatypes();
}
......
......@@ -3,7 +3,7 @@
SPDX-FileCopyrightText: 2003 Brian Thomas
<brian.thomas@gsfc.nasa.gov>
SPDX-FileCopyrightText: 2004-2014 Umbrello UML Modeller Authors
SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors
<umbrello-devel@kde.org>
*/
......@@ -39,7 +39,7 @@ public:
virtual Uml::ProgrammingLanguage::Enum language() const;
QStringList defaultDatatypes();
QStringList defaultDatatypes() const;
virtual QStringList reservedKeywords() const;
......
/*
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2007-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2007-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
#include "csharpwriter.h"
......@@ -110,7 +110,7 @@ CSharpWriter::~CSharpWriter()
/**
* Get list of predefined data types.
*/
QStringList CSharpWriter::defaultDatatypes()
QStringList CSharpWriter::defaultDatatypes() const
{
QStringList l;
l.append(QLatin1String("bool"));
......
/*
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2007-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2007-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
#ifndef CSHARPWRITER_H
......@@ -30,7 +30,7 @@ public:
virtual QStringList reservedKeywords() const;
QStringList defaultDatatypes();
QStringList defaultDatatypes() const;
private:
......
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2007 Jari-Matti Mäkelä <jmjm@iki.fi>
SPDX-FileCopyrightText: 2008-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2008-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
// own header
......@@ -62,7 +62,7 @@ bool DClassifierCodeDocument::forceDoc()
}
// We overwritten by D language implementation to get lowercase path
QString DClassifierCodeDocument::getPath()
QString DClassifierCodeDocument::getPath() const
{
QString path = getPackage();
......@@ -80,7 +80,7 @@ QString DClassifierCodeDocument::getPath()
return path;
}
QString DClassifierCodeDocument::getDClassName(const QString &name)
QString DClassifierCodeDocument::getDClassName(const QString &name) const
{
return Codegen_Utils::capitalizeFirstLetter(CodeGenerator::cleanName(name));
}
......
......@@ -2,7 +2,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2007 Jari-Matti Mäkelä <jmjm@iki.fi>
SPDX-FileCopyrightText: 2008-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
SPDX-FileCopyrightText: 2008-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
*/
#ifndef DCLASSIFIERCODEDOCUMENT_H
......@@ -41,9 +41,9 @@ public:
DCodeGenerationPolicy * getDPolicy();
QString getDClassName(const QString &name);
QString getDClassName(const QString &name) const;
QString getPath();
QString getPath() const;
bool addCodeOperation(CodeOperation * op);
......