[Uml-devel] KDE/kdesdk/umbrello/umbrello/codegenerators

Andi Fischer andi.fischer at hispeed.ch
Sat Feb 4 20:00:07 UTC 2012


SVN commit 1278134 by fischer:

Unused methods and attributes removed.

 M  +15 -26    simplecodegenerator.cpp  
 M  +1 -7      simplecodegenerator.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/simplecodegenerator.cpp #1278133:1278134
@@ -5,7 +5,7 @@
  *   (at your option) any later version.                                   *
  *                                                                         *
  *   copyright (C) 2003      Brian Thomas <thomas at mail630.gsfc.nasa.gov>   *
- *   copyright (C) 2004-2011                                               *
+ *   copyright (C) 2004-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -44,12 +44,20 @@
  * Constructor.
  */
 SimpleCodeGenerator::SimpleCodeGenerator(bool createDirHierarchyForPackages)
+  : CodeGenerator(),
+    m_createDirHierarchyForPackages(createDirHierarchyForPackages),
+    m_indentLevel(0)
 {
-    m_indentLevel = 0;
-    UMLDoc * parentDoc = UMLApp::app()->document();
-    parentDoc->disconnect(this); // disconnect from UMLDoc.. we arent planning to be synced at all
-    m_createDirHierarchyForPackages = createDirHierarchyForPackages;
-    initFields(parentDoc);
+    m_document->disconnect(this); // disconnect from UMLDoc.. we arent planning to be synced at all
+
+    // load Classifier documents from parent document
+    // initFromParentDocument();
+
+    m_fileMap.clear();
+
+    // this really is just being used to sync the internal params
+    // to the codegenpolicy as there are no code documents to really sync.
+    syncCodeToDocument();
 }
 
 /**
@@ -204,7 +212,6 @@
             return QString();
             break;
         }
-
         break;
     case CodeGenerationPolicy::Never: //generate similar name
         suffix = 1;
@@ -274,7 +281,7 @@
 void SimpleCodeGenerator::writeCodeToFile()
 {
     m_fileMap.clear(); // need to do this, else just keep getting same directory to write to.
-    UMLClassifierList concepts = m_doc->classesAndInterfaces();
+    UMLClassifierList concepts = m_document->classesAndInterfaces();
     foreach (UMLClassifier* c, concepts ) {
         if (! Model_Utils::isCommonDataType(c->name()))
             this->writeClass(c); // call the writer for each class.
@@ -294,24 +301,6 @@
 }
 
 /**
- * Initialization of fields.
- * @param parentDoc   the parent document
- */
-void SimpleCodeGenerator::initFields(UMLDoc * parentDoc)
-{
-    // load Classifier documents from parent document
-    // initFromParentDocument();
-
-    m_fileMap.clear();
-    m_applyToAllRemaining = true;
-    m_doc = parentDoc;
-
-    // this really is just being used to sync the internal params
-    // to the codegenpolicy as there are no code documents to really sync.
-    syncCodeToDocument();
-}
-
-/**
  * A little method to provide some compatibility between
  * the newer codegenpolicy object and the older class fields.
  */
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/simplecodegenerator.h #1278133:1278134
@@ -5,7 +5,7 @@
  *   (at your option) any later version.                                   *
  *                                                                         *
  *   copyright (C) 2003      Brian Thomas <thomas at mail630.gsfc.nasa.gov>   *
- *   copyright (C) 2004-2011                                               *
+ *   copyright (C) 2004-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -62,8 +62,6 @@
      */
     QMap<UMLPackage*,QString> m_fileMap;
 
-    UMLDoc *m_doc;  ///< the parent document
-
     /**
      * For some code generators, it does not make much sense to create a
      * directory for each package because that would lead to a rather
@@ -80,10 +78,6 @@
     // override parent method..we need special handling
     void initFromParentDocument();
 
-private:
-
-    void initFields(UMLDoc * doc) ;
-
 public slots:
 
     void syncCodeToDocument();




More information about the umbrello-devel mailing list