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

Andi Fischer andi.fischer at hispeed.ch
Mon Jan 16 20:42:28 UTC 2012


SVN commit 1274012 by fischer:

Import for C# added. The class CSharpImport is not yet finished and needs much more work.

 M  +2 -0      CMakeLists.txt  
 M  +3 -0      codeimport/classimport.cpp  
 A             codeimport/csharp (directory)  
 A             codeimport/csharp/csharpimport.cpp   [License: GPL (v2+)]
 A             codeimport/csharp/csharpimport.h   [License: GPL (v2+)]
 M  +4 -1      codeimport/import_utils.cpp  
 M  +3 -0      codeimpwizard/codeimpselectpage.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/CMakeLists.txt #1274011:1274012
@@ -73,6 +73,7 @@
   ${CMAKE_CURRENT_SOURCE_DIR}/codegenerators/xml/
   ${CMAKE_CURRENT_SOURCE_DIR}/codegenwizard/
   ${CMAKE_CURRENT_SOURCE_DIR}/codeimport/
+  ${CMAKE_CURRENT_SOURCE_DIR}/codeimport/csharp/
   ${CMAKE_CURRENT_SOURCE_DIR}/codeimpwizard/
   ${CMAKE_CURRENT_SOURCE_DIR}/controller/
   ${CMAKE_CURRENT_SOURCE_DIR}/debug/
@@ -290,6 +291,7 @@
     codeimport/nativeimportbase.cpp
     codeimport/pascalimport.cpp
     codeimport/pythonimport.cpp
+    codeimport/csharp/csharpimport.cpp
 )
 
 if (WIN32 AND NOT MSVC)
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/classimport.cpp #1274011:1274012
@@ -27,6 +27,7 @@
 #ifndef DISABLE_CPP_IMPORT
 #include "cppimport.h"
 #endif
+#include "csharpimport.h"
 #include "codeimpthread.h"
 
 /**
@@ -47,6 +48,8 @@
         classImporter = new AdaImport(thread);
     else if (fileName.endsWith(QLatin1String(".pas")))
         classImporter = new PascalImport(thread);
+    else if (fileName.endsWith(QLatin1String(".cs")))
+        classImporter = new CSharpImport(thread);
 #ifndef DISABLE_CPP_IMPORT
     else
         classImporter = new CppImport(thread);  // the default.
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/import_utils.cpp #1274011:1274012
@@ -186,7 +186,6 @@
         return o;
     }
     UMLFolder *logicalView = umldoc->rootFolder(Uml::ModelType::Logical);
-    const Uml::ProgrammingLanguage pl = UMLApp::app()->activeLanguage();
     if (parentPkg == NULL) {
         // uDebug() << "Import_Utils::createUMLObject(" << name
         //     << "): parentPkg is NULL, assuming Logical View";
@@ -228,6 +227,7 @@
                         continue;
                     }
                     int wantNamespace = KMessageBox::Yes;
+                    const Uml::ProgrammingLanguage pl = UMLApp::app()->activeLanguage();
                     if (pl == Uml::ProgrammingLanguage::Cpp) {
                         // We know std and Qt are namespaces.
                         if (scopeName != "std" && scopeName != "Qt") {
@@ -322,6 +322,9 @@
         assoc->setUMLPackage(umldoc->rootFolder(Uml::ModelType::Logical));
         umldoc->addAssociation(assoc);
     }
+    if (o == NULL) {
+        uError() << "is NULL!";
+    }
     return o;
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimpwizard/codeimpselectpage.cpp #1274011:1274012
@@ -330,6 +330,9 @@
     case Uml::ProgrammingLanguage::Python:
         m_fileExtensions << "*.py" << "*.pyw";
         break;
+    case Uml::ProgrammingLanguage::CSharp:
+        m_fileExtensions << "*.cs";
+        break;
     default:
         break;
     }




More information about the umbrello-devel mailing list