[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Tue Feb 1 11:20:56 UTC 2005
CVS commit by okellogg:
Prepare for IDL import - last addition for 1.4
A idlimport.cpp 1.1 [no copyright]
A idlimport.h 1.1 [no copyright]
M +1 -0 Makefile.am 1.54
M +17 -3 classimport.cpp 1.70
M +14 -1 classimport.h 1.25
M +10 -3 uml.cpp 1.135
--- kdesdk/umbrello/umbrello/Makefile.am #1.53:1.54
@@ -49,4 +49,5 @@
kplayerslideraction.cpp \
hierarchicalcodeblock.cpp \
+idlimport.cpp \
infowidget.cpp \
interface.cpp \
--- kdesdk/umbrello/umbrello/classimport.cpp #1.69:1.70
@@ -30,4 +30,5 @@
#include "template.h"
#include "association.h"
+#include "idlimport.h"
#include "classparser/lexer.h"
#include "classparser/driver.h"
@@ -289,4 +290,17 @@ void ClassImport::feedTheModel(QString f
}
+void ClassImport::importIDL(QStringList idlFileList) {
+ char *umbrello_incpath = getenv( "UMBRELLO_INCPATH" );
+ if (umbrello_incpath) {
+ m_includePathList = QStringList::split( ':', umbrello_incpath );
+ }
+ for (QStringList::Iterator fileIT = idlFileList.begin();
+ fileIT != idlFileList.end(); ++fileIT) {
+ QString fileName = (*fileIT);
+ m_umldoc->writeToStatusBar(i18n("Importing file: %1").arg(fileName));
+ IDLImport::parseFile(fileName);
+ }
+}
+
void ClassImport::importCPP(QStringList headerFileList) {
// Reset the driver
@@ -304,8 +318,8 @@ void ClassImport::importCPP(QStringList
if (umbrello_incpath) {
- QStringList includes = QStringList::split( ':', umbrello_incpath );
+ m_includePathList = QStringList::split( ':', umbrello_incpath );
- QStringList::Iterator end(includes.end());
- for (QStringList::Iterator i(includes.begin()); i != end; ++i) {
+ QStringList::Iterator end(m_includePathList.end());
+ for (QStringList::Iterator i(m_includePathList.begin()); i != end; ++i) {
m_driver->addIncludePath( *i );
}
--- kdesdk/umbrello/umbrello/classimport.h #1.24:1.25
@@ -37,9 +37,14 @@ public:
/**
- *
+ * Import C++ files.
*/
void importCPP( QStringList headerFiles );
/**
+ * Import IDL files.
+ */
+ void importIDL( QStringList idlFiles );
+
+ /**
* Find or create a document object.
*/
@@ -102,4 +107,11 @@ public:
QString formatComment(const QString &comment);
+ /**
+ * Return the list of paths set by the environment variable UBRELLO_INCPATH.
+ */
+ QStringList includePathList() {
+ return m_includePathList;
+ }
+
private:
/**
@@ -114,4 +126,5 @@ private:
UMLDoc * m_umldoc; ///< just a shorthand for UMLApp::app()->getDocument()
CppDriver * m_driver;
+ QStringList m_includePathList; ///< splits the UMBRELLO_INCPATH env var.
QStringList m_seenFiles; ///< auxiliary buffer for feedTheModel()
/**
--- kdesdk/umbrello/umbrello/uml.cpp #1.134:1.135
@@ -1389,8 +1389,15 @@ ClassImport * UMLApp::classImport() {
void UMLApp::slotImportClasses() {
- QStringList fileList = KFileDialog::getOpenFileNames(":import-classes",
- i18n("*.h *.hpp *.hxx|Header Files (*.h *.hpp *.hxx)\n*|All Files"), this, i18n("Select Classes to Import") );
+ QStringList fileList;
m_doc->setLoading(true);
+ if (m_activeLanguage == "IDL") {
+ fileList = KFileDialog::getOpenFileNames(":import-classes",
+ i18n("*.idl|IDL Files (*.idl)"), this, i18n("Select Code to Import") );
+ m_classImporter->importIDL( fileList );
+ } else {
+ fileList = KFileDialog::getOpenFileNames(":import-classes",
+ i18n("*.h *.hpp *.hxx|Header Files (*.h *.hpp *.hxx)\n*|All Files"), this, i18n("Select Classes to Import") );
m_classImporter->importCPP( fileList );
+ }
m_doc->setLoading(false);
}
More information about the umbrello-devel
mailing list