[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Mon May 17 22:36:10 UTC 2004


CVS commit by okellogg: 

Partial fix for bugs.kde.org/80999: Generate correct directory structure
 in the presence of multi-level package nesting.


  M +3 -4      codegenerator.cpp   1.45
  M +8 -2      umlobject.cpp   1.33
  M +1 -1      umlobject.h   1.32


--- kdesdk/umbrello/umbrello/codegenerator.cpp  #1.44:1.45
@@ -524,4 +524,5 @@ QString CodeGenerator::findFileName ( Co
         // if path is given add this as a directory to the file name
         if (!path.isEmpty()) {
+                path.replace(QRegExp("::"), "/"); // Simple hack!
                 name = path + "/" + codeDocument->getFileName();
                 path = "/" + path;
@@ -530,8 +531,6 @@ QString CodeGenerator::findFileName ( Co
         }
 
-        // Convert all "." to "/" : Platform-specific path separator
-        // What UNIX platform has '.' for path separator?? Its usefull for
-        // Java, but we can treat that within the javacodegenerator. -b.t.
-        // name.replace(QRegExp("\\."),"/"); // Simple hack!
+        // Convert all "::" to "/" : Platform-specific path separator
+        name.replace(QRegExp("::"), "/"); // Simple hack!
 
         // if a path name exists check the existence of the path directory

--- kdesdk/umbrello/umbrello/umlobject.cpp  #1.32:1.33
@@ -256,8 +256,14 @@ QString UMLObject::getStereotype() {
 }
 
-QString UMLObject::getPackage() {
+QString UMLObject::getPackage(QString separator /* ="::" */) {
         if (m_pUMLPackage == NULL)
                 return "";
-        return m_pUMLPackage->getName();
+        QStringList pkgList;
+        UMLPackage* pkg = m_pUMLPackage;
+        while (pkg != NULL) {
+                pkgList.prepend(pkg->getName());
+                pkg = pkg->getUMLPackage();
+        }
+        return pkgList.join(separator);
 }
 

--- kdesdk/umbrello/umbrello/umlobject.h  #1.31:1.32
@@ -157,5 +157,5 @@ public:
          * @return      Returns the classes package as a text.
          */
-        QString getPackage();
+        QString getPackage(QString separator = "::");
 
         /**






More information about the umbrello-devel mailing list