[Uml-devel] kdesdk/umbrello/umbrello/codegenerators
Oliver Kellogg
okellogg at users.sourceforge.net
Fri Dec 3 12:56:00 UTC 2004
CVS commit by okellogg:
updateContent(): Just #include own header.
M +5 -25 cppsourcecodedocument.cpp 1.18
--- kdesdk/umbrello/umbrello/codegenerators/cppsourcecodedocument.cpp #1.17:1.18
@@ -187,29 +187,9 @@ void CPPSourceCodeDocument::updateConten
// INCLUDE CODEBLOCK
- //
- // Q: Why all utils? Isnt just List and Vector the only classes we are using?
- // A: doesn't matter at all; its more readable to just include '*' and cpp compilers
- // don't slow down or anything. (TZ)
QString includeStatement = "";
- includeStatement.append("#include \""+policy->getStringClassNameInclude()+"\""+endLine);
- if ( hasObjectVectorClassFields() )
- includeStatement.append("#include "+policy->getVectorClassNameInclude()+"\""+endLine);
-
- //only include classes in a different package from this class
- UMLClassifierList includes;
- QMap<UMLClassifier *,QString> *packageMap = new QMap<UMLClassifier*,QString>; // so we dont repeat packages
-
- gen->findObjectsRelated(c,includes);
- for(UMLClassifier *con = includes.first(); con ; con = includes.next())
- if (!(packageMap->contains(con)))
- {
- packageMap->insert(con,con->getPackage());
- includeStatement.append("#include \""+gen->cleanName(con->getName().lower())+".h\""+endLine);
- }
- // now, add/update the includes codeblock
+ // Include own header file
+ QString myOwnName( getParentClassifier()->getName() );
+ includeStatement.append("#include \""+gen->cleanName(myOwnName.lower())+".h\""+endLine);
CodeBlockWithComments * iblock = addOrUpdateTaggedCodeBlockWithComments("includes", includeStatement, QString::null, 0, false);
- if(includeStatement.isEmpty() && iblock->getContentType() == CodeBlock::AutoGenerated)
- iblock->setWriteOutText(false);
- else
iblock->setWriteOutText(true);
More information about the umbrello-devel
mailing list